Commit Graph

2212 Commits

Author SHA1 Message Date
Yannick Welsch 3a929c7aea Increase assertBusy timeouts for RefreshListenersTests 2019-01-11 10:15:39 +01:00
Alpar Torok 82ca2d62de Mute CloseWhileRelocatingShardsIT.testCloseWhileRelocatingShards
Tracked by #37274
2019-01-11 10:54:53 +02:00
Alpar Torok 3e73911cbe Mute PrimaryAllocationIT.testForceStaleReplicaToBePromotedToPrimaryOnWrongNode
Tracking issue: #37345
2019-01-11 10:49:25 +02:00
Ignacio Vera 0a50821bb2
Geo: Do not normalize the longitude with value -180 for Lucene shapes (#37299)
Lucene based shapes should not normalize the longitude value -180 to 180.
2019-01-11 09:37:18 +01:00
Nhat Nguyen 360c430ad7
Add runAfter and notifyOnce wrapper to ActionListener (#37331)
Relates #37291
2019-01-11 03:33:06 -05:00
Alexander Reelsen 9f3da013d8
Date/Time parsing: Use java time API instead of exception handling (#37222)
* Add benchmark

* Use java time API instead of exception handling

when several formatters are used, the existing way of parsing those is
to throw an exception catch it, and try the next one. This is is
considerably slower than the approach taken in joda time, so that
indexing is reduced when a date format like `x||y` is used and y is the
date format being used.

This commit now uses the java API to parse the date by appending the
date time formatters to each other and does not rely on exception
handling.

* fix benchmark

* fix tests by changing formatter, also expose printer

* restore optional printing logic to fix tests

* fix tests

* incorporate review comments
2019-01-11 09:25:05 +01:00
Jason Tedor 822626dadf
Make consistent empty retention lease supplier
This commit makes the use of empty retention lease suppliers to always
be an empty list as opposed to in some cases an empty set. This commit
is solely for consistency reasons, there is no functional change here.
2019-01-10 18:34:55 -08:00
Jason Tedor edc95c8a8e
Add validation for retention lease construction (#37312)
This commit adds some simple validation that the values input to the
retention lease constructor our valid values. We will later rely on
these values being within the validated range.
2019-01-10 18:13:05 -08:00
Jack Conradson b5b93a2746
Rename ParameterMap to DeprecationMap (#37317)
Mechanical change to rename ParameterMap to DeprecationMap as this 
seems more appropriate for an extended Map to issue deprecation warnings.
2019-01-10 13:58:00 -08:00
markharwood 434430506b
Type removal - added deprecation warnings to _bulk apis (#36549)
Added warnings checks to existing tests
Added “defaultTypeIfNull” to DocWriteRequest interface so that Bulk requests can override a null choice of document type with any global custom choice.
Related to #35190
2019-01-10 21:35:19 +00:00
Julie Tibshirani a433c4012c
Support include_type_name in the field mapping and index template APIs. (#37210)
* Add include_type_name to the get field mappings API.
* Make sure the API specification lists include_type_name as a boolean.
* Add include_type_name to the get index templates API.
* Add include_type_name to the put index templates API.
2019-01-10 09:24:08 -08:00
Ryan Ernst fcf7df3eda
Core: Handle security manager permission for deprecation log rolling (#37281)
When the deprecation log is written to within scripting support code
like ScriptDocValues, it runs under the reduces privileges of scripts.
Sometimes this can trigger log rolling, which then causes uncaught
security errors, as was handled in #28485. While doing individual
deprecation handling within each deprecation scripting location is
possible, there are a growing number of deprecations in scripts.

This commit wraps the logging call within the deprecation logger use a
doPrivileged block, just was we would within individual logging call
sites for scripting utilities.
2019-01-10 07:44:40 -08:00
Armin Braun 46237faa97
Fail Stale Primary Alloc. Req. without Data (#37226)
* Get indices shard store status before enqueuing the reallocation state update task to prevent
tasks that would fail because a node does not hold a stale copy of the shard on a best effort basis
* Closes #37098
2019-01-10 16:28:38 +01:00
Przemyslaw Gomulka c812e6aea6
Fix line length in org.elasticsearch.routing (#37253)
Remove the line length suppression for this package and fix offending
lines

relates: #34884
2019-01-10 15:23:34 +01:00
Armin Braun 26cb7466ef
SNAPSHOT+TESTS: Stabilize SnapshotDisruptionIT (#37289)
* Ensure retry by busy assert on SnapshotMissingException
* Closes #36739
2019-01-10 14:13:20 +01:00
Luca Cavanna 61b54196c4 [TEST] Fixed compile issue in SnapshotsServiceTests
Relates to #37203
2019-01-10 13:38:39 +01:00
Alexander Reelsen 71287b0759
Remove unused EpochMillisDateFormatter (#37293)
This class has been superceded by a custom java time epoch millis date
parser.
2019-01-10 13:20:24 +01:00
Yannick Welsch d499233068
Zen2: Add join validation (#37203)
Adds join validation to Zen2, which prevents a node from joining a cluster when the node does not
have the right ES version or does not satisfy any other of the join validation constraints.
2019-01-10 12:57:50 +01:00
Christoph Büscher cd608848e7
Remove deprecated QUERY_AND_FETCH SearchType (#37257)
This SearchType was deprecated since at least 6.0 and according to the
documentation is only kept around for pre-5.3 requests. Removing and leaving a
comment as placeholder so we don't reuse the byte value associated with it
without further consideration.
2019-01-10 12:50:07 +01:00
Alexander Reelsen eb12de550a
Java Time: Fix timezone parsing (#37262)
* Java Time: Fix timezone parsing

An independent test uncovered an issue when parsing a timezone
containing a colon like `01:00` - some formats did not properly support
this.

This commit adds test for all formats in the dueling tests and fixes a
few issues with existing date formatters.

* fix tests, so they run under java8
2019-01-10 09:26:01 +01:00
Alexander Reelsen b2e8437424
Tests: Add ElasticsearchAssertions.awaitLatch method (#36777)
* Tests: Add ElasticsearchAssertions.awaitLatch method

Some tests are using assertTrue(latch.await(...)) in their code. This
leads to an assertion error without any error message. This adds a
method which has a nicer error message and can be used in tests.

* fix forbidden apis

* fix spaces
2019-01-10 09:25:36 +01:00
Michael Basnight d625b79df2
Add getZone to JodaCompatibleZonedDateTime (#37084)
The ZonedDateTime#getZone() was not accessible via the Joda shim. This
commit adds getZone() and exposes it through painless.
2019-01-09 22:09:34 -06:00
Jim Ferenczi 586093ec5e Handle TopFieldDocs copy in TopDocsCollectorContext
This commit fixes the clone of TopFieldDocs.

Relates #37179
Relates #37266
2019-01-10 00:26:55 +01:00
Simon Willnauer 234059d2c0
Enable Bulk-Merge if all source remains (#37269)
Today we still wrap recovery source readers on merge even if we
keep all documents recovery source. This basically disables bulk
merging for stored fields. This change skips wrapping if all docs
sources are kept anyway.
2019-01-09 23:46:31 +01:00
Jim Ferenczi 95479f1766 Ensure that a non static top docs is created during the search phase
This change fixes an unreleased bug that trips an assertion because a static instance
shared among threads is modified during the search. This commit copies the static
instance in order to ensure that each thread can modify the value without modifying
the other instances.

Closes #37179
Closes #37266
2019-01-09 22:57:34 +01:00
Jake Landis 195873002b
ingest: compile mustache template only if field includes '{{'' (#37207)
* ingest: compile mustache template only if field includes '{{''

Prior to this change, any field in an ingest node processor that supports
script templates would be compiled as mustache template regardless if they
contain a template or not. Compiling normal text as mustache templates is
harmless. However, each compilation counts against the script compilation
circuit breaker. A large number of processors without any templates or scripts
could un-intuitively trip the too many script compilations circuit breaker.

This change simple checks for '{{' in the text before it attempts to compile.

fixes #37120
2019-01-09 14:47:47 -06:00
Jack Conradson 95eef77ad4
[Style] Fix line length violations for threadpool, indexing, and script packages (#37205) 2019-01-09 10:55:52 -08:00
Evangelos Chatzikalymnios 85a603ee61 Use List instead of priority queue for stable sorting in bucket sort aggregator (#36748)
Update BucketSortPipelineAggregator to use a List and Collections.sort() for sorting instead of a priority queue. This preserves the order for equal values. Closes #36322.
2019-01-09 18:01:39 +02:00
Armin Braun eacc63b032
TESTS: Real Coordinator in SnapshotServiceTests (#37162)
* TESTS: Real Coordinator in SnapshotServiceTests

* Introduce real coordinator in SnapshotServiceTests to be able to test network disruptions realistically
  * Make adjustments to cluster applier service so that we can pass a mocked single threaded executor for tests
2019-01-09 16:53:49 +01:00
Alpar Torok ae086ebcc4 Muting SnapshotDisruptionIT
Tracked in #36779
2019-01-09 16:55:11 +02:00
Christoph Büscher c149bb8cc2
Support 'include_type_name' in RestGetIndicesAction (#37149)
This change adds support for the 'include_type_name' parameter for the
indices.get API. This parameter, which defaults to `false` starting in 7.0,
changes the response to not include the indices type names any longer.

If the parameter is set in the request, we additionally emit a deprecation
warning since using the parameter should be only temporarily necessary while
adapting to the new response format and we will remove it with the next major
version.
2019-01-09 14:17:17 +01:00
Jim Ferenczi 84d520b0e5 Throw an ISE rather than an hard assertion in SearchPhaseController#getTotalHits
This change turns an assertion into an IllegalStateException in SearchPhaseController#getTotalHits.
The goal is to help identify the cause of the failures in https://github.com/elastic/elasticsearch/issues/37179
which seems to fail only in CI.
The assertion will be restored when the issue is solved (NORELEASE).
2019-01-09 13:36:48 +01:00
Tanguy Leroux dc371ef593 [Tests] Fix ReopenWhileClosingIT with correct min num shards
The test intercepts TransportVerifyShardBeforeCloseAction shard
requests, so it needs a minimum of 2 primary shards on 2 different
 nodes to correctly intercepts requests.
2019-01-09 13:34:38 +01:00
Alpar Torok 7ff846ffb2 mute failing test: org.elasticsearch.index.shard.RefreshListenersTests.testConcurrentRefresh 2019-01-09 13:43:21 +02:00
Tanguy Leroux 096a83183e Merge branch 'master' into close-index-api-refactoring 2019-01-09 10:52:46 +01:00
Armin Braun 224475e6aa
MINOR: Some Cleanups in Snapshots (#37175)
* Removed pre v6 Bwc logic + comments
* Removed some dead code
2019-01-09 09:45:37 +01:00
Yannick Welsch 9040a96daf
Zen2: Add test that checks that CoordinatorTests are reproducible (#37225)
Ensures reproducibility of the tests in CoordinatorTests.
2019-01-09 09:32:24 +01:00
Tanguy Leroux 7f6fe14b66 Merge branch 'master' into close-index-api-refactoring 2019-01-09 09:26:05 +01:00
Tanguy Leroux 0a40564068
[Tests] Change cluster scope in CorruptedFileIT and FlushIT (#37229)
These tests failed on CI multiple times in the past weeks because they use a 
test cluster with a SUITE scope that recreates nodes between tests. With such 
a scope, nodes can be recreated in between test executions and can inherit a 
node id from a previous test execution, while they are assigned a random data 
path. With the successive node recreations it is possible that a newly recreated 
node shares the same node id (but different data path) as a non recreated node.

This commit changes the cluster scope of the CorruptedFileIT and FlushIT 
tests which often fail.

The failure is reproducable with :

./gradlew :server:integTest -Dtests.seed=EF3A50C225CF377 
-Dtests.class=org.elasticsearch.index.store.CorruptedFileIT 
-Dtests.security.manager=true -Dtests.locale=th-TH-u-nu-thai-x-lvariant-TH -Dtests.timezone=America/Rio_Branco 
-Dcompiler.java=11 -Druntime.java=8
2019-01-09 09:24:56 +01:00
Jun Ohtani 38b698d455
[Analysis] Deprecate Standard Html Strip Analyzer in master (#26719)
* [Analysis] Deprecate Standard Html Strip Analyzer

Deprecate only Standard Html Strip Analyzer
If user create index with the analyzer since 7.0, es throws an exception.
If an index was created before 7.0, es issue deprecation log
We will remove it in 8.0

Related #4704
2019-01-09 12:42:00 +09:00
Mayya Sharipova ec32e66088 Deprecate reference to _type in lookup queries (#37016)
Relates to #35190
2019-01-08 18:46:41 -08:00
Nhat Nguyen 87ac3103f4
Do not mutate RecoveryResponse (#37204)
Today we create a global instance of RecoveryResponse then mutate it
when executing each recovery step. This is okay for the current
sequential recovery flow but  not suitable for an asynchronous recovery
which we are targeting. With this commit, we return the result of each
step separately, then construct a RecoveryResponse at the end.

Relates #37174
2019-01-08 16:12:18 -05:00
Ryan Ernst 86b71930f6
Remove more checkstyle suppressions (#36735)
This commit removes several more line length violations from checkstyle
suppression.

relates #34884
2019-01-08 11:04:54 -08:00
Jim Ferenczi 054c3bb04f
Fix topDocs.totalHits assignment on scroll queries (#37180)
This change fixes an unreleased bug that assigns the wrong totalHits to scroll
queries.

Closes #37179
2019-01-08 13:31:53 +01:00
Alpar Torok 6344e9a3ce
Testing conventions: add support for checking base classes (#36650) 2019-01-08 13:39:03 +02:00
Tanguy Leroux d70ebfd1d6 Merge branch 'master' into close-index-api-refactoring 2019-01-08 09:17:48 +01:00
Tim Brooks b0665963e8
Make remote ping and compress settings dynamic (#37200)
Traditionally remote clusters can be configured dynamically. However,
the compress and ping settings are not currently set to be configured
dynamically. This commit changes that.
2019-01-07 23:35:22 -07:00
Jason Tedor c8c596cead
Introduce retention lease expiration (#37195)
This commit implements a straightforward approach to retention lease
expiration. Namely, we inspect which leases are expired when obtaining
the current leases through the replication tracker. At that moment, we
clean the map that persists the retention leases in memory.
2019-01-07 22:03:52 -08:00
Julie Tibshirani c5aac4705d Revert "Stop automatically nesting mappings in index creation requests. (#36924)"
This reverts commit ac1c6940d2.
2019-01-07 17:56:40 -08:00
Ryan Ernst 55d3ca3aa8
Core: Rework epoch time parsing for java time (#36914)
This commit converts the epoch time parsing implementation which uses
the java time api to create DateTimeFormatters instead of DateFormatter
implementations. This will allow multi formats for java time to be
implemented in a single DateTimeFormatter in a future change.
2019-01-07 16:15:30 -08:00