• R
    [rocksdb] Memtable Log Referencing and Prepared Batch Recovery · 1b8a2e8f
    Reid Horuff 提交于
    Summary:
    This diff is built on top of WriteBatch modification: https://reviews.facebook.net/D54093 and adds the required functionality to rocksdb core necessary for rocksdb to support 2PC.
    
    modfication of DBImpl::WriteImpl()
    - added two arguments *uint64_t log_used = nullptr, uint64_t log_ref = 0;
    - *log_used is an output argument which will return the log number which the incoming batch was inserted into, 0 if no WAL insert took place.
    -  log_ref is a supplied log_number which all memtables inserted into will reference after the batch insert takes place. This number will reside in 'FindMinPrepLogReferencedByMemTable()' until all Memtables insertinto have flushed.
    
    - Recovery/writepath is now aware of prepared batches and commit and rollback markers.
    
    Test Plan: There is currently no test on this diff. All testing of this functionality takes place in the Transaction layer/diff but I will add some testing.
    
    Reviewers: IslamAbdelRahman, sdong
    
    Subscribers: leveldb, santoshb, andrewkr, vasilep, dhruba, hermanlee4
    
    Differential Revision: https://reviews.facebook.net/D56919
    1b8a2e8f
db_impl.cc 210.7 KB