Commit Graph

59292 Commits

Author SHA1 Message Date
James Rodewig 23cc658f00 [DOCS] Minor edits for better readability 2021-06-17 08:49:16 -04:00
Armin Braun 40b21d0b32
Fix Searchable Snapshot Test Range Size Overflow (#74113)
Page alignment of the setting value can push it past the maximum since we round up.

Closes #74016
2021-06-17 14:42:34 +02:00
James Rodewig e111c39da0 [DOCS] Remove unneeded on-page TOC 2021-06-17 08:40:56 -04:00
Dan Hermann 4e164c77ea
[DOCS] Expose URI parts processor in Painless (#73896) 2021-06-17 07:29:58 -05:00
Przemyslaw Gomulka fdc301f045
[Rest Api Compatibility] Typed indexing stats (#74181)
the per type indexing stats is simplified and when _types is requested
it will return total stats for the index repeated under types/_doc/

the removal #47203

relates main meta issue #51816
relates types removal issue #54160
2021-06-17 14:21:21 +02:00
Yang Wang 2350369782
Service Accounts - HLRC (#72431)
This PR adds corresponding components in High Level Rest Client for the new
APIs related to the service accounts feature.
2021-06-17 21:27:20 +10:00
Alan Woodward 86500ae668
Add explicit tests for dynamic template validation on bad mapping parameters (#74177)
When a dynamic template is applied to a 7.x index, we do some validation checks
against the generated mappings and issue a deprecation warning if the validation
fails. We had some tests that were checking this at a low level, but nothing that
exercised the full logic.

When dynamic runtimes were added, we expected this behaviour to carry over;
however, a bug in building the ParserContext to pass to the runtime Builder meant
that we would instead always throw an error. In fact, erroring here is a good result,
as the only reason we issue a deprecation warning for non-runtime fields is to
preserve backward compatibility; given that runtime fields are new, it has never
been possible to add a bad dynamic runtime template.

This commit adds specific tests for both situations. It ensures that the parser
context passed to a runtime builder will know that it is in a dynamic context,
but it also removes the version check and deprecation warning, as they were
never actually triggered and we can be stricter here.
2021-06-17 12:11:44 +01:00
Rene Groeschke c2e86258d8
Update wrapper to 7.1 (#73941)
- Fix new introduced deprecated usages
- Update to newer ospackage snapshot to include provided PR for fixing deprecated usage

This gradle release comes with improvements on incremental compilation which we should benefit from
2021-06-17 10:59:22 +02:00
Armin Braun c1e9590a69
Pagination and Sorting for Get Snapshots API (#73952)
Pagination and snapshots for get snapshots API, build on top of the current implementation to enable work that needs this API for testing. A follow-up will leverage the changes to make things more efficient via pagination.

Relates https://github.com/elastic/elasticsearch/pull/73570 which does part of the under-the-hood changes required to efficiently implement this API on the repository layer.
2021-06-17 09:00:11 +02:00
Adam Locke b1803e4514
[DOCS] Update central reporting image (#74195) 2021-06-16 17:29:30 -04:00
James Rodewig 5fc6d73aa5
[DOCS] SQL: Document `null` handing for string functions (#74201) 2021-06-16 14:21:08 -04:00
Armin Braun e8662e3cc0
Fix Snapshot Docs Listing Query Params in Body Incorrectly (#74196)
Both of these APIs don't parse request bodies, the parameters are all taken
from the query string. Also, included the master timeout param include
as it was missing here also.
2021-06-16 20:07:25 +02:00
James Rodewig c7d59f0a4d
[DOCS] EQL: Note EQL uses `fields` parameter (#74194) 2021-06-16 13:01:02 -04:00
Dan Hermann 74ea21622f
Mute failing MixedClusterClientYamlTestSuiteIT test {p0=indices.split/20_source_mapping/Split index ignores target template mapping} test (#74198) 2021-06-16 11:34:48 -05:00
Armin Braun dbab169d97
Cleanup Duplicate Constants in Snapshot XContent Params (#74114)
No need to have duplicate versions of these in `SnapshotInfo`.
2021-06-16 17:36:47 +02:00
François-Clément Brossard 0ea7cbd429
[DOC] Add watcher to the threadpool doc (#73935)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
Co-authored-by: Joe Gallo <joegallo@gmail.com>
2021-06-16 11:07:36 -04:00
Przemyslaw Gomulka 67b7fd43fb
[Rest Api Compatibility] Validate Query typed api (#74171)
Adds back typed endpoints for validate query api.
Previously removed in #46927

relates main meta issue #51816
relates types removal issue #54160
2021-06-16 15:59:22 +02:00
Nicole Albee e124824f22
Replace deprecated `script.cache.*` settings with `script.context.$constext.cache_*` in documentation. (#74144) 2021-06-16 09:49:58 -04:00
Rory Hunter 47029736cf
Pin Alpine Linux version in Docker builds (#74169)
Alpine Linux 3.14.0 is incompatible with older versions of Docker, so pin the
version that we use to 3.13. At some point in the future, it will
be possible to upgrade Alpine.

Also when compiling curl, if the configure step fails and a config.log
file exists, then dump it out before exiting to assist diagnosis.
2021-06-16 14:29:00 +01:00
David Turner 8055f680d5
Fix clone API settings docs bug (#74175)
In #74138 we noted that index settings aren't copied in a clone. In fact
that's not true, we copy everything except explicitly-excluded ones,
`number_of_replicas` and `auto_expand_replicas`. This fixes the mistake.

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
2021-06-16 13:54:29 +01:00
Benjamin Trent a5adc7df9c
[ML] refactor internal datafeed management (#74018)
This unifies the concept of object management between datafeeds and anomaly jobs.
2021-06-16 08:06:42 -04:00
Jim Ferenczi 484280a02e
Disable query cache for FunctionScoreQuery and ScriptScoreQuery (#74060)
This commit disables the query cache for the `FunctionScoreQuery` and the
`ScriptScoreQuery`. These queries are not meant to be cached. If the score
is not needed, we'll now cache the sub-query and filters independently since
we don't want to keep an unused script in the cache.

Closes #73925
2021-06-16 13:55:30 +02:00
David Turner 3660d863db
Fork the sending of file chunks during recovery (#74164)
Today if sending file chunks is CPU-bound (e.g. when using compression)
then we tend to concentrate all that work onto relatively few threads,
even if `indices.recovery.max_concurrent_file_chunks` is increased. With
this commit we fork the transmission of each chunk onto its own thread
so that the CPU-bound work can happen in parallel.
2021-06-16 11:58:13 +01:00
Alan Woodward a18b1cc498
RuntimeField.Builder should not extend FieldMapper.Builder (#73840)
RuntimeField.Builder currently extends FieldMapper.Builder so that it can
share some parsing code and re-use the Parameter infrastructure. However,
this also means that we have to have a number of no-op method implementations,
and in addition this will make it complicated to add a fields parameter within
multi-keyed object field types. This commit removes the class relationship
between these two classes.
2021-06-16 10:34:04 +01:00
David Turner a81fbb9b84
Run CheckIndex on metadata index before loading (#73239)
The metadata index is small and important and only read at startup.
Today we rely on Lucene to spot if any of its components is corrupt, but
Lucene does not necesssarily verify all checksums in order to catch a
corruption. With this commit we run `CheckIndex` on the metadata index
first, and fail on startup if a corruption is detected.

Closes #29358
2021-06-16 10:27:44 +01:00
Alan Woodward 7d665616da
Deprecate setting version on analyzers (#74073)
The version field on all lucene Analyzers is unused, and is being removed
in lucene 9. This commit deprecates setting a version on an analyzer in
index settings and removes the related calls to Analyzer.setVersion()

Relates to #74057
2021-06-16 09:40:41 +01:00
Przemysław Witek 4dbcc08a14
Add test with null transform id in stats request (#74130) 2021-06-16 10:29:06 +02:00
Rory Hunter a5d2251064
Order imports when reformatting (#74059)
Change the formatter config to sort / order imports, and reformat the
codebase. We already had a config file for Eclipse users, so Spotless now
uses that.

The "Eclipse Code Formatter" plugin ought to be able to use this file as
well for import ordering, but in my experiments the results were poor.
Instead, use IntelliJ's `.editorconfig` support to configure import
ordering.

I've also added a config file for the formatter plugin.

Other changes:
   * I've quietly enabled the `toggleOnOff` option for Spotless. It was
     already possible to disable formatting for sections using the markers
     for docs snippets, so enabling this option just accepts this reality
     and makes it possible via `formatter:off` and `formatter:on` without
     the restrictions around line length. It should still only be used as
     a very last resort and with good reason.
   * I've removed mention of the `paddedCell` option from the contributing
     guide, since I haven't had to use that option for a very long time. I
     moved the docs to the spotless config.
2021-06-16 09:22:22 +01:00
Martijn van Groningen 64d3f5f4e1
Move deprecation code from xpack core to deprecation module. (#74120)
This reduces the number of imports and all deprecation code is now in one place.
Also removed DeprecationChecksTests test case from x-pack core, because the same test already exists in the deprecation module.
2021-06-16 09:49:23 +02:00
David Turner 2d471ce69e
Treat writtenBy as an opaque string (#74125)
Today `StoreFileMetadata#writtenBy` is a `Version`, but sent over the
wire as a `String`. It's included in every file chunk sent during
recovery, but parsing it uses `String#replaceFirst` a few times, which
is nontrivial, representing >50% of the time it takes to deserialize a
`RecoveryFileChunkRequest`. Moreover the value isn't actually used for
anything so the parsing is wasted work.

With this commit we treat this field as an opaque string, avoiding the
unnecessary parsing effort. We don't remove it because it appears in
e.g. a snapshot repository, where it may be useful for debugging.
2021-06-16 07:19:23 +01:00
Yang Wang f6abccc0f2
Cache API key hashing results on creation time (#74106)
The API key hashing result is now cached on the creation time of an API key,
i.e. pre-warm the cache. Previously it is cached when the API key is
authenticated for the first time. Since it is reasonable to assume that an API
key will be used shortly after its creation, this change has following
advantages:

* It removes the need for expensive pbkdf2 hashing computation on
  authentication time and therefore reduces overall server load
* It makes the first authentication faster

We expect all keys to be used, that is, caching on creation time does not
change the total number of keys need to be cached. Hence this PR does not
introduce any extra logic to fine tune whether a key should be cached (for
example, only cache if the load factor is lower than certain threshold etc.).
2021-06-16 15:53:56 +10:00
Yang Wang 3b69426df9
[Test] Bump timeout from 100 to 200 ms for the 2nd auth. (#74119)
This test failure happens fairly rarely, roughly once per month,
including on PRs and 6.8 branch. It almost requires no change. Hence
this PR only bumps the timeout for just another 100 ms. It does not
increases the timeout by too much becausd that would otherwise hide
other real problems, e.g. 2nd auth taking too long is likely an issue
for the caching mechanism.
2021-06-16 14:39:39 +10:00
Dan Hermann 57846495e9
Expose URI parts processor in Painless (#73634) 2021-06-15 17:19:59 -05:00
Mark Vieira 2a5d9fffa6 Unset JAVA_TOOL_OPTIONS when running Windows packaging tests 2021-06-15 15:00:26 -07:00
James Rodewig 27a90d68b7
[DOCS] Add `multi-field` def to glossary (#74147) 2021-06-15 16:39:46 -04:00
James Rodewig 48a8405213
[DOCS] Clone index API doesn't apply index templates or settings (#74138)
Changes:
* Notes that Elasticsearch doesn't apply index templates to cloned indices.
* Notes the clone API doesn't copy index settings.
2021-06-15 16:38:36 -04:00
Mark Tozzi e6c5688c82
Fix bug when formatting epoch dates (#73955)
Date based aggregations accept a timezone, which gets applied to both the bucketing logic and the formatter. This is usually what you want, but in the case of date formats where a timezone doesn't make any sense, it can create problems. In particular, our formatting logic and our parsing logic were doing different things for epoch_second and epoch_millis formats with time zones. This led to a problem on composite where we'd return an after key for the last bucket that would parse to a time before the last bucket, so instead of correctly returning an empty response to indicate the end of the aggregation, we'd keep returning the same last page of data.
2021-06-15 12:20:43 -04:00
Benjamin Trent a27b9991ed
Fix mapping error to indicate values field (#74132)
The error message erroneously mentions the count field being out of order. It should instead mention the values field
2021-06-15 11:44:54 -04:00
James Rodewig 8a899419bc [DOCS] Change `multi field` to `multi-field` 2021-06-15 11:40:03 -04:00
Mark Tozzi a1d2df708b
Mute MlDistributedFailureIT failing test (#74133)
Mute MlDistributedFailureIT testClusterWithTwoMlNodes_RunsDatafeed_GivenOriginalNodeGoesDown
2021-06-15 10:53:17 -04:00
David Roberts 98943a28be
[ML] Remove one more BWC constant (#74126)
This was missed from #74107

Fixes #74122
2021-06-15 14:54:45 +01:00
James Rodewig c4741abf77
[DOCS] Note ESS must use custom bundles for custom GeoIP database files (#73978) (#74128)
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: Jennie Soria <predogma@users.noreply.github.com>
2021-06-15 09:46:49 -04:00
Adam Locke 5700903da1
[DOCS] Service account edits (#73732)
* Put all service accounts information on one page

* De-emphasize connection with built-in accounts + edits

* Iterate on the docs: tweak, correction and more details.

* fix test

* Edits and minor text changes

Co-authored-by: Yang Wang <yang.wang@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2021-06-15 09:11:46 -04:00
David Turner e4e4393f70
Recycle buffers used for file-based recovery (#74117)
Adds a missing `decRef()` that prevents buffer recycling during
recovery. Relates #65921 which introduced the extra retention.
2021-06-15 13:47:45 +01:00
James Rodewig 51ec860b48
[DOCS] Clarify criteria for restore completion (#74094)
A restore operation is complete when all attempts to recover primary shards have finished, even if unsuccessful.

Closes #70854
2021-06-15 08:30:51 -04:00
Luca Cavanna 0d659fe14c
Add a test for parsing doc with a flattened field (#74112) 2021-06-15 13:21:30 +02:00
Yang Wang 4880ceac90
Deprecate realm names with a leading underscore (#73366)
Deprecation warning is now issued if any realm is configured with a name
prefixed with an underscore. This applies to all realms regardless
whether they are enabled or not.

Relates: #73250
2021-06-15 21:02:45 +10:00
Dimitris Athanasiou 6bc0916bb7
[ML] Adjust BWC versions after backporting reset API (#74107)
Relates #73908
2021-06-15 10:53:04 +03:00
Dimitris Athanasiou 84a7310f34
Mute BWC tests (#74108)
BWC tests need to be muted before merging #74093.
Will be reenabled after merging #74107.
2021-06-15 10:05:00 +03:00
Yang Wang df365dd16e
ApiKeyAuthCache now expires after access instead of write (#73982)
API key authCache is set to expire after write (by default 24 hours).
ExpireAfterWrite is generally preferred over expireAfterAccess because it
guarantees stale entries get evicted eventually in edge cases, e.g. when the
cache misses a notification from the cluster.

However, things are a bit different for the authCache. There is an additional
roundtrip to the security index for fetching the API key document. If the
document does not exists (removed due to expiration) or is invalidated, the
authentication fails earlier on without even consulting the authCache. This
means the stale entries won't cause any security issues when they exist.
Therefore, this PR changes the authCache to be expire after access, which helps
preventing potential cyclic surge of expensive hash computations especially
when a large number of API keys are in use.

To further help the cache efficiency, this PR also actively invalidates the
authCache if the document is either not found or invalidated so it does not
have to wait for 24 hour to happen. Note that these are all edge cases and we
don't expect them to happen often (if at all).
2021-06-15 09:25:08 +10:00