mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-27 00:27:25 -04:00
This adds support for setting the refresh request parameter to `wait_for` in the `index`, `delete`, `update`, and `bulk` APIs. When `refresh=wait_for` is set those APIs will not return until their results have been made visible to search by a refresh. Also it adds a `forced_refresh` field to the response of `index`, `delete`, `update`, and to each item in a bulk response. This will be true for requests with `?refresh` or `?refresh=true` and will be true for some requests (see below) with `refresh=wait_for` but ought to otherwise always be false. `refresh=wait_for` is implemented as a list of `Tuple<Translog.Location, Consumer<Boolean>>`s in the new `RefreshListeners` class that is managed by `IndexShard`. The dynamic, index scoped `index.max_refresh_listeners` setting controls a maximum number of listeners allowed in any shard. If more than that many listeners accumulate in the engine then a refresh will be forced, the thread that adds the listener will be blocked until the refresh completes, and then the listener will be called with a `forcedRefresh` flag so it knows that it was the "straw that broke the camel's back". These listeners are only used by `refresh=wait_for` and that flag manifests itself as `forced_refresh` being `true` in the response. About half of this change comes from piping async-ness down to the appropriate layer in a way that is compatible with the ongoing with with sequence ids. Closes #1063 You can look up the winding story of all the commits here: https://github.com/elastic/elasticsearch/pull/17986 Here are the commit messages in case they are intersting to you: commit |
||
---|---|---|
.. | ||
aggregations | ||
analysis | ||
cat | ||
cluster | ||
docs | ||
images | ||
index-modules | ||
indices | ||
ingest | ||
mapping | ||
migration | ||
modules | ||
query-dsl | ||
release-notes | ||
search | ||
setup | ||
testing | ||
aggregations.asciidoc | ||
analysis.asciidoc | ||
api-conventions.asciidoc | ||
cat.asciidoc | ||
cluster.asciidoc | ||
docs.asciidoc | ||
getting-started.asciidoc | ||
glossary.asciidoc | ||
index-modules.asciidoc | ||
index.asciidoc | ||
indices.asciidoc | ||
ingest.asciidoc | ||
mapping.asciidoc | ||
modules.asciidoc | ||
query-dsl.asciidoc | ||
redirects.asciidoc | ||
release-notes.asciidoc | ||
search.asciidoc | ||
setup.asciidoc | ||
testing.asciidoc |