Commit Graph

55864 Commits

Author SHA1 Message Date
Tanguy Leroux 8d28c35947
Allow searchable snapshot cache service to periodically fsync cache files (#64696)
This committ changes the searchable snapshot's CacheService so that 
it now periodically fsync cache files using the method introduced in #64201.

The synchronization is executed every 10 seconds by default (this interval 
can be changed using a new xpack.searchable.snapshot.cache.sync.interval
setting).
2020-11-23 12:02:22 +01:00
Andrei Stefan acfb463892
Extend the interval date comparison (#65348) 2020-11-23 12:46:10 +02:00
Armin Braun 16c795e049
Fix SearchableSnapshotsIntegTests.testCreateAndRestoreSearchableSnapshot (#65343)
The recovery stats assertions in this test ran without any waiting for
the recoveries to actually finish. The fact that they ran after the concurrent
searches checks generally meant that they would pass (because of searches warming caches
+ general relative slowness of searches) but there is no hard guarantees this will work
reliably as the pre-fetch threads which will update the recovery state might still be slow
to do so randomly, causing the assertions to trip.

closes #65302
2020-11-23 10:35:09 +01:00
Armin Braun 606e8b17ed
Fix Broken Error Handling in CacheFile#acquire (#65342)
If we fail to create the `FileChannelReference` (e.g. because the directory it should be created in
was deleted in a test) we have to remove the listener from the `listeners` set to not trip internal
consistency assertions.

Relates #65302 (does not fix it though, but reduces noise from failures by removing secondary
tripped assertions after the test fails)
2020-11-23 08:10:21 +01:00
Julie Tibshirani 509f1d117d
Remove unnecessary method AbstractFieldScript#getSource. (#65294)
Previously it looked like `_source` was exposed as a top-level parameter in
runtime field scripts. The method is only used in tests and can be removed
altogether.
2020-11-22 19:51:45 -08:00
Armin Braun 0986ae9b27
Mute JdbcCsvSpecIT#testCurrentDateFilter (#65339)
Muting for https://github.com/elastic/elasticsearch/issues/65336
2020-11-22 22:34:05 +01:00
Julie Tibshirani f4a462d05e
Simplify how source is passed to fetch subphases. (#65292)
This PR simplifies how the document source is passed to each fetch subphase. A summary of the strategy:
* For each document, we try to eagerly load the source and store it on `HitContext`. Most subphases that access source, like source filtering and highlighting, use `HitContext`. For nested hits, we filter the parent source and also store this source on `HitContext`.
* Only for non-nested documents, we also store the loaded source on `QueryShardContext#lookup`. This allows subphases that access source through `SearchLookup` to use the pre-loaded source when possible. This is now a common occurrence, since runtime fields are supported in the 'fields' option and may soon be supported in highlighting.

There is no longer a special `SearchLookup` just for the fetch phase. This was not necessary and was mostly caused by a misunderstanding of how `QueryShardContext` should be used.

Addresses #62511.
2020-11-20 14:09:41 -08:00
Wylie Conlon 10ee0f2878
Clarify field data cache behavior in docs (#64375)
* Clarify that field data cache includes global ordinals
* Describe that the cache should be cleared once the limit is reached
* Clarify that the `_id` field does not supported aggregations anymore
* Fold the `fielddata` mapping parameter page into the `text field docs
* Improve cross-linking
2020-11-20 13:53:23 -08:00
Jack Conradson 04536fcf91
Fix casting bug in compound assignment for String (#65329)
This change fixes a bug where when doing compound assignment involving String concatenation, the 
right-hand side will fail to cast to String appropriately and throw a ClassCastException.
2020-11-20 12:04:28 -08:00
Ryan Ernst 4acbff932c
Remove unused EQL helpers (#65165)
These methods were leftover from previous refactorings, but they are no
longer necessary.
2020-11-20 10:59:05 -08:00
István Zoltán Szabó f1e54a63a1
[DOCS] Adds UI related limitation to configuring aggs docs (#65184)
Co-authored-by: Lisa Cawley <lcawley@elastic.co>
2020-11-20 19:03:18 +01:00
Ryan Ernst cfe6e68fde
Add codebases hints for testing (#65281)
This commit adds codebases files for the remaining plugin security
policies that use jar specific grants.
2020-11-20 10:01:51 -08:00
Rory Hunter 533f77b430
Rework Dockerfile instructions to save space (#65308)
In PR #64274, we make it possible to run our Docker images more easily
under a different group, but in so doing increased the Docker layer
sizes dramatically, effectively doubling the size of the images.

Fix this by reworking what commands get run and where, in order to bring
down the final size of the images.
2020-11-20 15:35:47 +00:00
Alan Woodward 7a9e118d1e
Encapsulate nested identity loading (#65054)
When handling nested documents in the Fetch phase, we currently find
a document's nested identity by loading ObjectMappers from a MapperService,
and iterating over their filters. This logic is difficult to follow, end requires
exposing internals of the mappers that we would rather hide away.

This commit refactors all NestedIdentity loading into a single NestedDocuments
object, with per-segment iterators to handle the individual documents. This way
of iterating over documents allows us to share parent filters, meaning that we
can avoid rebuilding the filter for every nested level of every visited document.
2020-11-20 15:31:38 +00:00
Dan Hermann ccf4b63b5b
URI parts ingest processor (#65150) 2020-11-20 08:43:51 -06:00
Howard e4ca0c13fb
[DOCS] Remove duplicated word in replica shard allocator comment (#65295) 2020-11-20 09:29:59 -05:00
Hendrik Muhs ed5498ed12
[Transform] add more debug logging in testUsage IT (#65296)
log the full usage response on failure (individual counts are logged already)

relates #52931
2020-11-20 15:06:39 +01:00
bellengao 2d9b83e32c
[DOCS] Fix formatting issue in search explain docs (#65303) 2020-11-20 09:01:01 -05:00
Benjamin Trent 73b72577b1
[ML] adding some better logging on inference model storage failure (#65239)
* [ML] adding some better logging on inference model storage failure
2020-11-20 08:41:56 -05:00
István Zoltán Szabó 1e045da339
[DOCS] Makes the screenshot larger on the custom URLs page. (#65269) 2020-11-20 09:29:39 +01:00
Rory Hunter 30abc09a68
Add retries to Docker build apk commands (#65194)
Most of the Elasticsearch Docker build process implements retries
in order to make the process more robust in the face of transient
errors e.g. network failures. However, we missed out the `apk`
command in `master`'s Dockerfile. This PR adds the same retry loop
around `apk` as features elsewhere in the `Dockerfile`.

As part of this, I implemented a helper closure that generates the
same loop construct throughout the `Dockerfile`.
2020-11-20 08:03:07 +00:00
Nhat Nguyen 01c83ceb5c
remote/info should fail on node without remote_client role (#65289)
If a _remote/info request is executed on a node without the 
remote_cluster_client role, then we will always respond with an empty
result. With this commit, we will fail in such a request instead to
avoid confusing CCS and CCR users.
2020-11-19 17:43:30 -05:00
Ryan Ernst 23a47cebf1
Add plugin permission validation (#64751)
Security manager policies within plugins currently can ask to grant any
permission (though we block some within the security manager itself at
runtime). Yet most of these permissions should never be necessary, and
some we would actively not want any plugins to be allowed to use. This
commit adds validation of plugins' policy files to restrict the
permissions allowed to be granted to a subset that is reasonable for
plugins to need. The allowed permissions are not ideal (still containing
things like suppressAccessChecks), but it is a step forward in defining
a stricter model for plugins that reduces the surface area of potential
abuse.
2020-11-19 14:21:34 -08:00
James Rodewig f83ed81cb3
[DOCS] Document `xpack.http.proxy.scheme` setting (#65264) 2020-11-19 15:31:24 -05:00
Luca Cavanna 3aef586220
Make document parsing aware of runtime fields (#65210)
Runtime fields are defined in a separate runtime section in the mappings. Since the runtime section was introduced, runtime fields are not taken into account when parsing documents. That means that if a document gets indexed that holds a field that's already defined as a runtime field, the field gets dynamically mapped as a concrete field although it will always be shadowed by the runtime field defined with the same name.

A more sensible default would be to instead consider runtime fields like ordinary mapped fields, so a dynamic update is not necessary whenever a field is defined as part of the runtime section. As a consequence, the field does not get indexed. If users prefer to keep indexing the field although it is shadowed, we consider this an exception, and they can do so by mapping the field under properties explicitly.

Relates to #62906
2020-11-19 20:13:55 +01:00
Jay Modi 59f5f481e9
Fix date math hidden index resolution (#65236)
This commit updates the IndexAbstractionResolver so that hidden indices
are properly resolved when date math is in use and when we are checking
if the index is visible.

Closes #65157
2020-11-19 10:54:59 -07:00
Jay Modi 76c22f751e
HttpsServer can use TLSv1.3 on JDK16+ (#64496)
This commit changes code that previously pinned to TLSv1.2 when running
on JDK 12+ to allow the use of TLSv1.3 if on JDK 16 or newer. There was
a bug in the HttpsServer code that has finally been fixed, which
prevented the use of TLSv1.3 as the HttpsServer would endlessly loop.
The JDK bug is JDK-8254967.

Closes #38646
2020-11-19 10:46:19 -07:00
Ryan Ernst 06b2deb674
Move security manager codebases files to plugin-metadata (#65243)
The codebases files are hints that allow the test framework to map
codebase names required by plugin security policy files to urls that may
exist as classes directories on disk. These files end up in the same
test resources directory in gradle, but in eclipse they exist in
different directories. This commit reorganizes the files so they exist
within the same plugin-metadata source, thereby existing in the same
output directory used by tests. Finally, the codebases files are
filtered out of the final jar within the plugin build.
2020-11-19 09:18:41 -08:00
James Rodewig a8ddf76526
[DOCS] ILM: Add alloc ex with multiple node attributes (#65266) 2020-11-19 12:17:10 -05:00
Nik Everett 90a7f000db
Fixup reduceRandom tests (#65263)
In aa1ea96b86 I made all
`testReduceRandom` tests for aggs mimick production more precisely.
More precisely, they pick the correct "lead" result when performing
partial reduction. This is great, but, sadly, some tests assumed that we
always reduced against the "first" aggregator. This fixes those tests.

Closes #65163
2020-11-19 12:04:28 -05:00
James Rodewig a51107a845
[DOCS] Document get data stream API's _meta prop (#65221) 2020-11-19 09:51:03 -05:00
James Rodewig ce644909dc
[DOCS] EQL: Add wildcard support to `:` operator (#65237) 2020-11-19 08:26:13 -05:00
Armin Braun 6e4c9836d0
Remove Redundant Translog Fsync (#65121)
All spots using this method would do a fsync with metadata afterwards
so we might as well do a full fsync right away and save a redundant
fsync + re-opening the file.
2020-11-19 14:20:27 +01:00
Adrien Grand 3d33b15850
Ignore system indices from mapping stats and analysis stats. (#65220)
When collecting information about analyzers or field types, we do not care much
about usage in system indices which are managed by Elasticsearch, however we
care about indices that are created by users.
2020-11-19 14:17:43 +01:00
Armin Braun 8b39992bf8
Cleanup TransportRequestOptions Usage (#65248)
A class with 2 fields does not need a builder, especially
when in many cases the builder result is just equivalent to the
`EMPTY` singleton to begin with.
Removed the builder and simplified related code accordingly.
2020-11-19 13:12:53 +01:00
Costin Leau 44cc284119
EQL: Introduce list declaration for : operator (#65230)
Add syntactic sugar for performing case-insensitive comparison,
including support for the wildcard pattern, against multiple values.

type where field : ("a", "b", "c*")

Fix #64388
2020-11-19 13:45:21 +02:00
Alan Woodward 63f7fc7cb8
Fix array handling in XContentMapValues.extractRawValues() (#65193)
When an array is encountered while following a path through the map,
we should only add array values if we're at the final path. So following the
path `foo.bar.baz` shouldn't add concrete values that sit in the array
at `foo.bar`.
2020-11-19 11:32:03 +00:00
Martijn van Groningen 0a9ae7c023
Move watcher transport actions to a single package, (#64488)
instead of each class have its own package.
2020-11-19 11:14:18 +01:00
Rene Groeschke 46d2681d8a
Split precommit plugins into internal and external (#65102)
* Split precommit plugins into internal and external
* Introduce interface for InternalPlugins
* avoid joint java groovy compilation
* Move isModule handling into internal only
2020-11-19 09:45:19 +01:00
Henning Andersen 21892817c4
Test version update for must_exist test (#65216)
Relates #65141
2020-11-19 07:45:01 +01:00
Mark Vieira 7369b15824
Ensure correct jdbc driver version is passed to bwc tests (#65241) 2020-11-18 13:55:53 -08:00
Ryan Ernst 303c375e37
Use different security policies for eclipse vs intellij (#65234)
Intellij has a special junit runner jar that needs additional security
manager permissions. However, this jar is not present in eclipse. This
commit adds a new (empty) policy for eclipse, and then chooses which to
load based on the presence of the special intellij junit jar. This is a
bit of a hack, but there are no special system properties for intellij
or eclipse that I could find (there are substrings that could be
searched for in existing properties, but looking for a specific key is
much easier to do that searching a substring).

relates #65231
2020-11-18 12:00:03 -08:00
DeDe Morton fb53dc3167
Fix links to Fleet overview (#65174) 2020-11-18 10:26:04 -08:00
Przemko Robakowski 54d58ff5e5
Additionl logging for ScheduleTriggerEngineMock (#65215)
There are still CI failures in watcher related tests even after #65186.
I wasn't able to reproduce it locally at all so this change adds additional logging to pinpoint the problem.
2020-11-18 19:05:33 +01:00
Benjamin Trent e5352c0833
[ML] fixing ml.upgrade_job_snapshot.json spec (#65224) 2020-11-18 13:00:04 -05:00
James Rodewig cc75bda411
[DOCS] Remote reindex is not fwd compatible (#65207) 2020-11-18 12:29:05 -05:00
Costin Leau db43a1c013
EQL: Add wildcard functionality to : operator (#65188)
Additionally, restrict the grammar to allow only a constant on the right hand side of :.

Fix #65154
2020-11-18 19:19:39 +02:00
Armin Braun cb657c2629
Fix Allocation `include` Filter Docs (#65202)
Fix documentation to match actual behavior of `include` type filters.

Closes #65113
2020-11-18 17:59:59 +01:00
Rene Groeschke 67105087f3
Fix docker packaging tests (#65199) 2020-11-18 17:16:01 +01:00
James Rodewig 661409a5a0
[DOCS] Clarify logger-package relationship (#65169)
Updates the logging level docs to better clarify the relationship
between loggers and their Java packages.
2020-11-18 10:28:06 -05:00