[go: up one dir, main page]

Skip to content

raft: Integrate Raft library into transaction manager

This issue tracks the work of integrating Raft into the current storagemgr's transaction manager. The detailed implementation is proposed in this comment:

  1. The TransactionManager is currently not tracking appendedLSN and committedLSN separately. We just have the appendedLSN here but we'd need to separate those out for Raft. committedLSN should be managed by Raft and incremented only once a log entry has been committed via Raft by appending the log entry to the log of the majority.
  2. Transactions always start against the latest committedLSN. We're reading that currently here. Raft needs to hook here and the committedLSN should be read through Raft. This ensures followers wait for any committed log entries that haven't yet been replicated from the leader, and that the leader will notice whether it has been dethroned by another replica.
  3. We also need to plug Raft into the commit process which happens here. Raft should be invoked to commit the log entry with majority before we increment the committedLSN here.
  4. The log entry application here needs to be updated to only apply up to committedLSN to ensure we don't apply log entries that haven't yet been committed.
  5. Log entry pruning here likely needs to be updated to wait until the log entries have been replicated everywhere, or the leader has decided to drop the entry if a replica is unavailable.
Edited by Quang-Minh Nguyen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information