Commit Graph

1337 Commits

Author SHA1 Message Date
Zachary Tong f4cbbcf98b
Add ES version 6.4.2 (#33831)
Version and properties files
2018-09-18 15:25:20 -04:00
Armin Braun c6462057a1
MINOR: Remove Some Dead Code in Scripting (#33800)
* The is default check method is not used in ScriptType
* The removed vars on ExpressionSearchScript are unused
2018-09-18 20:43:31 +02:00
Simon Willnauer 9026c3ee92
Ensure realtime `_get` and `_termvectors` don't run on the network thread (#33814)
The change in #27500 introduces this regression that causes `_get` and `_term_vector`
actions to run on the network thread if the realtime flag is set.
This fixes the issue by delegating to the super method forking on the corresponding threadpool.
2018-09-18 19:53:42 +02:00
Simon Willnauer 98ccd94962
Factor out a ChannelActionListener (#33819)
We use similar / same concepts in SerachTransportService and HandledTransportAction but both
duplicate the efforts with slightly different implementation details. This streamlines
sending responses / exceptions back to a channel in an ActionListener with appropriate logging.
2018-09-18 19:53:26 +02:00
Jim Ferenczi 241c74efb2
upgrade to a new snapshot of Lucene 8 (7d0a7782fa) (#33812) 2018-09-18 18:16:40 +02:00
David Turner 421f58e172
Remove discovery-file plugin (#33257)
In #33241 we moved the file-based discovery functionality to core
Elasticsearch, but preserved the `discovery-file` plugin, and support for the
existing location of the `unicast_hosts.txt` file, for BWC reasons. This commit
completes the removal of this plugin.
2018-09-18 12:01:16 +01:00
markharwood 2fa09f062e
New plugin - Annotated_text field type (#30364)
New plugin for annotated_text field type.
Largely a copy of `text` field type but adds ability to include markdown-like syntax in the text.
The “AnnotatedText” class parses text+markup and converts into plain text and AnnotationTokens.
The annotation token values are injected unchanged alongside the regular text tokens to provide a
form of additional indexed overlay useful in positional searches and highlighting.
Annotated_text fields do not support fielddata as we want to phase this out.
Also includes a new "annotated" highlighter type that retains annotations and merges in search
hits as additional annotation markup.

Closes #29467
2018-09-18 10:25:27 +01:00
Armin Braun 87cedef3cf
NETWORKING:Def CName in Http Publish Addr to True (#33631)
* Follow up to #32806 setting the setting to true for 7.x
2018-09-18 10:29:02 +02:00
Armin Braun 615f494c77
MINOR: Drop Redundant Ctx. Check in ScriptService (#33782)
* MINOR: Drop Redundant Ctx. Check in ScriptService

* This check is completely redundant, the expression script
engine will throw anyway (and with a similar message) for
those contexts that it cannot compile. Moreover, the update context
is not the only context that is not suported by the expression engine
at this point so handling the update context separately here makes
no sense.
2018-09-18 07:25:22 +02:00
Or Bin a5bad4d92c Docs: Fixed a grammatical mistake: 'a HTTP ...' -> 'an HTTP ...' (#33744)
Fixed a grammatical mistake: 'a HTTP ...' -> 'an HTTP ...'

Closes #33728
2018-09-17 15:35:54 -04:00
Vladimir Dolzhenko 4d0bea705c
Do not report negative free bytes for DiskThresholdDecider#canAllocate (#33641)
Do not report negative free bytes for DiskThresholdDecider#canAllocate (#33641)

Closes #33596
2018-09-17 17:56:47 +02:00
Armin Braun a654f21599
TESTS: Fix Concurent Remote Connection Updates (#33707)
* Same fix idea as in #10666a4 to prevent background
threads trying to reconnect after the tests are done from
throwing `ExecutionCancelledException` and breaking the test
* Closes #30714
2018-09-17 16:38:44 +02:00
Bukhtawar 14d57c1115 Skip rebalancing when cluster_concurrent_rebalance threshold reached (#33329)
Allows to skip shard balancing when the cluster_concurrent_rebalance threshold is already reached, which cuts down the time spent in the rebalance method of BalancedShardsAllocator.
2018-09-17 13:13:44 +02:00
Adrien Grand b06a082725 Improve reproducibility of BigArraysTests.
Close #33750
2018-09-17 11:59:15 +02:00
Christoph Büscher 1f2a90cb39 Mute DateTimeUnitTests.testConversion 2018-09-17 11:16:50 +02:00
Martijn van Groningen 34379887b4
Make custom index metadata completely immutable (#33735)
Currently `IndexMetadata#getCustomData(...)` wraps the custom metadata
in an unmodifiable map, but in case there is no entry for the specified
key then a NPE is thrown by Collections.unmodifiableMap(...). This is not
ideal in case callers like to throw an exception with a specific message.
(like in the case for ccr to indicate that the follow index was not created
by the create_and_follow api and therefor incompatible as follow index)

I think making `DiffableStringMap` itself immutable is better then just wrapping
custom metadata with `Collections.unmodifiableMap(...)` in all methods that access it.

Also removed the `equals()`, `hashcode()` and to `toString()` methods of
`DiffableStringMap`, because `AbstractMap` already implements these methods.
2018-09-17 07:51:34 +02:00
Ryan Ernst 3046656ab1
Scripting: Rework joda time backcompat (#33486)
This commit switches the joda time backcompat in scripting to use
augmentation over ZonedDateTime. The augmentation methods provide
compatibility with the missing methods between joda's DateTime and
java's ZonedDateTime. Due to getDayOfWeek returning an enum in the java
API, ZonedDateTime is wrapped so that the method can return int like the
joda time does. The java time api version is renamed to
getDayOfWeekEnum, which will be kept through 7.x for compatibility while
users switch back to getDayOfWeek once joda compatibility is removed.
2018-09-16 19:18:00 -07:00
Ryan Ernst e5d82c3dea
Test: Fix dv date bwc tests when no docs have a value (#32798)
This commit adds a guard around the rare case that no documents in the
10 iterations actually have any values, thus making the warning check
incorrect.

closes #32779
2018-09-16 11:11:51 -07:00
Jason Tedor a0f0d7860e
Cleanup assertions in global checkpoint listeners (#33722)
This commit is a cleanup of the assertions in global checkpoint
listeners, simplifying them and adding some messages to them in case the
assertions trip.
2018-09-14 14:45:58 -04:00
Christoph Büscher bcbbbdf660
[Tests] Fix randomization in StringTermsIT (#33678)
It looks like the COLLECT_SEGMENT_ORDS flag should be randomized.
2018-09-14 15:52:47 +02:00
Jason Tedor 39191331d1
Only notify ready global checkpoint listeners (#33690)
When we add a global checkpoint listener, it is also carries along with
it a value that it thinks is the current global checkpoint. This value
can be above the actual global checkpoint on a shard if the listener
knows the global checkpoint from another shard copy (e.g., the primary),
and the current shard copy is lagging behind. Today we notify the
listener whenever the global checkpoint advances, regardless if it goes
above the current global checkpoint known to the listener. This commit
reworks this implementation. Rather than thinking of the value
associated with the listener as the current global checkpoint known to
the listener, we think of it as the value that the listener is waiting
for the global checkpoint to advance to (inclusive). Now instead of
notifying all waiting listeners when the global checkpoint advances, we
only notify those that are waiting for a value not larger than the
actual global checkpoint that we advanced to.
2018-09-14 09:32:03 -04:00
Adrien Grand 4f68104865
Don't count hits via the collector if the hit count can be computed from index stats. (#33701)
This is something that we were already doing when sorting by field, which is
now also done when sorting by score. As-is this change will speed up top-k
`term` queries. This could work for `match_all` queries as well when we
implement the `setMinCompetitiveScore` API on their Scorer.
2018-09-14 14:59:16 +02:00
Alexander Reelsen faa3c16241
Core: Add DateFormatter interface for java time parsing (#33467)
The existing approach used date formatters when a format based string
like `date_time||epoch_millis` was used, instead of the custom code.

In order to properly solve this, a new interface called
`DateFormatter` has been added, which now can be implemented for custom
formatters. Currently there are two implementations, one using java time
and one doing the epoch_millis formatter, which simply parses a number
and then converts it to a date in UTC timezone.

The DateFormatter interface now also has a method to retrieve the name
of the formatter pattern, which is needed for mapping changes anyway.

The existing `CompoundDateTimeFormatter` class has been removed, the
name was not really nice anyway.

One more minor change is the fact, that the new java time using
FormatDateFormatter does not try to parse the date with its printer
implementation first (which might be a strict one and fail), but a
printer can now be specified in addition. This saves one potential
failure/exception when parsing less strict dates.

If only a printer is specified, the printer will also be used as a
parser.
2018-09-14 13:55:16 +02:00
Igor Motov b8fb83d7a4 Mute ClusterDisruptionIT#testSendingShardFailure
Tracked by #33704
2018-09-14 14:24:06 +04:00
Armin Braun 0b4960ff6b
SCRIPTING: Move terms_set Context to its Own Class (#33602)
* SCRIPTING: Move terms_set Context to its Own Class

* Extracted TermsSetQueryScript
* Kept mechanics close to what they were with SearchScript
2018-09-14 06:21:18 +02:00
Armin Braun 040695b64e
CORE: Disable Setting Type Validation (#33660) (#33669)
* Reverts setting type validation introduced in #33503
2018-09-13 20:45:48 +02:00
Jason Tedor e4eb631b8e
Revert "Use serializable exception in GCP listeners (#33657)"
This reverts commit 6dfe54c838.
2018-09-13 13:55:19 -04:00
Nhat Nguyen b3071133d4 TEST: decrease logging level in the flush test
Relates #31629
2018-09-13 11:18:03 -04:00
Jason Tedor d806a0e59d
Fix race in global checkpoint listeners test
This race can occur if the latch from the listener notifies the test
thread and the test thread races ahead before the scheduler thread has a
chance to emit the log message. This commit fixes this test by not
counting down the latch until after the log message we are going to
assert on has been emitted.
2018-09-13 07:00:40 -04:00
Jason Tedor 6dfe54c838
Use serializable exception in GCP listeners (#33657)
We used TimeoutException here but that's not serializable. This commit
switches to a serializable exception so that we can test for the
exception type on the remote side.
2018-09-13 06:35:36 -04:00
Jim Ferenczi 6ca36bba15
Fix field mapping updates with similarity (#33634)
This change fixes a bug introduced in 6.3 that prevents fields with an explicit
similarity to be updated. It also adds a test that checks this case for similarities
but also for analyzers since they could suffer from the same problem.

Closes #33611
2018-09-13 09:21:27 +02:00
David Turner 5a3fd8e4e7
Use file-based discovery not MockUncasedHostsProvider (#33554)
Today we use a special unicast hosts provider, the `MockUncasedHostsProvider`,
in many integration tests, to deal with the dynamic nature of the allocation of
ports to nodes. However #33241 allows us to use file-based discovery to achieve
the same goal, so the special test-only `MockUncasedHostsProvider` is no longer
required.

This change removes `MockUncasedHostProvider` and replaces it with file-based
discovery in tests based on `EsIntegTestCase`.
2018-09-13 07:37:15 +02:00
Nhat Nguyen b097eff342
Resync fails to notify on unavaiable exceptions (#33615)
We fail to notify the resync listener if the resync replication hits a
shard unavailable exception. Moreover, we no longer need to swallow
these unavailable exceptions.

Relates #28571
Closes #33613
2018-09-12 21:27:59 -04:00
Jason Tedor 9b8fe85edb
Remove volatile from global checkpoint listeners (#33636)
This field does not need to be volatile because all accesses are done
under a lock. This commit removes the unnecessary volatile modifier from
this field.
2018-09-12 14:38:24 -04:00
Jason Tedor c023f67c5d
Add migration note for remote cluster settings (#33632)
The remote cluster settings search.remote.* have been renamed to
cluster.remote.* and are automatically upgraded in the cluster state on
gateway recovery, and on put. This commit adds a note to the migration
docs for these changes.
2018-09-12 13:37:11 -04:00
Simon Willnauer c783488e97
Add `_source`-only snapshot repository (#32844)
This change adds a `_source` only snapshot repository that allows to wrap
any existing repository as a _backend_ to snapshot only the `_source` part
including live docs markers. Snapshots taken with the `source` repository
won't include any indices,  doc-values or points. The snapshot will be reduced in size and
functionality such that it requires full re-indexing after it's successfully restored.

The restore process will copy the `_source` data locally starts a special shard and engine
to allow `match_all` scrolls and searches. Any other query, or get call will fail with and unsupported operation exception.  The restored index is also marked as read-only.

This feature aims mainly for disaster recovery use-cases where snapshot size is
a concern or where time to restore is less of an issue.

**NOTE**: The snapshot produced by this repository is still a valid lucene index. This change doesn't allow for any longer retention policies which is out of scope for this change.
2018-09-12 17:47:10 +02:00
Jason Tedor 36ba3cda7e
Enable global checkpoint listeners to timeout (#33620)
In cross-cluster replication, we will use global checkpoint listeners to
long poll for updates to a shard. However, we do not want these polls to
wait indefinitely as it could be difficult to discern if the listener is
still waiting for updates versus something has gone horribly wrong and
cross-cluster replication is stuck. Instead, we want these listeners to
timeout after some period (for example, one minute) so that they are
notified and we can update status on the following side that
cross-cluster replication is still active. After this, we will
immediately enter back into a poll mode.

To do this, we need the ability to associate a timeout with a global
checkpoint listener. This commit adds this capability.
2018-09-12 10:53:22 -04:00
Nhat Nguyen d9bbb89b26 TEST: Adjust rollback condition when shard is empty
If a shard is empty, it won't rollback its engine on promotion.
This commit adjusts the expectation in the rollback test.

Relates #33473
2018-09-12 08:26:02 -04:00
lipsill c92ec1c5d7 Forbid negative `weight` in Function Score Query (#33390)
This change forbids negative `weight` in Function Score query. Negative scores are forbidden in Lucene 8.
2018-09-12 09:16:40 +02:00
Jim Ferenczi 4561c5ee83
Clarify context suggestions filtering and boosting (#33601)
This change clarifies the documentation of the context completion suggester
regarding filtering and boosting with contexts.
Unlike the suggester v1, filtering on multiple contexts
works as a disjunction, a suggestion matches if it contains at least one of the provided
context values and boosting selects the maximum score among the matching contexts.
This commit also adapts an old test that was written for the v1 suggester and commented out
for version 2 because the behavior changed.
2018-09-12 08:47:32 +02:00
Jason Tedor c74c46edc3
Upgrade remote cluster settings (#33537)
This commit adds settings upgraders for the search.remote.* settings
that can be in the cluster state to automatically upgrade these settings
to cluster.remote.*. Because of the infrastructure that we have here,
these settings can be upgraded when recovering the cluster state, but
also when a user tries to make a dynamic update for these settings.
2018-09-12 01:14:43 -04:00
Armin Braun 94cdf0ceba
NETWORKING: http.publish_host Should Contain CNAME (#32806)
* NETWORKING: http.publish_host Should Contain CNAME

* Closes #22029
2018-09-12 06:15:36 +02:00
Jason Tedor 9752540866
Add test coverage for global checkpoint listeners
This commit adds test coverage for two cases not previously covered by
the existing testing. Namely, we add coverage ensuring that the executor
is used to notify listeners being added that are immediately notified
because the shard is closed or because the global checkpoint is already
beyond what the listener knows.
2018-09-11 23:19:27 -04:00
Nhat Nguyen 743327efc2
Reset replica engine to global checkpoint on promotion (#33473)
When a replica starts following a newly promoted primary, it may have
some operations which don't exist on the new primary. Thus we need to
throw those operations to align a replica with the new primary. This can
be done by first resetting an engine from the safe commit, then replaying
the local translog up to the global checkpoint.

Relates #32867
2018-09-11 22:09:37 -04:00
Nhat Nguyen 1e577d3ce8 Mute testIndexDeletionWhenNodeRejoins
Tracked at #33613
2018-09-11 16:23:12 -04:00
Colin Goodheart-Smithe 624b84f897
Improves doc values format deprecation message (#33576)
* Improves doc values format deprecation message

This changes the deprecation message when doc values fields do not
supply a format form logging a deprecation warning for each offending
field individually to logging a single message which lists all
offending fields

Closes #33572

* Updates YAML test with new deprecation message

Also adds a test to ensure multiple deprecation warnings are collated
into one message

* Condenses collection of fields without format check

Moves the collection of fields that don't have a format to a separate
loop and moves the logging of the deprecation warning to be next to it
at the expesnse of looping through the field list twice

* fixes typo

* Fixes test
2018-09-11 14:32:43 +01:00
Alan Woodward 36bdad4895
Use IndexWriter.getFlushingBytes() rather than tracking it ourselves (#33582)
Currently we keep track of how many bytes are currently being written to disk
in an AtomicLong within InternalEngine, updating it on refresh. The IndexWriter
has its own accounting for this, and exposes it via a getFlushingBytes method
in the latest lucene 8 snapshot. This commit removes the InternalEngine tracking
in favour of just using the IndexWriter method.
2018-09-11 13:38:44 +01:00
Jason Tedor ad4b5e4270
Fix upgrading of list settings (#33589)
Upgrading list settings is broken because of the conversion that we do
to strings, and then when we try to put back the upgraded value we do
not know that it is a representation of a list. This commit addresses
this by adding special handling for list settings.
2018-09-11 08:35:42 -04:00
Simon Willnauer 517cfc3cc0
Add read-only Engine (#33563)
This change adds an engine implementation that opens a reader on an
existing index but doesn't permit any refreshes or modifications
to the index.

Relates to #32867
Relates to #32844
2018-09-11 14:05:14 +02:00
Armin Braun 6075e159e5 Validate list values for settings (#33503)
When we see a settings value, it could be a list. Yet this should only
happen if the underlying setting type is a list setting type. This
commit adds validation that when we get a setting value that is a list,
that the setting that we are getting is a list setting. And similarly,
if we get a value for a list setting, the underlying value should be a
list.
2018-09-10 19:24:17 -04:00