Skip to content

Commit

Permalink
Fix testPostOperationGlobalCheckpointSync
Browse files Browse the repository at this point in the history
The conditions in this test do not hold true anymore after #43205.

Relates to #43205
  • Loading branch information
ywelsch committed Jun 25, 2019
1 parent e473858 commit 3d5e457
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.util.Optional;
import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -83,8 +84,14 @@ public void testGlobalCheckpointSyncWithAsyncDurability() throws Exception {
}

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

/*
Expand Down Expand Up @@ -212,7 +219,7 @@ private void runGlobalCheckpointSyncTest(
assertThat(seqNoStats.getGlobalCheckpoint(), equalTo(primarySeqNoStats.getGlobalCheckpoint()));
}
}
});
}, 30, TimeUnit.SECONDS);

for (final Thread thread : threads) {
thread.join();
Expand Down

0 comments on commit 3d5e457

Please sign in to comment.