Skip to content

Commit

Permalink
Call afterWriteOperation in testShouldFlushAfterPeerRecovery
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhatn committed Aug 5, 2019
1 parent 6e2e73b commit 0f2b3a1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ public void testShouldFlushAfterPeerRecovery() throws Exception {
replica.indexSettings().updateIndexMetaData(builder.build());
replica.onSettingsChanged();
shards.recoverReplica(replica);
// Make sure the flushing will eventually be completed (eg. `shouldPeriodicallyFlush` is false)
// trigger a flush if `shouldPeriodicallyFlush` becomes true after we roll a new generation in RecoveryTarget#finalizeRecovery
replica.afterWriteOperation();
// Make sure that the flushing loop will eventually complete (i.e, `shouldPeriodicallyFlush` becomes false)
assertBusy(() -> assertThat(getEngine(replica).shouldPeriodicallyFlush(), equalTo(false)));
boolean softDeletesEnabled = replica.indexSettings().isSoftDeleteEnabled();
assertThat(getTranslog(replica).totalOperations(), equalTo(softDeletesEnabled ? 0 : numDocs));
Expand Down

0 comments on commit 0f2b3a1

Please sign in to comment.