Skip to content

Commit e4728f9

Browse files
ywangdalexey-ivanov-es
authored andcommitted
[Test] Flush master queue before checking snapshots (elastic#116938)
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
1 parent 081cee9 commit e4728f9

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,6 @@ tests:
209209
- class: org.elasticsearch.reservedstate.service.RepositoriesFileSettingsIT
210210
method: testSettingsApplied
211211
issue: https://github.com/elastic/elasticsearch/issues/116694
212-
- class: org.elasticsearch.snapshots.SnapshotShutdownIT
213-
method: testRestartNodeDuringSnapshot
214-
issue: https://github.com/elastic/elasticsearch/issues/116730
215212
- class: org.elasticsearch.xpack.security.authc.ldap.ActiveDirectoryGroupsResolverTests
216213
issue: https://github.com/elastic/elasticsearch/issues/116182
217214
- class: org.elasticsearch.xpack.test.rest.XPackRestIT

server/src/internalClusterTest/java/org/elasticsearch/snapshots/SnapshotShutdownIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public void testRestartNodeDuringSnapshot() throws Exception {
109109

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

0 commit comments

Comments
 (0)