Skip to content

Commit

Permalink
[Test] Flush master queue before checking snapshots
Browse files Browse the repository at this point in the history
The block-on-data-node returns once the data node begins to process the
cluster state update for new snapshot. This is before master can see the
chnages. In edge cases, the listener may be completed too early before
the master can see the new snapshot. This PR flushes the master queue to
ensure the snapshot is visible.

Resolves: elastic#116730
  • Loading branch information
ywangd committed Nov 18, 2024
1 parent 27eb013 commit 131430e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ tests:
- class: org.elasticsearch.reservedstate.service.RepositoriesFileSettingsIT
method: testSettingsApplied
issue: https://github.com/elastic/elasticsearch/issues/116694
- class: org.elasticsearch.snapshots.SnapshotShutdownIT
method: testRestartNodeDuringSnapshot
issue: https://github.com/elastic/elasticsearch/issues/116730
- class: org.elasticsearch.xpack.security.authc.ldap.ActiveDirectoryGroupsResolverTests
issue: https://github.com/elastic/elasticsearch/issues/116182
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void testRestartNodeDuringSnapshot() throws Exception {

final var clusterService = internalCluster().getCurrentMasterNodeInstance(ClusterService.class);
final var snapshotFuture = startFullSnapshotBlockedOnDataNode(randomIdentifier(), repoName, originalNode);
safeAwait((ActionListener<Void> l) -> flushMasterQueue(clusterService, l));
final var snapshotCompletesWithoutPausingListener = ClusterServiceUtils.addTemporaryStateListener(clusterService, state -> {
final var entriesForRepo = SnapshotsInProgress.get(state).forRepo(repoName);
if (entriesForRepo.isEmpty()) {
Expand Down

0 comments on commit 131430e

Please sign in to comment.