Skip to content

Commit

Permalink
add comments as per PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianburckhardt committed Oct 29, 2024
1 parent d3ea290 commit b97eb92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,9 @@ await this.PerformWithRetriesAsync(

await this.WriteCheckpointMetadataAsync();

// we boost the tracing after three failed attempts. This boosting applies to the recovery part only.
// After thirty attempts, we stop boosting since it seems unlikely
// that there is any more information after that that cannot be found in the logs for the first 30 attempts.
if (this.CheckpointInfo.RecoveryAttempts > 3 && this.CheckpointInfo.RecoveryAttempts < 30)
{
this.TraceHelper.BoostTracing = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ 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;

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

0 comments on commit b97eb92

Please sign in to comment.