Commit Graph

487 Commits

Author SHA1 Message Date
Julie Tibshirani d40116d260
Add support for field capabilities to the high-level REST client. (#29664) 2018-04-26 09:50:37 -07:00
Tanguy Leroux e864b93abf
Fix TermsSetQueryBuilder.doEquals() method (#29629)
Closes #29620
2018-04-26 17:47:16 +02:00
Nhat Nguyen 16490d7dfa
TEST: Update settings should go through cluster state (#29682)
Today we update index settings directly via IndexService instead of the
cluster state in IndexServiceTests. However, those changes will be lost
if there is a cluster state update. In general, we should update index
settings via client and limit the direct usage in only special tests.

This commit replaces direct usages by the updateSettings api of client.

Closes #24491
2018-04-26 09:28:14 -04:00
Jim Ferenczi 752ba2fb45 Adjust serialization versions after backport
Relates #29533
2018-04-26 14:06:56 +02:00
Jim Ferenczi 8b8c0c0b4d
Add additional shards routing info in ShardSearchRequest (#29533)
This commit propagates the preference and routing of the original SearchRequest in the ShardSearchRequest.
This information is then use to fix a bug in sliced scrolls when executed with a preference (or a routing).
Instead of computing the slice query from the total number of shards in the index, this commit computes this number from the number of shards per index that participates in the request.

Fixes #27550
2018-04-26 09:58:17 +02:00
Julie Tibshirani 32dfb65144 In the field capabilities API, deprecate support for providing fields in the request body. (#30157)
(cherry picked from commit d8d884b29d4aa7d01070484fee5de8d3db60cb25)
2018-04-25 23:01:53 -07:00
Nhat Nguyen 52c50e353b
Do not add noop from local translog to translog again (#29637)
Today we always add no-ops to translog regardless of its origin, thus a
noop may appear in the translog multiple times. This is not a big deal
as noops are small and rare to appear.

This commit ensures to add a noop to translog only if its origin is not
from local translog. This restriction has been applied for index and
delete.
2018-04-25 21:02:12 -04:00
Jason Tedor 2c3e71f116
Remove the suggest metric from stats APIs (#29635)
This metric previously existed for backwards compatibility reasons
although the suggest stats were folded into search stats. This metric
was deprecated in 6.3.0 and this commit removes them for 7.0.0.
2018-04-24 19:03:48 -04:00
Jason Tedor 25e45a765c
Fix byte size value equals/hash code test (#29643)
This commit fixes two issues with the byte size value equals/hash code
test.

The first problem is due to a test failure when the original instance is
zero bytes and we pick the mutation branch where we preserve the size
but change the unit. The mutation should result in a different byte size
value but changing the unit on zero bytes still leaves us with zero
bytes.

During the course of fixing this test I discovered another problem. When
we need to randomize size, we could randomly select a size that would
lead to an overflow of Long.MAX_VALUE.

This commit fixes both of these issues.
2018-04-24 19:01:27 -04:00
Jason Tedor bdf241347d
Add 6.4.0 version to master (#29684)
This commit adds the 6.4.0 version constant to the master branch.
2018-04-24 18:21:37 -04:00
Jason Tedor 3cadd5c40c Only enable modules to have native controllers
This commit removes the ability for a plugin to have a native controller
as leaves it as only modules can have a native controller.
2018-04-20 15:34:02 -07:00
Jason Tedor d99d0fa669 Add distribution type to startup scripts
This commit adds the distribution type to the startup scripts so that we
can discern from log output and the main response the type of the
distribution (deb/rpm/tar/zip).
2018-04-20 15:34:01 -07:00
Jason Tedor e64e6d8996 Add distribution flavor to startup scripts
This commit adds the distribution flavor (default versus oss) to the
build process which is passed through the startup scripts to
Elasticsearch. This change will be used to customize the message on
attempting to install/remove x-pack based on the distribution flavor.
2018-04-20 15:33:58 -07:00
Ryan Ernst fab5e21e7d Build: Split distributions into oss and default
This commit makes x-pack a module and adds it to the default
distrubtion. It also creates distributions for zip, tar, deb and rpm
which contain only oss code.
2018-04-20 15:33:57 -07:00
Yannick Welsch 6a4c5f3e93
Abort early on finding duplicate snapshot name in internal structures (#29634)
Adds a check in BlobstoreRepository.snapshot(...) that prevents duplicate snapshot names and fails 
the snapshot before writing out the new index file. This ensures that you cannot end up in this
situation where the index file has duplicate names and cannot be read anymore .

Relates to #28906
2018-04-20 17:32:34 +02:00
Jason Tedor 0045111ce2 Deprecate the suggest metrics (#29627)
The suggest stats were folded into the search stats as part of the
indices stats API in 5.0.0. However, the suggest metric remained as a
synonym for the search metric for BWC reasons. This commit deprecates
usage of the suggest metric on the indices stats API.

Similarly, due to the changes to fold the suggest stats into the search
stats, requesting the suggest index metric on the indices metric on the
nodes stats API has produced an empty object as the response since
5.0.0. This commit deprecates this index metric on the indices metric on
the nodes stats API.
2018-04-20 09:47:38 -04:00
Jay Modi dfc7ca7214
Implement Iterator#remove for Cache values iter (#29633)
This commit implements the ability to remove values from a Cache using
the values iterator. This brings the values iterator in line with the
keys iterator and adds support for removing items in the cache that are
not easily found by the key used for the cache.
2018-04-20 07:21:08 -06:00
Nhat Nguyen 42d81a2945 TEST: Unmute testPrimaryRelocationWhileIndexing
Previously we did not put an indexing to a version map if that map does
not require safe access but removed the existing delete tombstone only
if assertion enabled. In #29585, we removed the side-effect caused by
assertion then this test started failing. This failure can be explained
as follows:

- Step 1: Index a doc then delete that doc

- Step 2: The version map can switch to unsafe mode because of
  concurrent refreshes (implicitly called by flushes)

- Step 3: Index a document - the version map won't add this version
  value and won't prune the tombstone (previously it did)

- Step 4: Delete a document - this will return NOT_FOUND instead of
  DELETED because of the stale delete tombstone

This failure is actually fixed by #29619 in which we never leave stale
delete tombstones

Closes #29626
2018-04-19 21:35:21 -04:00
Ryan Ernst 7975280383
Remove remaining tribe node references (#29574)
While tribe node was removed in
https://github.com/elastic/elasticsearch/pull/28443, there remained a
couple lingering references to it in docs and code. This commit removes
those remaining references.
2018-04-19 18:02:01 -07:00
Nhat Nguyen 9cf8b01fc4
Never leave stale delete tombstones in version map (#29619)
Today the VersionMap does not clean up a stale delete tombstone if it
does not require safe access. However, in a very rare situation due to
concurrent refreshes, the safe-access flag may be flipped over then an
engine accidentally consult that stale delete tombstone.

This commit ensures to never leave stale delete tombstones in a version
map by always pruning delete tombstones when putting a new index entry
regardless of the value of the safe-access flag.
2018-04-19 20:49:56 -04:00
Jason Tedor d1670a18e4
Do not serialize common stats flags using ordinal (#29600)
This commit remove serializing of common stats flags via its enum
ordinal and uses an explicit index defined on the enum. This is to
enable us to remove an unused flag (Suggest) without ruining the
ordering and thus breaking serialization.
2018-04-19 20:12:24 -04:00
Jason Tedor a829d920ee
Remove stale comment from JVM stats (#29625)
We removed catched throwable from the code base and left behind was a
comment about catching InternalError in MemoryManagementMXBean. We are
not going to catch InternalError here as we expect that to be
fatal. This commit removes that stale comment.
2018-04-19 19:56:03 -04:00
Nhat Nguyen 293f85cd52 TEST: Mute testPrimaryRelocationWhileIndexing
AwaitsFix #29626
2018-04-19 19:15:30 -04:00
Jason Tedor 5d767e449a
Remove bulk fallback for write thread pool (#29609)
The name of the bulk thread pool was renamed to "write" with "bulk" as a
fallback name. This change was made in 6.x for BWC reasons yet in 7.0.0
we are removing this fallback. This commit removes this fallback for the
write thread pool.
2018-04-19 16:59:58 -04:00
Julie Tibshirani 113d1d3eab Fix an incorrect reference to 'zero_terms_docs' in match_phrase queries. 2018-04-19 13:24:14 -07:00
Julie Tibshirani 48461ac143 Update the version compatibility for zero_terms_query in match_phrase.
The change was just backported to 6.x.
2018-04-19 13:20:44 -07:00
Nhat Nguyen 955709b3f3 Account translog location to ram usage in version map
This commit accounts a translog location's ram usage in version map.
2018-04-19 16:05:33 -04:00
Julie Tibshirani b9e1a00213
Add support to match_phrase query for zero_terms_query. (#29598) 2018-04-19 11:25:27 -07:00
Julie Tibshirani 00d88a5d3e
Fix incorrect references to 'zero_terms_docs' in query parsing error messages. (#29599) 2018-04-19 11:02:49 -07:00
Nhat Nguyen 1b24d4e68b
Avoid side-effect in VersionMap when assertion enabled (#29585)
Today when a version map does not require safe access, we will skip that
document. However, if the assertion is enabled, we remove the delete
tombstone of that document if existed. This side-effect may accidentally
hide bugs in which stale delete tombstone can be accessed.

This change ensures putAssertionMap not modify the tombstone maps.
2018-04-19 12:38:10 -04:00
Christoph Büscher 24763d881e
Deprecate use of `htmlStrip` as name for HtmlStripCharFilter (#27429)
The camel case name `htmlStip` should be removed in favour of `html_strip`, but
we need to deprecate it first. This change adds deprecation warnings for indices 
with version starting with 6.3.0 and logs deprecation warnings in this cases.
2018-04-19 16:48:17 +02:00
Jason Tedor c12c2a6cc9 Rename the bulk thread pool to write thread pool (#29593)
This commit renames the bulk thread pool to the write thread pool. This
is to better reflect the fact that the underlying thread pool is used to
execute any document write request (single-document index/delete/update
requests, and bulk requests).

With this change, we add support for fallback settings
thread_pool.bulk.* which will be supported until 7.0.0.

We also add a system property so that the display name of the thread
pool remains as "bulk" if needed to avoid breaking users.
2018-04-19 08:18:58 -04:00
Tanguy Leroux e2d770d9b9
Fix missing node id prefix in startup logs (#29534)
When `node.name` is not set, some log traces at startup time does not
show the node id.
2018-04-19 09:40:25 +02:00
Ryan Ernst 98d776edaf
Networking: Deprecate http.enabled setting (#29591)
This commit deprecates the http.enabled, in preparation for removing the
feature in 7.0.

relates #12792
2018-04-18 17:36:09 -07:00
Jason Tedor 2b47d67d95
Remove the index thread pool (#29556)
Now that single-document indexing requests are executed on the bulk
thread pool the index thread pool is no longer needed. This commit
removes this thread pool from Elasticsearch.
2018-04-18 09:18:08 -04:00
Jim Ferenczi 9d11c7a6c1 Remove extra copy in ScriptDocValues.Strings
This commit removes a BytesRef copy introduced in #29567 and not
required.

Relates #29567
2018-04-18 15:13:24 +02:00
Jim Ferenczi a7c9857976
Fix binary doc values fetching in _search (#29567)
Binary doc values are retrieved during the DocValueFetchSubPhase through an instance of ScriptDocValues.
Since 6.0 ScriptDocValues instances are not allowed to reuse the object that they return (https://github.com/elastic/elasticsearch/issues/26775) but BinaryScriptDocValues doesn't follow this restriction and reuses instances of BytesRefBuilder among different documents.
This results in `field` values assigned to the wrong document in the response.
This commit fixes this issue by recreating the BytesRef for each value that needs to be returned.

 Fixes #29565
2018-04-18 13:01:06 +02:00
Jim Ferenczi 8b34066d8b Mutes failing MovAvgIT tests
Relates #29456
2018-04-18 10:54:45 +02:00
Julie Tibshirani 52858ba760
Fix the version ID for v5.6.10. (#29570) 2018-04-17 16:04:16 -07:00
Dimitris Athanasiou 7969eb7db7 Add versions 5.6.10 and 6.2.5 2018-04-17 18:47:20 +01:00
Zachary Tong cfc9d12acc [TEST] test against scaled value instead of fixed epsilon in MovAvgIT
When comparing doubles, fixed epsilons can fail because the absolute
difference in values may be quite large, even though the relative
difference is tiny (e.g. with two very large numbers).

Instead, we can scale epsilon by the absolute value of the expected
value.  This means we are looking for a diff that is epsilon-percent
away from the value, rather than just epsilon.

This is basically checking the relative error using junit's assertEqual.

Closes #29456, unmutes the test
2018-04-17 17:33:18 +00:00
Luca Cavanna 9c8ebb608f
Remove `flatSettings` support from request classes (#29560)
As part of adding support for new API to the high-level REST client,
we added support for the `flat_settings` parameter to some of our
request classes. We added documentation that such flag is only ever
read by the high-level REST client, but the truth is that it doesn't
do anything given that settings are always parsed back into a `Settings`
object, no matter whether they are returned in a flat format or not.

It was a mistake to add support for this flag in the context of the
high-level REST client, hence this commit removes it.
2018-04-17 18:18:21 +02:00
Adrien Grand d7be9185c8
MapperService to wrap a single DocumentMapper. (#29511)
This refactors MapperService so that it wraps a single `DocumentMapper` rather
than a `Map<String, DocumentMapper>`. We will need follow-ups since I haven't
fixed most APIs that still expose collections of types of mappers, but this is
a start...
2018-04-17 17:11:27 +02:00
Igor Motov 983d6c15a2
Add null_value support to geo_point type (#29451)
Adds support for null_value attribute to the geo_point types.

Closes #12998
2018-04-17 10:19:54 -04:00
Nhat Nguyen 45c6c20467
Enforce translog access via engine (#29542)
Today the translog of an engine is exposed and can be accessed directly.
While this exposure offers much flexibility, it also causes these troubles:

- Inconsistent behavior between translog method and engine method.
For example, rolling a translog generation via an engine also trims
unreferenced files, but translog's method does not.

- An engine does not get notified when critical errors happen in translog
as the access is direct.

This change isolates translog of an engine and enforces all accesses to
translog via the engine.
2018-04-17 08:03:41 -04:00
Jason Tedor 1dd0fd4874
Deprecate the index thread pool (#29540)
The index thread pool is no longer needed as its primary use-case for
single-document indexing requests has been relieved now that
single-document indexing requests are converted to bulk indexing
requests (with a single document payload).
2018-04-17 06:47:30 -04:00
Jason Tedor faa7fe86c5
Introduce analyze thread pool (#29541)
We want to remove the index thread pool as it is no longer needed since
single-document indexing requests are executed as bulk requests
now. Analyze requests are also executed on the index thread pool though
and they need a thread pool to execute on. The bulk thread does not seem
like the right thread pool, let us keep that thread pool conceptually
for bulk requests and free for bulk requests. None of the existing
thread pools make sense for analyze requests either. The generic thread
pool would be a terrible choice since it has an unbounded queue and that
is a bad idea for user-facing APIs. This commit introduces a small by
default (size=1, queue_size=16) thread pool for analyze requests.
2018-04-17 06:46:15 -04:00
Adrien Grand d223bcf7ab
Add the `include_type_name` option to the search and document APIs. (#29506)
This commit add the `include_type_name` option to the `index`, `update`,
`delete`, `get`, `bulk` and `search` APIs. When set to `false`, the response
will omit the `_type` in the response. This option doesn't work if the endpoint
contains a type. For instance, the following call would succeed:

```
GET index/_doc/1?include_type_name=false
```

But the following one would fail:

```
GET index/some_type/1?include_type_name=false
```

Relates #15613
2018-04-17 11:29:08 +02:00
Nhat Nguyen fd161d2659 TEST: Mute testEnsureWeReconnect
Relates #29547
2018-04-16 18:31:34 -04:00
olcbean b3e3b80f1b REST high-level client: add support for Indices Update Settings API [take 2] (#29327)
Relates to #27205
2018-04-16 21:39:11 +02:00