Commit Graph

53713 Commits

Author SHA1 Message Date
Armin Braun 9b155d9201
Fix Snapshot Status API Docs Test (#59902)
The clock resolution for this API is our default 200ms. It is unlikely but
possible that a shard snapshot starts and ends on separate clock ticks and that breaks the test.
Just allowing any value here seems fine to me (seems we can't match for integer specifically).
2020-07-20 18:26:05 +02:00
David Turner 6fe66c0e89
Complete backport of #59755 (#59887)
Adjusts the version logic used for BWC and reinstates the BWC tests
2020-07-20 16:13:20 +01:00
Jay Modi c41ac5f7cb
Fix race in SLM master/cluster state listeners (#59801)
This change fixes two possible race conditions in SLM related to
how local master changes and cluster state events are observed. When
implementing the `LocalNodeMasterListener` interface, it is only
recommended to execute on a separate threadpool if the operations are
heavy and would block the cluster state thread. SLM specified that the
listeners should run in the Snapshot thread pool, but the operations
in the listener were lightweight. This had the side effect of causing
master changes to be delayed if the Snapshot threads were all busy and
could also potentially cause the `onMaster` and `offMaster` calls to
race if both were queued and then executed concurrently. Additionally,
the `SnapshotLifecycleService` is also a `ClusterStateListener` and
there is currently no order of operations guarantee between
`LocalNodeMasterListeners` and `ClusterStateListeners` so this could
lead to incorrect behavior.

The resolution for these two issues is that the
SnapshotRetentionService now specifies the `SAME` executor for its
implementation of the `LocalNodeMasterListener` interface. The
`SnapshotLifecycleService` is no longer a `LocalNodeMasterListener` and
instead tracks local master changes in its `ClusterStateListner`.
2020-07-20 09:08:57 -06:00
Bogdan Pintea 9ba70a3483
SQL: fix NPE on ambiguous GROUP BY (#59370)
* fix npe on ambiguous group by

* add tests for aggregates and group by, add quotes to error message

* add more cases for Group By ambiguity test

* change error messages for field ambiguity

* change collection aliases approach

* add locations of attributes for ambiguous grouping error

* Adress review comments

- remove Comparable implementations from Attribute and Location;
- add ad-hoc comparator for sorting locations in ambiguity message;
- remove added AttributeAlias class with Touple;
- add code comment to explain issue with Location overwriting.

* Fix c&p error in location ref generation comparator

Fix copy&paste error in dedicated comparator used for sorting ambiguity
location references.
Slightly increase its readability.

Co-authored-by: Nikita Verkhovin <verkhovin13@gmail.com>
2020-07-20 16:46:04 +02:00
David Turner 406bad80e6 Disable BWC tests for backport of #59755 2020-07-20 15:21:55 +01:00
Ed Savage a15df0e3d5
[ML] Remove deprecated _xpack endpoints (#59870)
Extends the work done in #48170 to the ml module
2020-07-20 15:17:28 +01:00
Nik Everett f87b31f973
Document supported scenarios for CCS (#58120)
Documents the supported scenarios for CCS.

Co-authored-by: Adam Locke <adam.locke@elastic.co>
2020-07-20 10:03:08 -04:00
Igor Motov 6bfde550f9
Add hard_bounds documentation (#59809)
Fixes #59774
2020-07-20 09:54:02 -04:00
David Turner 7bb748da8c
Remove sporadic min/max usage estimates from stats (#59755)
Today `GET _nodes/stats/fs` includes `{least,most}_usage_estimate`
fields for some nodes. These fields have rather strange semantics. They
are only reported on the elected master and on nodes that have been the
elected master since they were last restarted; when a node stops being
the elected master these stats remain in place but we stop updating them
so they may become arbitrarily stale.

This means that these statistics are pretty meaningless and impossible
to use correctly. Even if they were kept up to date they're never
reported for data-only nodes anyway, despite the fact that data nodes
are the ones where we care most about disk usage. The information needed
to compute the path with the least/most available space is already
provided in the rest the stats output, so we can treat the inclusion of
these stats as a bug and fix it by simply removing them in this commit.
Since these stats were always optional and mostly omitted (for opaque
reasons) this is not considered a breaking change.
2020-07-20 14:48:53 +01:00
Nik Everett 3615c42e08
Fix top_metrics when metric is missing (#59471)
This fixes a null pointer exception when the metric is missing for the
latest document returned by `top_metrics`.

Closes #58926
2020-07-20 09:46:03 -04:00
James Rodewig 1d8143deae
[DOCS] Fix `requests_per_second` reindex param (#59871)
Corrects the `requests_per_second` query parameter used in the reindex,
delete by query, and update by query API docs.

The parameter defaults to `-1` (no throttle). `0` is not an allowed value.
2020-07-20 09:42:01 -04:00
James Rodewig cb6d1c00f0
[DOCS] Document data stream stats API (#59435) 2020-07-20 09:33:01 -04:00
Stéphane Campinas c75ed66318
fix handling of alias filter in SearchService#canMatch (#59368)
The check against the alias filter should be done after the request is rewritten.

Close #59367
2020-07-20 15:15:47 +02:00
Nik Everett cce9f6cf0a
Allocate slightly less per bucket (#59740)
This replaces that data structure that we use to resolve bucket ids in
bucketing aggs that are inside other bucketing aggs. This replaces the
"legoed together" data structure with a purpose built `LongLongHash`
with semantics similar to `LongHash`, except that it has two `long`s
as keys instead of one.

The microbenchmarks show a fairly substantial performance gain on the
hot path, around 30%. Rally's higher level benchmarks show anywhere
from 0 to 7% speed improvements. Not as much as I'd hoped, but nothing
to sneeze at. And, after all, we all allocating slightly less data per
owningBucketOrd, which is always nice.
2020-07-20 09:00:58 -04:00
Rui Almeida 2c450214ac
[DOCS] Fix keyword marker docs (#59834) 2020-07-20 08:54:55 -04:00
Dimitris Athanasiou bbce0215c1
[ML] Reenable regression test with debugging assertion (#59855)
Reenables RegressionIT.testSingleNumericFeatureAndMixedTrainingAndNonTrainingRows
with an assertion that should help us understand whether the documents that
have empty feature importance are training or test docs.

Relates #59413
2020-07-20 15:54:33 +03:00
James Rodewig 861892add4
[DOCS] EQL: Remove collapsible sections from EQL search docs (#59819) 2020-07-20 08:50:19 -04:00
James Rodewig 8170cb9cf0
[DOCS] Remove collapsible examples (#59820)
Snippets are now visible without additional clicks.
2020-07-20 08:42:56 -04:00
Nhat Nguyen bd7755d2b2
Increase timeout testFollowIndexWithConcurrentMappingChanges
Fixes #59273
2020-07-20 08:36:12 -04:00
Nhat Nguyen fd926aaff3
Fix race in testSendSnapshotSendsOps (#59831)
There is a race between increase and get the global checkpoint in the 
test as indexTranslogOperations can be executed concurrently.

Closes #59492
2020-07-20 08:35:08 -04:00
Rene Groeschke f29fe0643d
Remove superflous enforce deprecation failure plugin (#59770)
- With enforcing the build to fail on all gradle deprecated api usage we do not need
this tailored plugin anymore
2020-07-20 11:41:37 +02:00
Albert Zaharovits d31808de80
Fix DLS/FLS permission for the submit async search action (#59693)
The submit async search action should not populate the thread context
DLS/FLS permission set, because it is not currently authorised as an "indices request"
and hence the permission set that it builds is incomplete and it overrides the
DLS/FLS permission set of the actual spawned search request (which is built correctly).
2020-07-20 08:44:54 +03:00
Nhat Nguyen 6d7de1a7be Log shard list in testIndexVersionPropagation
Relates #59494
2020-07-18 23:26:23 -04:00
Costin Leau 77c88da054
EQL: Fix matching of tail/desc queries (#59827)
When dealing with tail queries, data is returned descending for the base
criterion yet the rest of the queries are ascending. This caused a
problem during insertion since while in a page, the data is ASC, between
pages the blocks of data is DESC.
This caused incorrectly sorting inside a SequenceGroup which led to
incorrect results.

Further more in case of limit, since the data in a page is ASC, early
return is not possible neither is desc matching. Thus the page needs to
be consumed first before finding the final results.
A future improvement could be to keep only the top N results dropping
the rest during insertion time.
2020-07-19 00:48:27 +03:00
Mark Vieira 175eddd82e
Attach build scan information to TeamCity builds 2020-07-17 17:49:21 -07:00
Lee Hinman 15e674fa77 Fix skip version for 14_alias_to_multiple_indices.yml
The message was slightly changed but only in 7.9+

Relates to #59806
2020-07-17 16:56:13 -06:00
Ryan Ernst 546eae9d30
Ensure precommit runs as part of check (#59476)
Precommit is setup to run as a dependency of the check task, but
unfortunately this wiring was only happening when the java plugin (but
not java-base plugin) was applied. This commit moves the wiring to occur
whenever the check task exists, which is with the lifecycle-base plugin.
2020-07-17 15:41:07 -07:00
Lee Hinman ebcf5d525d
Fix retrieving data stream stats for a DS with multiple backing indices (#59806)
* Fix retrieving data stream stats for a DS with multiple backing indices

This API incorrectly had `allowAliasesToMultipleIndices` set to false in the default options for the
request. This changes it from `false` to `true` and enhances a test to exercise the functionality.

Resolves #59802

* Fix test for wording change
2020-07-17 13:52:44 -06:00
James Rodewig 6a02528e91
[DOCS] Fix erroneous data stream ref (#59805)
Removes an erroneous data stream reference added in #58513.

While technically possible, we don't encourage using date math to name
data streams.
2020-07-17 13:43:43 -04:00
Nik Everett 27efb5f3b8
Clean up a few of vwh's rough edges (#59341)
This cleans up a few rough edged in the `variable_width_histogram`,
mostly found by @wwang500:
1. Setting its tuning parameters in an unexpected order could cause the
   request to fail.
2. We checked that the maximum number of buckets was both less than
   50000 and MAX_BUCKETS. This drops the 50000.
3. Fixes a divide by 0 that can occur of the `shard_size` is 1.
4. Fixes a divide by 0 that can occur if the `shard_size * 3` overflows
   a signed int.
5. Requires `shard_size * 3 / 4` to be at least `buckets`. If it is less
   than `buckets` we will very consistently return fewer buckets than
   requested. For the most part we expect folks to leave it at the
   default. If they change it, we expect it to be much bigger than
   `buckets`.
6. Allocate a smaller `mergeMap` in when initially bucketing requests
   that don't use the entire `shard_size * 3 / 4`. Its just a waste.
7. Default `shard_size` to `10 * buckets` rather than `100`. It *looks*
   like that was our intention the whole time. And it feels like it'd
   keep the algorithm humming along more smoothly.
8. Default the `initial_buffer` to `min(10 * shard_size, 50000)` like
   we've documented it rather than `5000`. Like the point above, this
   feels like the right thing to do to keep the algorithm happy.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-17 13:39:28 -04:00
Adam Locke c143bb56cb
[DOCS] Updating snapshot/restore pages to align with API changes (#59730)
* Updating snapshot/restore pages to align with API changes.

* Fixing texts in delete snapshot page.

* Removing duplicate code sample and making editorial changes.

* Change "deleted" to "delete"

* Incorporating review feedback and making minor editorial changes.

* Remove titleabbrev

* Add paragraph break

* Remove titleabbrev from restore page

* Remove titleabbrev from create page

* Change "Create" to lowercase

* Change API names to lowercase

* Remove extraneous delimiters

* Change "Delete" to lowercase

* Single-sourcing warning and clarifying warning text.
2020-07-17 13:08:13 -04:00
Benjamin Trent 1c7e16319d
[ML] adjusting bwc tests and serialization for require_alias (#59780) 2020-07-17 12:27:52 -04:00
Lee Hinman 19a380ac63
Allow simulating existing composable index template (#59733)
This change allows simulating replacing a composable template with a different version, for example:

```
POST /_index_template/_simulate/my-template
{
  "index_patterns": ["idx*"],
  "composed_of": ["ct1"],
  "priority": 10,
  "template": {
    "settings": {
      "index.lifecycle.name": "policy"
    }
  }
}
```

Should simulate as if `my-template` were replaced with the template specified in the body.

Resolves #59152
2020-07-17 10:12:30 -06:00
Christoph Büscher 8d7b2b1bb6 Lowering serialization version after backporting #58822 2020-07-17 17:24:10 +02:00
Nik Everett 6130ecc173
Small cleanup for IndexFieldData (#59724)
This drops `IndexComponent` from `IndexFieldData` because it wasn't
doing anything other than forcing us to perform a bunch of ceremony to
build them.
2020-07-17 11:15:17 -04:00
James Rodewig a390e6d7be
[DOCS] Reformat Painless snippets to use two-space indents (#59776) 2020-07-17 11:03:19 -04:00
Tal Levy c59de3ee8d
Reduce precision in geotile circuit breaker tests (#59778)
PR #57962 increased the precision from 6 to 7 without realizing the
effects on CI — This resulted in out of memory exceptions in CI.

This commit reduces the precision down to 5.
2020-07-17 08:02:00 -07:00
Shahzad 24e5da7851
Update regex file for es user agent node processor (#59697) 2020-07-17 16:54:34 +02:00
Armin Braun 3cef12368c
Fix Snapshot Status API Docs Test (#59775)
We can't just assume a fixed number for the overall file count.
Depending on how the merging/flushing works out we won't always have
4 files for the index across all versions, systems etc.
Also, we could have x-pack concurrently create some system indices
which could mess up the total numbers here.
Fixed by only snapshotting a single index+shard in the snapshot that
we get the status for and verifying consistency instead of equality
for total file counts.

Closes #59767
2020-07-17 16:34:29 +02:00
Rory Hunter 4db094c008
Remove dangling index auto import functionality (#59698)
Closes #48366. Remove all traces of automatically importing dangling indices. This functionality is
deprecated from 7.9.0.
2020-07-17 15:17:58 +01:00
James Rodewig aa3ddfeefb
[DOCS] Move highlighting docs to separate page (#59768)
Moves the highlighting docs from the deprecated 'Request Body Search'
chapter to the new subpage of the 'Run a search chapter' section.

No substantive changes were made to the content.
2020-07-17 10:15:20 -04:00
Benjamin Trent fabfa711cc
muting bwc tests for https://github.com/elastic/elasticsearch/pull/58917 (#59777) 2020-07-17 10:10:54 -04:00
Christoph Büscher 427d7f54fe
Add `zero_terms_query` support to `match_phrase_prefix` (#58822)
Currently `match_phrase_prefix` doesn't support `zero_terms_query` like the
other match-type queries. This change adds this support.

Closes #58468
2020-07-17 15:59:02 +02:00
Benjamin Trent f72b893fd3
Adding new `require_alias` option to indexing requests (#58917)
This commit adds the `require_alias` flag to requests that create new documents.

This flag, when `true` prevents the request from automatically creating an index. Instead, the destination of the request MUST be an alias.

When the flag is not set, or `false`, the behavior defaults to the `action.auto_create_index` settings.

This is useful when an alias is required instead of a concrete index.

closes https://github.com/elastic/elasticsearch/issues/55267
2020-07-17 08:45:46 -04:00
Alan Woodward 42377c7729
Shortcut mapping update if the incoming mapping version is the same as the current mapping version (#59517)
Currently, when we apply a cluster state change to a shard on a non-master node,
we check to see if the mappings need to be updated by comparing the decompressed
serialized mappings from the update against the serialized version of the shard's
existing mappings. However, we already have a much simpler way of checking this,
by comparing mapping versions on the index metadata of the old and new states.

This commit adds a shortcut to MapperService.updateMappings() that compares
these mapping versions, and ignores the merge if they are equal.
2020-07-17 12:46:54 +01:00
Hendrik Muhs 77f442f057
[CI][Transform] add debug logs to help debugging #52931 (#59729)
add debug logs to help debugging #52931
2020-07-17 10:39:13 +02:00
Rene Groeschke 41638dd303
Fix all deprecations in resolveAllDependencies (#59751)
This fixes #59743
2020-07-17 10:02:21 +02:00
Andrei Stefan d097447d25
Do not create the index, if it's already there (#59745) 2020-07-17 09:59:43 +03:00
Tal Levy 8762cd6d66
Fix bug in circuit-breaker check for geoshape grid aggregations (#57962)
There was a bug in the geoshape circuit-breaker check where the
hash values array was being allocated before its new size was
accounted for by the circuit breaker.

Fixes #57847.
2020-07-16 16:14:33 -07:00
Martijn van Groningen 69c66a9ee6
Re-enable data stream bwc tests (#59732)
after backporting #59503
2020-07-16 23:16:44 +02:00