Commit Graph

29776 Commits

Author SHA1 Message Date
Scott Somerville 7180e539de Add getWarmer and getTranslog method to NodeIndicesStats (#28092)
When calling the node stats action via the Java API it was not able to return
information about warmers and translog even though that is available through 
the REST API. This change adds methods to make the responses more 
consistent.
2018-01-05 14:19:09 +01:00
Martijn van Groningen a38f70b5dd
fix doc mistake 2018-01-05 14:12:51 +01:00
Sian Lerk Lau a4a7150b56
Added ASN support for Ingest GeoIP plugin.
Closes #27849
2018-01-05 14:07:04 +01:00
Jim Ferenczi cb783bcb57
Fix global aggregation that requires breadth first and scores (#27942)
* Fix global aggregation that requires breadth first and scores

This change fixes the deferring collector when it is executed in a global context
with a sub collector thats requires to access scores (e.g. top_hits aggregation).
The deferring collector replays the best buckets for each document and re-executes the original query
if scores are needed. When executed in a global context, the query to replay is a simple match_all
 query and not the original query.

Closes #22321
Closes #27928
2018-01-05 11:41:36 +01:00
Jason Tedor 480aeb7eb7
Introduce Gradle wrapper
We have agreed to introduce the Gradle wrapper to simplify workflows for
developers, and managing infrastructure (e.g., CI, release builds, etc.)
as well as consideration for the fact that other projects in our stack
use Gradle and do not necessarily want to be tied to our Gradle version.

Relates #28065
2018-01-04 16:36:13 -05:00
Jason Tedor 4656c55639
Ignore GIT_COMMIT when calculating commit hash
When finding the commit hash for the build to place in the JAR manifest
(which is used to identity the build), the scm-info plugin assumes that
GIT_COMMIT is the commit for this build. That assumption is wrong, this
build could be a sub-build of another build that GIT_COMMIT belongs
to. If GIT_COMMIT is set, we ignore the commit hash calculated by
scm-info and calculate the hash ourselves.

Relates #28082
2018-01-04 14:58:34 -05:00
Ryan Ernst cb2334a78b Re-enable bwc tests after #27881 was backported 2018-01-04 09:58:38 -08:00
Tim Brooks be5da2815d
Set the elasticsearch-nio codebase for tests (#28067)
This commit sets the elasticsearch-nio code base in the
BootstrapForTesting class. This is necessary as that codebase needs
socket permissions. Setting the codebase manually is necessary as
intellij does not package our internal libraries when running tests.
2018-01-04 09:55:51 -07:00
Simon Willnauer 47a506d2db Bump compat version for local depdendent test to 6.2.0 2018-01-04 16:49:31 +01:00
Simon Willnauer b68f7ed8c3
Pass `java.locale.providers=COMPAT` to Java 9 onwards (#28080)
Java 9 added some enhancements to the internationalization support that
impact our date parsing support. To ensure flawless BWC and consistent
behavior going forward Java 9 runtimes requrie the system property
`java.locale.providers=COMPAT` to be set.

Closes #10984
2018-01-04 16:43:51 +01:00
Yannick Welsch ca325194d9
Allow shrinking of indices from a previous major (#28076)
Lucene does not allow adding Lucene 6 files to a Lucene 7 index. This commit ensures that we carry over the Lucene version to the newly created Lucene index.

Closes #28061
2018-01-04 16:23:25 +01:00
David Turner 19c61e894e
Remove deprecated exceptions (#28059)
DeleteFailedEngineException and IndexFailedEngineException were
deprecated in 6.0. This commit removes them entirely in 7.0.
2018-01-04 11:00:29 +00:00
Yannick Welsch 7cdbae2da8
Add Writeable.Reader support to TransportResponseHandler (#28010)
Allows TransportResponse objects not to implement Streamable anymore. As an example, I've adapted the response handler for ShardActiveResponse, allowing the fields in that class to become final.
2018-01-04 10:27:08 +01:00
Ryan Ernst d36ec18029
Plugins: Add plugin extension capabilities (#27881)
This commit adds the infrastructure to plugin building and loading to
allow one plugin to extend another. That is, one plugin may extend
another by the "parent" plugin allowing itself to be extended through
java SPI. When all plugins extending a plugin are finished loading, the
"parent" plugin has a callback (through the ExtensiblePlugin interface)
allowing it to reload SPI.

This commit also adds an example plugin which uses as-yet implemented
extensibility (adding to the painless whitelist).
2018-01-03 11:12:43 -08:00
kel bccf030841 Fix cluster.routing.allocation.enable and cluster.routing.rebalance.enable casing (#28037)
Fixes the default value of cluster.routing.allocation.enable and cluster.routing.rebalance.enable to be lower-case.
2018-01-03 18:03:52 +01:00
Christoph Büscher 29b07bb6c4 [Test] Fix scores for dcg in RankEvalRequestIT and RankEvalYamlIT
Allow small deviations when asserting ranking scores, otherwise some tests break
on floating point calculation differences e.g. when running on ARM.
2018-01-03 17:24:10 +01:00
Christoph Büscher 556d77c9ad
[Docs] Add note on limitation for significant_text with nested objects (#28052)
Add section to `significant_text` documentation mentioning that it currently
does not support use on nested objects.

Relates to #28050
2018-01-03 16:28:23 +01:00
Sian Lerk Lau 5e3ba8a88d Enable convert processor to support Long and Double. (#27957)
Closes #23085
2018-01-03 11:27:55 +01:00
Jason Tedor 6f52fbeac6
Enable Wildfly tests on JDK 9 and JDK 10
Previously we disabled these tests on JDK 9 and JDK 10 because Wildfly
10 did not support JDK 9 and JDK 10. With the release of Wildfly 11
supporting JDK 9 and JDK 10 and now that we depend on Wildfly 11 in
these tests, we can enable these tests on JDK 9 and JDK 10.

Relates #28042
2018-01-02 21:19:24 -05:00
Christoph Büscher 8925dabcb8 [Test] Fix allowed delta for calculated scores in DiscountedCumulativeGainTests 2018-01-02 16:46:31 +01:00
Tanguy Leroux d2939a9daa [Test] Mute DiscountedCumulativeGainTests on ARM
These tests fail on ARM architectures. This is tracked in
https://github.com/elastic/elasticsearch/issues/28048
2018-01-02 16:16:43 +01:00
Jason Tedor a91da9a9af
Only bind loopback addresses when binding to local
* Only bind loopback addresses when binding to local

Today when binding to local (the default) we bind to any address that is
a loopback address, or any address on an interface that declares itself
as a loopback interface. Yet, not all addresses on loopback interfaces
are loopback addresses. This arises on macOS where there is a link-local
address assigned to the loopback interface (fe80::1%lo0) and in Docker
services where virtual IPs of the service are assigned to the loopback
interface (docker/libnetwork#1877). These situations cause problems:
 - because we do not handle the scope ID of a link-local address, we end
   up bound to an address for which publishing of that address does not
   allow that address to be reached (since we drop the scope)
 - the virtual IPs in the Docker situation are not loopback addresses,
   they are not link-local addresses, so we end up bound to interfaces
   that cause the bootstrap checks to be enforced even though the
   instance is only bound to local

We address this by only binding to actual loopback addresses, and skip
binding to any address on a loopback interface that is not a loopback
address. This lets us simplify some code where in the bootstrap checks
we were skipping link-local addresses, and in writing the ports file
where we had to skip link-local addresses because again the formatting
of them does not allow them to be connected to by another node (to be
clear, they could be connected to via the scope-qualified address, but
that information is not written out).

Relates #28029
2018-01-02 07:04:09 -05:00
Jason Tedor 1877139e89 Fix assertion in Wildfly build
This commit fixes a flubbed assertion in the Wildfly build file; the
intention was to assert that we have only set the value of the
management port once except the assertion that the management port was
equal to zero when finding a matching log line was left off.
2018-01-01 18:03:15 -05:00
Jason Tedor 876b16e75a Fix typo in comment in Wildfly build
This commit fixes a typographical error in the Wildfly tests build
file. Oops.
2018-01-01 16:29:53 -05:00
Jason Tedor 3b0a428712
Use ephemeral ports in Wildfly tests
The Wildfly tests previously needed hardcoded ports which would
sometimes already be in use leading to Wildfly test failures because the
server could not bind during startup. We had to wait until some upstream
changes (wildfly/wildfly#9943) and (wildfly/wildfly-core#2390) were
released before we could use ephemeral ports in these tests. These
changes are released now so this commit changes the Wildfly tests to use
ephemeral ports when starting Wildfly.

Relates #28040
2018-01-01 16:27:30 -05:00
Gytis Šk 86bffa870b Update fuzzy-query.asciidoc (#28032) 2018-01-01 08:44:04 +01:00
Timoshenko 27918567eb Just another elasticsearch library (#27996)
Just another elasticsearch library developed in Golang
2018-01-01 08:40:26 +01:00
Tim Brooks c775374125
Disable nio test transport (#28028)
This commit disables the nio transport as an option for the test
transport in integration tests. This is because it does not currently
run properly in intellij due to socket permissions. It should be
reenabled once #27881 is merged (and the proper permissions are added).
2017-12-31 14:59:38 -07:00
Yannick Welsch 2603391c00
Add node id to shard failure message (#28024)
This will help in the allocation explain API to figure out which node a shard was last allocated to before it failed.

Closes #28018
2017-12-29 17:40:28 +01:00
Mayya Sharipova 100a7b1f01 Introduce limit to the number of terms in Terms Query (#27968)
- Correct a bug in the referenced settings

Closes #18829
2017-12-29 10:31:18 -05:00
Daniel Mitterdorfer 8085ec504b Upgrade Gradle Shadow plugin to 2.0.2
With this commit we upgrade the Gradle Shadow plugin that is used in our
benchmarks to version 2.0.2. This version does not use APIs that are
deprecated in Gradle 4.x.
2017-12-29 10:57:11 +01:00
Daniel Mitterdorfer bcd72775ff Upgrade to JMH 1.19 2017-12-29 10:56:47 +01:00
Mayya Sharipova dcde895f49
Introduce limit to the number of terms in Terms Query (#27968)
- Introduce index level settings to control the maximum number of terms
    that can be used in a Terms Query
- Throw an error if a request exceeds this max number

Closes #18829
2017-12-28 17:36:29 -05:00
Shaunak Kashyap da0ed578b2 Fixing typo in param name: values => sources (#28016) 2017-12-28 18:18:30 +01:00
Vlad Holubiev 31d4a4bf7c [DOCS] Fix link formatting (#27990) 2017-12-26 16:25:05 +00:00
Vlad Holubiev 7b14e4b8e0 [DOCS] Remove extra word (#27989) 2017-12-26 16:24:29 +00:00
Doug Turnbull bd0d10d716 Carry forward weights, etc on rescore rewrite (#27981) 2017-12-26 16:36:57 +01:00
Doug Turnbull 507aac4424 Update CONTRIBUTING.md to indicate Gradle >= 4.3 is required (#27980)
Relates #27885.
2017-12-26 12:46:44 +00:00
Maxime Gréau 771defb97c
Build: Add 3rd party dependencies report generation (#27727)
* Adds task dependenciesInfo to BuildPlugin to generate a CSV file with dependencies information (name,version,url,license)
* Adds `ConcatFilesTask.groovy` to concatenates multiple files into one
* Adds task `:distribution:generateDependenciesReport` to concatenate `dependencies.csv` files into a single file (`es-dependencies.csv` by default)

 # Examples:
      $ gradle dependenciesInfo :distribution:generateDependenciesReport

 ## Use `csv` system property to customize the output file path
     $ gradle dependenciesInfo :distribution:generateDependenciesReport -Dcsv=/tmp/elasticsearch-dependencies.csv

 ## When branch is not master, use `build.branch` system property to generate correct licenses URLs
     $ gradle dependenciesInfo :distribution:generateDependenciesReport -Dbuild.branch=6.x -Dcsv=/tmp/elasticsearch-dependencies.csv
2017-12-26 10:51:47 +01:00
Jim Ferenczi 0b2c8c835e
Fix composite aggregation when after term is missing in the shard (#27936)
This change fixes a bug when a keyword term in the `after` key is not present in the shard.
In this case the global ord of the document values are compared with the insertion point of the
`after` keyword and values that are equal to the insertion point should be considered "after" the top value.
2017-12-26 09:58:49 +01:00
Tanguy Leroux f6b9d3fd8f [Test] Mute testAbortedSnapshotDuringInitDoesNotStart()
The failing test is tracked in #27974
2017-12-23 19:51:41 +01:00
Jason Tedor 87819a0a7f Disable reindex from old tests on JDK 10
We disable these tests because the JVM flags we use will not start with
JDK 10. Since we do not support running these old versions on newer JDKs
anyway, this commit disables testing of these when running on JDK 10.
2017-12-23 08:38:55 -05:00
Nhat Nguyen 436a243e3c Set global checkpoint before open engine from store (#27972)
In PR #27965, we set the global checkpoint from the translog in a store
recovery. However, we set after an engine is opened. This causes the
global checkpoint assertion in TranslogWriter violated as if we are
forced to close the engine before we set the global checkpoint. A
closing engine will close translog which in turn read the current global
checkpoint; however it is still unassigned and smaller than the initial
global checkpoint from translog.

Closes #27970
2017-12-23 10:13:27 +01:00
Nhat Nguyen 6629f4ab0d
Rollback primary before recovering from translog (#27804)
Today we always recover a primary from the last commit point. However 
with a new deletion policy, we keep multiple commit points in the
existing store, thus we have chance to find a good starting commit
point. With a good starting commit point, we may be able to throw away
stale operations. This PR rollbacks a primary to a starting commit then
recovering from translog.

Relates #10708
2017-12-22 18:25:36 -05:00
Boaz Leskes adb49efe17
Non-peer recovery should set the global checkpoint (#27965)
Non-Peer recoveries should restore the global checkpoint rather than wait for the activation of the primary. This brings us a step closer to a universe where a recovered shard always has a valid global checkpoint. Concretely:

1) Recovery from store can read the checkpoint from the translog
2) Recovery from local shards and snapshots can set the global checkpoint to the local checkpoint as this is the only copy of the shard.
3) Recovery of an empty shard can set it to `NO_OPS_PERFORMED`

Peer recoveries will follow but require more work and thus will have their own PR.

I also used the moment to clean up `IndexShard`'s api around starting the engine and doing recovery from the translog. The current naming are a relic of the past and don't align with the current naming schemes in the engine.
2017-12-22 21:39:12 +01:00
Nhat Nguyen 6435928c4f Remove no existing commits assertion in onInit()
This assertion does not hold if a shard is recovered from an empty store
but failed then retries. Moreover, if the openMode is CREATE_INDEX_*, we
pass CREATE mode to the IndexWriterConfig to create a new index and
overwrite the existing one.

Closes #27960
2017-12-22 15:04:16 -05:00
Ryan Ernst 0375d887f2
Plugins: Add validation to plugin descriptor parsing (#27951)
This commit checks there are no leftover unparsed elements when parsing
a plugin descriptor.
2017-12-22 10:02:11 -08:00
Jason Tedor 0423155fc6
Also skip Javadoc task for client JARs on JDK 10
We disabled the Javadoc task on JDK 10 due to an apparent bug in Javadoc
generation on JDK 10. However, the client JAR task sets up its own
Javadoc task for client JARs (because it merely copies the non-client
Javadoc JAR). This commit diables that task too, since the Javadocs for
the non-client JAR will not exist.

Relates #27962
2017-12-22 07:34:00 -05:00
Tanguy Leroux bd9daf422e
Do not start snapshots that are deleted during initialization (#27931)
When a new snapshot is created it is added to the cluster state as a
snapshot-in-progress in INIT state, and the initialization is kicked
off in a new runnable task by SnapshotService.beginSnapshot(). The
initialization writes multiple files before updating the cluster state
to change the snapshot-in-progress to STARTED state. This leaves a
short window in which the snapshot could be deleted (let's say, because
the snapshot is stuck in INIT or because it takes too much time to
upload all the initialization files for all snapshotted indices). If
the INIT snapshot is deleted, the snapshot-in-progress becomes ABORTED
but once the initialization in SnapshotService.beginSnapshot() finished
it is change back to STARTED state again.

This commit avoids an ABORTED snapshot to be started if it has been
deleted during initialization. It also adds a test that would have failed
with the previous behavior, and changes few method names here and there.
2017-12-22 12:59:36 +01:00
Alexander Reelsen 012ea03f54
Tests: Fix packaging tests after attachment plugin upgrade (#27959)
The tests explicitely check for the version of some java dependencies
and thus needed to be fixed.

Relates #27824

Closes #27916
2017-12-22 12:16:17 +01:00