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

Single state machine across main and object stores #1077

Open
wants to merge 77 commits into
base: main
Choose a base branch
from

Conversation

badrishc
Copy link
Collaborator

@badrishc badrishc commented Mar 8, 2025

Changes:

  • Share Epoch and StateMachineDriver (SMD) across main and object stores
  • Garnet checkpointing uses this shared driver to checkpoint both stores with a single state machine
  • Transactions use SMD to register transactions, so that a single transaction version is maintained across the two stores.
  • Transactions no longer barrier during the (v) -> (v+1) switchover. We ensure correctness by verifying the transaction version after all locks are acquired.
  • Move NumActiveLockingSessions (renamed to NumActiveTransactions) to SMD and ensure correct (v) -> (v+1) switchover with active transactions.
  • Removed targetVersion concept so that checkpoint versions always increment in steps of 1.
  • Refactored CheckpointVersionShift to a pair of CheckpointVersionShiftStart and CheckpointVersionShiftEnd to help demarcate start and end of fuzzy region in the AOF ((region that contains mix of v and v+1 log entries).
  • Fix AOF replay to correctly process single-key operations and transactions in fuzzy region. Specifically, we process all (v) ops and txns in the fuzzy region, then take a checkpoint, then process all the stored (v+1) ops and txns in the fuzzy region.

Notes:

  • Recovery and cluster logic is left unmodified, they assume checkpoints are separate across main and object stores. This allows the PR to remain backward compatible.

@badrishc badrishc marked this pull request as ready for review March 11, 2025 01:25
@TalZaccai TalZaccai requested a review from TedHartMS March 11, 2025 18:25
Copy link
Collaborator

@TedHartMS TedHartMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with one comment

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