Fix race condition in SnapshotsService (#101652)

* Fix race condition in SnapshotsService

* Update docs/changelog/101652.yaml
This commit is contained in:
Volodymyr Krasnikov 2023-11-01 07:34:32 -07:00 committed by GitHub
parent e9179ae71e
commit b22eae5fa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1,5 @@
pr: 101652
summary: Fix race condition in `SnapshotsService`
area: Snapshot/Restore
type: bug
issues: []

View file

@ -1066,7 +1066,6 @@ public class ConcurrentSnapshotsIT extends AbstractSnapshotIntegTestCase {
}
}
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/99355")
public void testMasterFailoverOnFinalizationLoop() throws Exception {
internalCluster().startMasterOnlyNodes(3);
final String dataNode = internalCluster().startDataOnlyNode();

View file

@ -164,7 +164,7 @@ public class SnapshotsService extends AbstractLifecycleComponent implements Clus
/**
* Listeners for snapshot deletion keyed by delete uuid as returned from {@link SnapshotDeletionsInProgress.Entry#uuid()}
*/
private final Map<String, List<ActionListener<Void>>> snapshotDeletionListeners = new HashMap<>();
private final Map<String, List<ActionListener<Void>>> snapshotDeletionListeners = new ConcurrentHashMap<>();
// Set of repositories currently running either a snapshot finalization or a snapshot delete.
private final Set<String> currentlyFinalizing = Collections.synchronizedSet(new HashSet<>());