Skip to content

Commit

Permalink
Record compact progress and metrics per iteration
Browse files Browse the repository at this point in the history
Fixes issue where compact progress was only recorded in metrics and loop var if all iterations succeeded, despite progress being made within individual iterations of the inner loop.

Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Nov 8, 2024
1 parent eaa8c6f commit aa4f2a7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/logstructured/sqllog/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ outer:
metrics.CompactTotal.WithLabelValues(metrics.ResultError).Inc()
continue outer
}

// Record progress for the outer loop
compactRev = compactedRev
targetCompactRev = currentRev

metrics.CompactTotal.WithLabelValues(metrics.ResultSuccess).Inc()
}

if err := s.postCompact(); err != nil {
logrus.Errorf("Post-compact operations failed: %v", err)
}

// Record the final results for the outer loop
compactRev = compactedRev
targetCompactRev = currentRev

metrics.CompactTotal.WithLabelValues(metrics.ResultSuccess).Inc()
}
}

Expand Down

0 comments on commit aa4f2a7

Please sign in to comment.