Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call afterWriteOperation after trim translog in peer recovery #45182

Merged
merged 4 commits into from
Aug 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
dnhatn marked this conversation as resolved.
Show resolved Hide resolved
// 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