Commit Graph

29712 Commits

Author SHA1 Message Date
Martijn van Groningen 90ee35930a
ingest: upgraded ingest geoip's geoip2's dependencies. 2017-12-21 08:43:02 +01:00
Andy Bristol 863432668b [TEST] logging for update by query test #27820 2017-12-20 18:27:16 -05:00
Tim Brooks 06b313025c
Add elasticsearch-nio jar for base nio classes (#27801)
This is related to #27802. This commit adds a jar called
elasticsearch-nio that contains the base nio classes that will be used
for the tcp nio transport and eventually the http nio transport.

The jar does not depend on elasticsearch:core, so all references to core
have been removed.
2017-12-20 16:29:16 -06:00
Jason Tedor 8bd7a19d61
Use full profile on JDK 10 builds
JDK 10 has gone fully-modular. This means that:
 - when targeting JDK 8 with a JDK 10 compiler, we have to use the full
   profile
 - when targeting JDK 10 with a JDK 10 compiler, we have to use
   -add-modules java.base

Today we only target JDK 8 (our minimum compatibility version) so we
need to change the compiler flags conditional on using a JDK 10
compiler. This commit does that.

Relates #27884
2017-12-20 16:22:21 -05:00
Jason Tedor c8371fa0b4
Require Gradle 4.3
This commit sets the minimum Gradle version to version 4.3. This the
minimum Gradle version that understands JDK 10 in code.

Relates #27885
2017-12-20 16:14:19 -05:00
Sian Lerk Lau 47eefbe889 Enable grok processor to support long, double and boolean (#27896) 2017-12-20 11:19:49 -08:00
Maxime Gréau d9fff6d8f2 Add unreleased v6.1.2 version 2017-12-20 19:51:29 +01:00
Nhat Nguyen 3c865d6d04 TEST: reduce blob size #testExecuteMultipartUpload
If a large blob size and small buffer size are picked, this test causes out of memory.

https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+master+intake/1061/
2017-12-20 12:43:05 -05:00
Nhat Nguyen 54b6885844
Check index under the store metadata lock (#27768)
Today when we get a metadata snapshot directly from a store directory, 
we acquire a metadata lock, then acquire an IndexWriter lock. However,
we create a CheckIndex in IndexShard without acquiring the metadata lock 
first. This causes a recovery failed because the IndexWriter lock can be
still held by method snapshotStoreMetadata. This commit makes sure to
create a CheckIndex under the metadata lock.

Closes #24481
Closes #27731
Relates #24787
2017-12-20 11:26:06 -05:00
Colin Goodheart-Smithe 4cbbe3ed93
Fixes DocStats to not report index size < -1 (#27863)
Previously to this change when DocStats are added together (for example when adding the index size of all primary shards for an index)  we naively added the `totalSizeInBytes` together. This worked most of the time but not when the index size on one or multiple shards was reported to be `-1` (no value).

This change improves the logic by considering if the current value or the value to be added is `-1`:
* If the current and new value are both `-1` the value remains at `-1`
* If the current value is `-1` and the new value is not `-1`, current value is changed to be equal to the new value
* If the current value is not `-1` and the new value is `-1` the new value is ignored and the current value is not changed
* If both the current and new values are not `-1` the current value is changed to be equal to the sum of the current and new values.

The change also re-enables the failing rollover YAML test that was failing due to this bug.
2017-12-20 14:45:09 +00:00
Martijn van Groningen dd0cb11d53
Fixed test to be up to date with the new database files. 2017-12-20 14:41:41 +01:00
Adrien Grand 77711508b0
Upgrade to Lucene 7.2.0. (#27910) 2017-12-20 14:17:40 +01:00
Boaz Leskes 0ca141880f Disable TestZenDiscovery in cloud providers integrations test
TestZenDiscovery is used to allow discovery based on in memory structures. This isn't a relevant for the cloud providers tests (but isn't a problem at the moment either)
2017-12-20 14:02:55 +01:00
Simon Willnauer 5b229c31d6
Use `_refresh` to shrink the version map on inactivity (#27918)
We used to shrink the version map under an external lock. This is
quite ambigious and instead we can simply issue an empty refresh to
shrink it.

Closes #27852
2017-12-20 13:53:41 +01:00
Simon Willnauer c4fae375b0
Make KeyedLock reentrant (#27920)
Today we prevent that the same thread acquires the same lock more than once.
This restriction is a relict form the early days of this concurrency construct
and can be removed.
2017-12-20 13:53:03 +01:00
Martijn van Groningen 4585cc8312
ingest: Upgraded the geolite2 databases. 2017-12-20 10:42:46 +01:00
Tanguy Leroux 0f80e7c5f6
[Test] Fix IndicesClientDocumentationIT (#27899)
The last operation executed in IndicesClientDocumentationIT.testCreate()
 is an asynchronous index creation. Because nothing waits for its
 completion, on slow machines the index can sometimes be created after
 the testCreate() test is finished, and it can fail the following test.

 Closes #27754
2017-12-20 09:31:10 +01:00
Simon Willnauer 0779af6dd2
Move uid lock into LiveVersionMap (#27905)
While the LiveVersionMap is an internal class that belongs to the engine we do
rely on some external locking to enforce the desired semantics.  Yet, in tests
we mimic the outer locking but we don't have any way to enforce or assert on
that the lock is actually hold.  This change moves the KeyedLock inside the
LiveVersionMap that allows the engine to access it as before but enables
assertions in the LiveVersionMap to ensure the lock for the modifying or
reading key is actually hold.
2017-12-20 08:34:58 +01:00
Jason Tedor 8b2eee39f0 Increase Gradle heap space to 1536m
This commit increases the heap space for the Gradle processes to
1536m. Note that the default is 1024m.
2017-12-19 21:45:43 -05:00
Stuart Cam e458c6b762
timestamp and ttl in index requests (#27888)
timestamp and ttl are not accepted anymore as parameters of index/update requests.
2017-12-20 10:43:21 +11:00
Christoph Büscher 05aa1a6033 [Tests] Remove redudant rest test added in #27900
The removed rest test doesn't really test the the issue
reported in #27841 and adds nothing on top of the unit test.
2017-12-19 20:04:37 +01:00
Christoph Büscher fb2fd4e8ee
Fix preserving FiltersAggregationBuilder#keyed field on rewrite (#27900)
Currently FiltersAggregationBuilder#doRewrite creates a new FiltersAggregationBuilder which doesn't correctly copy the original "keyed" field if a non-keyed filter gets rewritten.
This can cause rendering bugs of the output aggregations like the one reported in #27841.

Closes #27841
2017-12-19 19:56:12 +01:00
Tim Brooks 41677b0b9e
Default to no http read timeout (#27879)
Elasticsearch offers a number of http requests that can take a while to
execute. In #27713 we introduced an http read timeout that defaulted to
30 seconds. This means that if no reads happened for 30 seconds (even
after a request is received), the connection would be closed due to
timeout.

This commit disables the read timeout by default to allow us to evaluate
the impact of read timeouts and to avoid introducing distruptive
behavior.
2017-12-19 11:44:48 -07:00
David Pilato 3ca39186d1
Fix missing comma in examples (#27904) 2017-12-19 18:28:39 +01:00
Nhat Nguyen 0c1ac2e700 Revert "testCorruptTranslogTruncation: add logging"
We can reduce logging for this test as it's fixed in https://github.com/elastic/elasticsearch/pull/27887
This reverts commit e0e698bc26.
2017-12-19 12:13:23 -05:00
Nhat Nguyen 6b0d90b9d4
TEST: Corrupt some translog files used in recovery (#27887)
Currently, method corruptTranslogFiles corrupts some translog files
whose translog_gen are at least the min_required_translog_gen from the
translog checkpoint. However this condition is not enough for
recoverFromTranslog to be always failed.  If we corrupt only translog
operations from only translog files whose translog_gen are smaller than
the min_translog_gen of a recovering index commit, recoverFromTranslog
will be ok as we won't read translog operations from those files.

This commit makes sure corruptTranslogFiles to corrupt some translog 
files that will be used in recoverFromTranslog.

Closes #27538
2017-12-19 12:01:49 -05:00
Nhat Nguyen 25b0a7b20f Revert "Add @AwaitsFix for #27890"
This test was fixed in e9a3932dbc.

This reverts commit 1383cab267.
2017-12-19 11:27:03 -05:00
Nhat Nguyen e9a3932dbc Fix incorrectly assign local checkpoint from max_seqno
Relates #27837
2017-12-19 11:18:36 -05:00
Andrew Banchich 3b58582059 [Docs] Grammatical fix in important-settings.asciidoc (#27654) 2017-12-19 17:08:08 +01:00
kel 192b263e31 Make AbstractQueryBuilder.declareStandardFields to be protected (#27894) 2017-12-19 16:34:08 +01:00
Nik Everett 32669ca265
Test: Change randomValueOtherThan(null, supplier) (#27901)
When the first parameter of `ESTestCase#randomValueOtherThan` is `null`
then run the supplier until it returns non-`null`. Previously,
`randomValueOtherThan` just ran the supplier one time which was
confusing.

Unexpectedly, it looks like not tests rely on the original `null`
handling.

Closes #27821
2017-12-19 10:23:38 -05:00
David Turner b1039164a1 Mute MigrationDocumentationIT#testClusterHealth()
Relates #27754
2017-12-19 12:16:49 +00:00
David Turner b26cc36928 Mute testRetentionPolicyChangeDuringRecovery
Relates #27861.
2017-12-19 12:05:45 +00:00
Albert Zaharovits 01a47baa10
Retain originalIndex info when rewriting FieldCapabilities requests (#27761)
A FieldCapabilities request can cover multiple indices (or aliases pointing to multiple indices).
When rewriting the request for each index, store the original requested indices.
2017-12-19 13:38:41 +02:00
David Turner 1383cab267 Add @AwaitsFix for #27890 2017-12-19 08:41:42 +00:00
Boaz Leskes bea9471b2f
Use port 0 InternalTestCluster nodes (#27859)
We currently have a complicated port assignment scheme to make sure that the nodes span off by the internal test cluster will be assigned fixed port ranges that will also not collide between clusters. The port ranges need to be fixed in advance so that the nodes will be able to find each other via `UnicastZenPing`.

This approach worked well for the last few years but we are now at a point that our testing has grown beyond it and we exceed the 5 reusable ranges per JVM. This means that nodes are not always assigned the first 5 ports in their range which causes cluster formation issues. On top of that, most of the clusters that are span up don't even rely on `UnicastZenPing` but rather `MockZenPings` that uses in memory maps for discovery (with the down side that they are not influenced by network disruption simulations).

This PR changes `InternalTestCluster` to use port 0 as a fixed assignment. This will allow the OS to manage ports and will ensure we don't have collisions. For tests that need to simulate network disruptions (and thus can't use `MockZenPings`), a new `UnicastHostProvider` is introduced that is based on the current state of the test cluster. Since that is only resolved at run time, it is aware of the port assignments of the OS.

Closes #27818
Closes #27762
2017-12-19 08:43:03 +01:00
Jason Tedor aebdb2a646 Filter current version from compatible versions
We need to filter the current version from the list of compatible
versions to match how we calculate the list of compatible versions in
Gradle.
2017-12-18 17:37:22 -05:00
Alexander Kazakov d9a0b50893 Using DocValueFormat::parseBytesRef for parsing missing value parameter (#27855) 2017-12-18 20:50:58 +01:00
Jason Tedor 054711dd88 More refinement of version is compatible test
This test further refines the version is compatible test, adding
additional handling of edge cases.
2017-12-18 13:20:22 -05:00
Nhat Nguyen 0d99fadd2a Put back lastSyncedGlobalCheckpoint in deletion policy
The PR #27837 unintentionally changed to an in memory global checkpoint.
2017-12-18 11:54:50 -05:00
Jason Tedor fa1159a854 Tighten version compatibility test
This commit tightens the version compatibility test, generalizing it
beyond a hard-coded 7.0.0.
2017-12-18 10:40:06 -05:00
Yannick Welsch a5e8a221ec
Move GlobalCheckpointTracker and remove SequenceNumbersService (#27837)
This commit moves GlobalCheckpointTracker from the engine to IndexShard, where it better fits logically: Tracking the global checkpoint based on the local checkpoints of all shards in the replication group is not a property of the engine, but rather a property fulfilled by the current primary shard. The LocalCheckpointTracker on the other hand is driven by the contents of the local translog. By moving GlobalCheckpointTracker to IndexShard, it makes little sense to keep the SequenceNumbersService class around - it would only wrap the LocalCheckpointTracker. This commit therefore removes the class and replaces occurrences of SequenceNumbersService in the engine directly by LocalCheckpointTracker.
2017-12-18 15:27:44 +01:00
Alan Woodward af3f63616b
Allow TrimFilter to be used in custom normalizers (#27758)
AnalysisFactoryTestCase checks that the ES custom token filter multi-term
awareness matches the underlying lucene factory.  For the trim filter this
won't be the case until LUCENE-8093 is released in 7.3, so we add a
temporary exclusion

Closes #27310
2017-12-18 14:27:03 +00:00
Jason Tedor 76771242e8 Fix version tests for release tests
This commit fixes the version tests for release tests. The problem here
is that during release tests all version should be treated as released
so the assertions must be modified accordingly.

Relates #27815
2017-12-18 08:51:37 -05:00
Boaz Leskes 9cd69e7ec1
recovery from snapshot should fill gaps (#27850)
When snapshotting the primary we capture a lucene commit at an arbitrary moment from a sequence number perspective. This means that it is possible that the commit misses operations and that there is a gap between the local checkpoint in the commit and the maximum sequence number.

When we restore, this will create a primary that "misses" operations and currently will mean that the sequence number system is stuck (i.e., the local checkpoint will be stuck). To fix this we should fill in gaps when we restore, in a similar fashion to normal store recovery.
2017-12-18 13:33:39 +01:00
kel 26fc717ddd Remove unused class PreBuiltTokenFilters (#27839) 2017-12-18 11:48:38 +01:00
David Turner f0b21e3182
Make randomNonNegativeLong() draw from a uniform distribution (#27856)
Currently randomNonNegativeLong() returns 0 half as often as any positive long,
but random number generators are typically expected to return
uniformly-distributed values unless otherwise specified. This fixes this issue
by mapping Long.MIN_VALUE directly onto 0 rather than resampling.
2017-12-18 09:57:40 +00:00
kel 7a27a2770b Reject scroll query if size is 0 (#22552) (#27842) 2017-12-18 10:38:41 +01:00
Jim Ferenczi 55b71a871b Adapt rest test after backport. Relates #27833 2017-12-18 10:36:44 +01:00
David Turner e6da564eb1
Handle case where the hole vertex is south of the containing polygon(s) (#27685)
Normally the hole is assigned to the component of the first edge to the south
of one of its vertices, but if the chosen hole vertex is south of everything
then the binary search returns -1 yielding an ArrayIndexOutOfBoundsException.
Instead, assign the vertex to the component of the first edge to its north.
Subsequent validation catches the fact that the hole is outside its component.

Fixes #25933
2017-12-18 08:50:40 +00:00