Skip to content

Conversation

@benbjohnson
Copy link
Collaborator

Summary

  • Add CompactorStatus struct with N (last page compacted) and Total (total pages from Commit field)
  • Add Status() method that returns current progress, safe to call concurrently from another goroutine
  • Use sync/atomic.Uint32 for lock-free, concurrent-safe reads

Test plan

  • Verify Status() returns zero values before compaction starts
  • Verify Total equals the Commit value from the last input header
  • Verify N equals the last page written after compaction completes
  • All existing tests pass

🤖 Generated with Claude Code

benbjohnson and others added 2 commits December 17, 2025 09:23
Add CompactorStatus struct and Status() method to track compaction progress.
The status includes the last page compacted (N) and total pages (Total),
using atomic operations for safe concurrent reads from other goroutines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add helper methods to check if status is uninitialized and to get
completion percentage. Pct() safely returns 0 when Total is zero.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@benbjohnson benbjohnson merged commit a08d200 into main Dec 17, 2025
2 checks passed
@benbjohnson benbjohnson deleted the add-compactor-progress-tracking branch December 17, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants