peloton
peloton copied to clipboard
[15721] Logging and Recovery
This PR implements logging and recovery for robustness to crashes.
Logging:
- Create log records and write them into log buffers in
TimestampOrderingTransactionManager
as executing transactions. Submit the buffer when it is full and then acquire a new one for the current transaction. - Push the callback for committing transactions from the network level to the worker level. Set logging callbacks and return
QUEUING
inCommitTransaction
andAbortTransaction
. - Adopt delta logging for updates. Pass
values_buf
,values_size
andoffsets
all the way down toPerformUpdate
. - Use tokens to guarantee the FIFO order in the logical queue for multiple workers. The logic queue consists of a few sub-queues, each per worker. Buffers belonging to the same transaction will be put into the same sub-queue.
- Support the default codegen engine only.
Recovery:
- Implement two-pass recovery. The first pass filters out transactions that are not committed while the second one classifies recods by
txn_id
. After two passes, all the transactions are replayed. - Support
Create Table
,Create Database
,Insert
andDelete
currently.