Commit Graph

29968 Commits

Author SHA1 Message Date
Alan Woodward 77617c8e62
[TEST] Add test for *_range fields in query_string queries (#27756)
[TEST] Add test for *_range fields in query_string queries

Closes #26555
2017-12-12 13:33:37 +00:00
Tanguy Leroux a1ed347110
Fail restore when the shard allocations max retries count is reached (#27493)
This commit changes the RestoreService so that it now fails the snapshot 
restore if one of the shards to restore has failed to be allocated. It also adds
a new RestoreInProgressAllocationDecider that forbids such shards to be 
allocated again. This way, when a restore is impossible or failed too many 
times, the user is forced to take a manual action (like deleting the index 
which failed shards) in order to try to restore it again.

This behaviour has been implemented because when the allocation of a 
shard has been retried too many times, the MaxRetryDecider is engaged 
to prevent any future allocation of the failed shard. If it happens while 
restoring a snapshot, the restore hanged and was never completed because 
it stayed around waiting for the shards to be assigned (and that won't happen).
It also blocked future attempts to restore the snapshot again. With this commit,
the restore does not hang and is marked as failed, leaving failed shards 
around for investigation.

This is the second part of the #26865 issue.

Closes #26865
2017-12-12 09:51:18 +01:00
Boaz Leskes cfc3b2d344 remove InternalEngine.compareOpToLuceneDocBasedOnVersions as it is unused
relates #27720
2017-12-12 09:38:54 +01:00
Tanguy Leroux f27cb96a64
Use AmazonS3.doesObjectExist() method in S3BlobContainer (#27723)
This pull request changes the S3BlobContainer.blobExists() method implementation 
to make it use the AmazonS3.doesObjectExist() method instead of 
AmazonS3.getObjectMetadata(). The AmazonS3 implementation takes care of 
catching any thrown AmazonS3Exception and compares its response code with 404, 
returning false (object does not exist) or lets the exception be propagated.
2017-12-12 09:30:36 +01:00
Jack Conradson 8188d9f7e5
Painless: Only allow Painless type names to be the same as the equivalent Java class. (#27264)
Also adds a parameter called only_fqn to the whitelist to enforce that a painless type must be specified as the fully-qualifed java class name.
2017-12-11 16:37:35 -08:00
Jason Tedor cd474df972
Remove RPM and Debian integration tests
We have tests that manually unpackage the RPM and Debian package
distributions and start a cluster manually (not from the service) and
run a basic suite of integration tests against them. This is problematic
because it is not how the packages are intended to be used (instead,
they are intended to be installed using the package installation tools,
and started as services) and so violates assumptions that we make about
directory paths. This commit removes these integration tests, instead
relying on the packaging tests to ensure the packages are not
broken. Additionally, we add a sanity check that the package
distributions can be unpackaged. Finally, with this change we can remove
some leniency from elasticsearch-env about checking for the existence of
the environment file which the leniency was there solely for these
integration tests.

Relates #27725
2017-12-11 15:40:10 -05:00
Jason Tedor 6bc40e4bd3
No longer unidle shard during recovery
Previously we would unidle a primary shard during recovery in case the
recovery target would miss a background global checkpoint sync. However,
the background global checkpoint syncs are no longer tied to the primary
shard falling idle and so this unidling is no longer needed.

Relates #27757
2017-12-11 13:26:27 -05:00
Andrew Banchich 1cd5575997 Update query-dsl.asciidoc (#27669) 2017-12-11 18:06:08 +01:00
Simon Willnauer ebb93db010
Remove pre 6.0.0 support from InternalEngine (#27720)
This removes special casing for documents without a sequence ID.
This code is complex enough with seq IDs we should clean up things
when we can and we don't support 5.x indexing in 7.x anymore
2017-12-11 16:39:06 +01:00
Jason Tedor 22e294ce6d
Fix performance of RoutingNodes#assertShardStats
The performance of this method is abysmal, it leads to the
balanced/unbalanced cluster tests taking twenty seconds! The reason for
the performance issue is a quadruple-nested for loop. The inner
double-nested loop is partitioning shards by shard ID in disguise, so we
simply extract this into computing a partition of shards by shard ID
once. Now balanced/unbalanced cluster test does not take twenty seconds
to run.

Relates #27747
2017-12-11 10:18:06 -05:00
Christoph Büscher 97b25f3b0c Merge branch 'master' into rankeval 2017-12-11 15:19:16 +01:00
javanna e01643126b [TEST] extend wait_for_active_shards randomization to include 'all' value
This was already changed in 6.x as part of the backport of the recently added open and create index API. wait_for_active_shards can be a number but also "all", with this commit we verify that providing "all" works too.
2017-12-11 14:27:12 +01:00
Jim Ferenczi b35c459c96 [TESTS] Fix expectations for GeoShapeQueryBuilderTests#testWrongFieldType
Relates #27730
2017-12-11 13:31:58 +01:00
olcbean 25c606cf09 Remove deprecated names for string distance algorithms (#27640)
#27409 deprecated the incorrectly-spelled `levenstein` in favour of `levenshtein`.
#27526 deprecated the inconsistent `jarowinkler` in favour of `jaro_winkler`.

These changes were merged into 6.2, and this change removes them entirely in 7.0.
2017-12-11 12:16:04 +00:00
Robin Neatherway 85dd1880fc Fix some type checks that were always false (#27706)
* CustomFieldQuery: removed a redundant type check that was 
already done higher up in the same if/else chain.
* PrioritizedEsThreadPoolExecutor: removed a check that was 
simply a duplicate of one earlier one and would never have been true.
2017-12-11 11:28:03 +01:00
Christoph Büscher 87313e12ba
Use typeName() to check field type in GeoShapeQueryBuilder (#27730)
The current code contains an instanceOf check and a comment that this should
eventually be changed to something else. The typeName() should return a unique
name for the field type in question (geo_shape) so it can be used instead.
2017-12-11 11:03:13 +01:00
Jason Tedor 87f7b9c0f9 Speed up rejected execution contains node name test
This commit addresses slowness in the test that a rejected execution
contains the node name. The slowness came from setting the count on a
countdown latch too high (two in the case of the search thread pool)
where there would never be a second countdown on the latch. This means
that when then test node is shutting down, closing the node would have
to wait a full ten seconds before forcefully terminating the thread
pool. This commit fixes the issue so that the node can close
immediately, shaving ten seconds off the run time of the test.

Relates #27663
2017-12-10 13:04:22 -05:00
Jason Tedor 8c8b1dc2cf Fix index with unknown setting test
This commit fixes the test of an index with an unknown setting. The
problem here is that we were manipulating the index state on disk, but a
cluster state update could arrive between us manipulating the index
state on disk and us restarting the node, leading to the index state
that we just intentionally broke being fixed. As such, after restart,
the index state would not be in the state that we expected it to be in
and the test would fail. To address this, we hook into the restart and
break the index state immediately before the node is started again.

Relates #26995
2017-12-09 09:12:40 -05:00
Tim Brooks d1acb7697b
Remove internal channel tracking in transports (#27711)
This commit attempts to continue unifying the logic between different
transport implementations. As transports call a `TcpTransport` callback
when a new channel is accepted, there is no need to internally track
channels accepted. Instead there is a set of accepted channels in
`TcpTransport`. This set is used for metrics and shutting down channels.
2017-12-08 16:56:53 -07:00
olcbean f50f99ef11 Improve error msg when a field name contains only white spaces (#27709)
* Explicitly check if a field name contains only
white spaces

* "white spaces" changed to "whitespace"
2017-12-08 13:46:56 -07:00
Jason Tedor b66a0721da
Do not open indices with broken settings
Today we are lenient and we open an index if it has broken
settings. This can happen if a user installs a plugin that registers an
index setting, creates an index with that setting, stop their node,
removes the plugin, and then restarts the node. In this case, the index
will have a setting that we do not recognize yet we open the index
anyway. This leniency is dangerous so this commit removes it. Note that
we still are lenient on upgrades and we should really reconsider this in
a follow-up.

Relates #26995
2017-12-08 14:33:05 -05:00
Jason Tedor cbba37c17d Set ACK timeout on indices service test
Setting a timeout here speeds the test up significantly since we do not
need to wait up the default of 30 seconds for shards to start, we only
need an ACK that the index was opened.
2017-12-08 14:02:53 -05:00
Tim Brooks d82c40d35c
Implement byte array reusage in `NioTransport` (#27696)
This is related to #27563. This commit modifies the
InboundChannelBuffer to support releasable byte pages. These byte
pages are provided by the PageCacheRecycler. The PageCacheRecycler
must be passed to the Transport with this change.
2017-12-08 10:39:30 -07:00
David Roberts d21167e0c2
[TEST] Remove leftover ES temp directories before Vagrant tests (#27722)
Some of the Vagrant tests were failing due to ES temp directories
left over from previous uses of the same VM confusing subsequent
tests into thinking there were multiple ES installs present.

This change wipes all ES temp directories when the test VMs are
brought up.
2017-12-08 17:37:05 +00:00
Jason Tedor 5c9415a4d3
Cleanup split strings by comma method
We have some methods Strings#splitStringByCommaToArray and
Strings#splitStringByCommaToSet. It is not obvious that the former
leaves whitespace and the latter trims it. We also have
Strings#tokenizeToStringArray which tokenizes a string to an array, and
trims whitespace. It seems the right thing to do here is to rename
Strings#splitStringByCommaToSet to Strings#tokenizeByCommaToSet so that
its name is aligned with another method that tokenizes by a delimiter
and trims whitespace. We also cleanup the code here, removing an
unneeded splitting by delimiter to set method.

Relates #27715
2017-12-08 12:17:12 -05:00
Jason Tedor 8b49b3f8af Remove unused import from AliasResolveRoutingIT
This commit removes an unused import from AliasResolveRoutingIT.java
that was left behind from development.
2017-12-08 11:50:24 -05:00
Tim Brooks ad8a571677
Add read timeouts to http module (#27713)
We currently do not have any server-side read timeouts implemented in
elasticsearch. This commit adds a read timeout setting that defaults to
30 seconds. If after 30 seconds a read has not occurred, the channel
will be closed. A timeout of value of 0 will disable the timeout.
2017-12-08 09:32:09 -07:00
Jason Tedor ec5e540174
Fix routing with leading or trailing whitespace
The problem here is that splitting was using a method that intentionally
trims whitespace (the method is really meant to be used for splitting
parameters where whitespace should be trimmed like list
settings). However, for routing values whitespace should not be trimmed
because we allow routing with leading and trailing spaces. This commit
switches the parsing of these routing values to a method that does not
trim whitespace.

Relates #27712
2017-12-08 11:23:24 -05:00
Boaz Leskes 64dd21af11 remove await fix from FullClusterRestartIT.testRecovery 2017-12-08 16:45:45 +01:00
David Roberts 9b9f85e509
Add missing 's' to tmpdir name (#27721)
When using mktemp from coreutils there was an 's' missing from
elasticsearch.

Follow-up for #27659
2017-12-08 14:29:06 +00:00
Christoph Büscher 3d3a1d2a0d Adding short description for experimental status in docs 2017-12-08 15:12:15 +01:00
Avneesh Chadha 58b4d6c5fc [Issue-27716]: CONTRIBUTING.md IntelliJ configurations settings are confusing. (#27717)
* Improved paragraph describing how to run unit tests from Intellij.
* Added information about how to run a local copy of elasticsearch from the source.
2017-12-08 14:31:45 +01:00
Simon Willnauer 8f104cc08c [TEST] Now actually wait for merges
Relates to #27651
2017-12-08 12:35:02 +01:00
Simon Willnauer 952c859f52 Test out of order delivery of append only index and retry with an intermediate delete 2017-12-08 12:28:27 +01:00
javanna 27e157f67c [TEST] remove code duplications in RequestTests 2017-12-08 10:51:27 +01:00
Christoph Büscher 816878bd4d
[Tests] Add test for GeoShapeFieldType#setStrategyName (#27703) 2017-12-08 10:11:57 +01:00
Nhat Nguyen 6efee323e0
Remove unused *Commit* classes (#27714)
These classes are not used anywhere.
2017-12-07 21:42:11 -05:00
Tim Brooks da5f52a2fc
Add test for writer operation buffer accounting (#27707)
This is a follow up to #27695. This commit adds a test checking that
across multiple writes using multiple buffers, a write operation
properly keeps track of which buffers still need to be written.
2017-12-07 12:48:49 -07:00
Lee Hinman cca54b811d [TEST] Wait for merging to complete before testing breaker
It's possible that a merge may be ongoing when we check the breaker and segment
stats' memory usage, this causes the test to fail. Instead, we should wait for
merging to complete.

Resolves #27651
2017-12-07 11:57:22 -07:00
olcbean bcc33f391f Add Open Index API to the high level REST client (#27574)
Add _open to the high level REST client

Relates to #27205
2017-12-07 18:16:03 +01:00
Christoph Büscher b83e14858a Correcting some minor typos in comments 2017-12-07 16:39:23 +01:00
Yannick Welsch 5a53798f83 Add unreleased v5.6.6 version 2017-12-07 14:59:57 +01:00
Christoph Büscher 52cb6c8ef2 Merge branch 'master' into rankeval 2017-12-07 14:22:46 +01:00
Robin Neatherway 057efea893 Correct two equality checks on incomparable types (#27688) 2017-12-07 14:18:11 +01:00
markwalkom ee21045697 [Docs] Add date math examples to api-conventions.asciidoc (#25217) 2017-12-07 14:10:51 +01:00
Yannick Welsch 69dd667f5e Add unreleased v6.0.2 version 2017-12-07 11:54:22 +01:00
Catalin Ursachi f823cea79c Added Create Index support to high-level REST client (#27351)
Relates to #27205
2017-12-07 11:39:59 +01:00
Yannick Welsch 0b102f6372 [TEST] Fix testOpenWaitingForActiveShardsFailed
This test periodically fails if the nodes that apply the cluster state fail to ack the change within 100ms. This commit changes the checks on the test so that
it still checks that the open command has taken effect, but that the wait for active shards has actually failed.
2017-12-07 10:23:36 +01:00
Tim Brooks 5b3230cbae
Fix issue where the incorrect buffers are written (#27695)
This is a followup to #27551. That commit introduced a bug where the
incorrect byte buffers would be returned when we attempted a write. This
commit fixes the logic.
2017-12-06 20:57:46 -07:00
Jason Tedor 6c7374804f
Extend JVM options to support multiple versions
JDK 9 has removed JVM options that were valid in JDK 8 (e.g., GC logging
flags) and replaced them with new flags that are not available in JDK
8. This means that a single JVM options file can no longer apply to JDK
8 and JDK 9, complicating development, complicating our packaging story,
and complicating operations. This commit extends the JVM options syntax
to specify the range of versions the option applies to. If the running
JVM matches the range of versions, the flag will be used to start the
JVM otherwise the flag will be ignored.

We implement this parser in Java for simplicity, and with this we start
our first step towards a Java launcher.

Relates #27675
2017-12-06 18:03:13 -05:00