-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Fork post-snapshot-delete cleanup off master thread #122731
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
Fork post-snapshot-delete cleanup off master thread #122731
Conversation
We shouldn't run the post-snapshot-delete cleanup work on the master thread, since it can be quite expensive and need not block subsequent cluster state updates. This commit forks it onto a `SNAPSHOT` thread.
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
|
Hi @DaveCTurner, I've created a changelog YAML for you. |
nicktindall
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
| snapshot.create: | ||
| repository: test_repo_create_1 | ||
| snapshot: barrier_snapshot | ||
| wait_for_completion: 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.
Nice, I had a look at this as well when the original problems popped up. I investigated adding a
- do:
tasks.list:
actions: cluster:admin/snapshot/delete
wait_for_completion: trueto the end of the test, but looking at the code, the task completing didn't necessarily mean the delete had occurred?
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 it does. My understanding that deletion request goes into snapshotDeletionListeners and proceed with deletion, update cluster state when deletion is complete, and notify snapshotDeletionListeners on cluster state update. I guess it comes to the repository implementation, if delete calls are synchronous, otherwise we need to pull state...
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.
In the ?wait_for_completion=false case we don't register the listener with snapshotDeletionListeners:
elasticsearch/server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java
Lines 2227 to 2231 in aac1409
| if (newDelete == null || request.waitForCompletion() == false) { | |
| listener.onResponse(null); | |
| } else { | |
| addDeleteListener(newDelete.uuid(), listener); | |
| } |
|
LGTM |
We shouldn't run the post-snapshot-delete cleanup work on the master thread, since it can be quite expensive and need not block subsequent cluster state updates. This commit forks it onto a `SNAPSHOT` thread.
We shouldn't run the post-snapshot-delete cleanup work on the master thread, since it can be quite expensive and need not block subsequent cluster state updates. This commit forks it onto a `SNAPSHOT` thread.
We shouldn't run the post-snapshot-delete cleanup work on the master thread, since it can be quite expensive and need not block subsequent cluster state updates. This commit forks it onto a `SNAPSHOT` thread.
We shouldn't run the post-snapshot-delete cleanup work on the master
thread, since it can be quite expensive and need not block subsequent
cluster state updates. This commit forks it onto a
SNAPSHOTthread.