Skip to content

Commit

Permalink
disable prefetch on every other attempt only, to make sure we are not…
Browse files Browse the repository at this point in the history
… permanently breaking anything
  • Loading branch information
sebastianburckhardt committed Oct 30, 2024
1 parent d89c992 commit 8c6cb3c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ async Task TerminationWrapper(Task what)
{
// replay log as the store checkpoint lags behind the log

// disable prefetch if we have had many unsuccessful recovery attempts, or if the settings say so
// We choose 6 as the threshold since the tracing gets boosted after 3 attempts, and we want to see 3 attempts with boosted tracing before we disable prefetch
bool disablePrefetch = this.blobManager.CheckpointInfo.RecoveryAttempts > 6 || this.settings.DisablePrefetchDuringReplay;
// after six unsuccessful attempts, we start disabling prefetch on every other attempt, to see if this can remedy the problem
int startDisablingPrefetchAfter = 6;

bool disablePrefetch = this.settings.DisablePrefetchDuringReplay
|| (this.blobManager.CheckpointInfo.RecoveryAttempts > startDisablingPrefetchAfter && (this.blobManager.CheckpointInfo.RecoveryAttempts - startDisablingPrefetchAfter) % 2 == 1);

await this.TerminationWrapper(this.storeWorker.ReplayCommitLog(this.logWorker, prefetch: !disablePrefetch));
}
Expand Down

0 comments on commit 8c6cb3c

Please sign in to comment.