Skip to content

Commit 9fcf03a

Browse files
committed
Fix testPostOperationGlobalCheckpointSync
The conditions in this test do not hold true anymore after #43205. Relates to #43205
1 parent 666e3c0 commit 9fcf03a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

server/src/test/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncIT.java

+10-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import java.util.Optional;
4545
import java.util.concurrent.BrokenBarrierException;
4646
import java.util.concurrent.CyclicBarrier;
47+
import java.util.concurrent.TimeUnit;
4748
import java.util.function.Consumer;
4849
import java.util.stream.Collectors;
4950
import java.util.stream.Stream;
@@ -83,8 +84,14 @@ public void testGlobalCheckpointSyncWithAsyncDurability() throws Exception {
8384
}
8485

8586
public void testPostOperationGlobalCheckpointSync() throws Exception {
86-
// set the sync interval high so it does not execute during this test
87-
runGlobalCheckpointSyncTest(TimeValue.timeValueHours(24), client -> {}, client -> {});
87+
// set the sync interval high so it does not execute during this test. This only allows the the global checkpoint to catch up
88+
// on a post-operation background sync if translog durability is set to sync. Async durability relies on a scheduled global
89+
// checkpoint sync to allow the information about persisted local checkpoints to be transferred to the primary.
90+
runGlobalCheckpointSyncTest(TimeValue.timeValueHours(24),
91+
client ->
92+
client.admin().indices().prepareUpdateSettings("test").setSettings(Settings.builder()
93+
.put(IndexSettings.INDEX_TRANSLOG_DURABILITY_SETTING.getKey(), Translog.Durability.REQUEST)).get(),
94+
client -> {});
8895
}
8996

9097
/*
@@ -212,7 +219,7 @@ private void runGlobalCheckpointSyncTest(
212219
assertThat(seqNoStats.getGlobalCheckpoint(), equalTo(primarySeqNoStats.getGlobalCheckpoint()));
213220
}
214221
}
215-
});
222+
}, 30, TimeUnit.SECONDS);
216223

217224
for (final Thread thread : threads) {
218225
thread.join();

0 commit comments

Comments
 (0)