Skip to content
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 race condition in snapshot initialization #18426

Merged

Conversation

Projects
None yet
2 participants
@imotov
Copy link
Member

commented May 17, 2016

When a snapshot initialization fails, the create snapshot method may return before the snapshot metadata in the cluster state is removed. This can cause follow up snapshot-API related calls to fail due to a snapshot still running. This is causing CI failures when we try to delete indices that were participating in failed snapshot to a read-only repository.

Closes #18121

@dakrone

View changes

core/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java Outdated
* @param t exception if snapshot failed
* @param listener listener to notify when snapshot information is removed from the cluster state
*/
private void removeSnapshotFromClusterState(final SnapshotId snapshotId, final SnapshotInfo snapshot, final Throwable t, ActionListener<SnapshotInfo> listener) {

This comment has been minimized.

Copy link
@dakrone

dakrone May 17, 2016

Member

Super minor, but want to annotate listener with @Nullable?

@dakrone

This comment has been minimized.

Copy link
Member

commented May 17, 2016

LGTM, left one really minor comment

Fix race condition in snapshot initialization
When a snapshot initialization fails, the create snapshot method may return before the snapshot metadata in the cluster state is removed. This can cause follow up snapshot-API related calls to fail due to a snapshot still running. This is causing CI failures when we try to delete indices that were participating in failed snapshot to a read-only repository.

Closes #18121

@imotov imotov force-pushed the imotov:issue-18121-race-condition-in-snapshot-failure branch to ce88d7f May 20, 2016

@imotov imotov merged commit ce88d7f into elastic:master May 20, 2016

1 check passed

CLA Commit author is a member of Elasticsearch
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.