• A
    Use SST files for Transaction conflict detection · 3bfd3d39
    agiardullo 提交于
    Summary:
    Currently, transactions can fail even if there is no actual write conflict.  This is due to relying on only the memtables to check for write-conflicts.  Users have to tune memtable settings to try to avoid this, but it's hard to figure out exactly how to tune these settings.
    
    With this diff, TransactionDB will use both memtables and SST files to determine if there are any write conflicts.  This relies on the fact that BlockBasedTable stores sequence numbers for all writes that happen after any open snapshot.  Also, D50295 is needed to prevent SingleDelete from disappearing writes (the TODOs in this test code will be fixed once the other diff is approved and merged).
    
    Note that Optimistic transactions will still rely on tuning memtable settings as we do not want to read from SST while on the write thread.  Also, memtable settings can still be used to reduce how often TransactionDB needs to read SST files.
    
    Test Plan: unit tests, db bench
    
    Reviewers: rven, yhchiang, kradhakrishnan, IslamAbdelRahman, sdong
    
    Reviewed By: sdong
    
    Subscribers: dhruba, leveldb, yoshinorim
    
    Differential Revision: https://reviews.facebook.net/D50475
    3bfd3d39
db_impl.cc 188.6 KB