-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Fix ClusterStateRestCancellationIT #72407
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
Fix ClusterStateRestCancellationIT #72407
Conversation
Take into account that the task can be cancelled after the check has been performed and it could trip the assertion. Closes elastic#72056
|
Pinging @elastic/es-distributed (Team:Distributed) |
|
@elasticmachine update branch |
| // It is possible that the task is cancelled after the predicate has been executed, therefore we should take | ||
| // that into account as well for the assertion | ||
| assert acceptableClusterStateOrFailedPredicate.test(state) == false | ||
| || request.local() == false && cancellableTask.isCancelled(); |
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 was expecting the cancellableTask.isCancelled() here but not the request.local() check. Digging into why that's needed led me to conclude that there's a bug in #67413: local requests should also complete on the first cluster state update after cancellation.
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.
You're right, I've moved the cancellation check outside of acceptableClusterStateOrFailedPredicate making it deterministic given the same ClusterState. Now we check for cancellation in local requests too.
…cofdez/elasticsearch into fix-cluster-state-rest-cancellation-it
…est-cancellation-it
DaveCTurner
left a comment
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
| clusterStateRequest.addParameter("wait_for_metadata_version", Long.toString(Long.MAX_VALUE)); | ||
| clusterStateRequest.addParameter("wait_for_timeout", "1h"); | ||
| if (randomBoolean()) { | ||
| clusterStateRequest.addParameter("local", "true"); |
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.
👍
Take into account task cancellation for local requests too Closes elastic#72056 Backport of elastic#72407
Take into account that the task can be cancelled after the check for
acceptableClusterStateOrFailedPredicate has been performed and
it could trip the assertion.
Closes #72056