-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call Refresh API to satisfy ?refresh
in Stateless
#93160
Call Refresh API to satisfy ?refresh
in Stateless
#93160
Conversation
server/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java
Outdated
Show resolved
Hide resolved
The failure is #93142; @elasticmachine please run elasticsearch-ci/part-2 |
I'm writing a test with this on the Stateless module. It seems when it's |
ActionListener<BulkResponse> listener = outerListener; | ||
if (DiscoveryNode.isStateless(clusterService.getSettings()) && bulkRequest.getRefreshPolicy() != WriteRequest.RefreshPolicy.NONE) { | ||
listener = outerListener.delegateFailure((l, r) -> { client.admin().indices().prepareRefresh().execute(l.map(ignored -> r)); }); | ||
bulkRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.NONE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for the WAIT_UNTIL
to work properly, we'd need to also integrate the refresh listeners mechanism in Stateless, since currently they don't get called back. Since we're going with work-arounds here to keep it short, I've just replaced the policy once we know we're calling a refresh afterwards anyway.
Pinging @elastic/es-distributed (Team:Distributed) |
server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM apart from the spurious @AwaitsFix
Thanks, David! |
…lastic#93383) In elastic#93160, we never set the forced_refresh flag in the response. With this change, the bulk response now correctly reflects what happened. It also unblocks a bunch of YAML tests for Stateless. Relates ES-5292
Since we know which indices were involved in the Bulk request we can refresh only those instead of all indices, and expand to hidden indices so that they are also refreshed. Relates #93160
This is a workaround that provides support for the
IMMEDIATE
andWAIT_UNTIL
Refresh policies.Relates ES-5292