• Y
    Simplify write thread logic · e9e6e532
    Yi Wu 提交于
    Summary:
    The concept about early exit in write thread implementation is a confusing one. It means that if early exit is allowed, batch group leader will not responsible to exit the batch group, but the last finished writer do. In case we need to mark log synced, or encounter memtable insert error, early exit is disallowed.
    
    This patch remove such a concept by:
    * In all cases, the last finished writer (not necessary leader) is responsible to exit batch group.
    * In case of parallel memtable write, leader will also mark log synced after memtable insert and before signal finish (call `CompleteParallelWorker()`). The purpose is to allow mark log synced (which require locking mutex) can run in parallel to memtable insert in other writers.
    * The last finish writer should handle memtable insert error (update bg_error_) before exiting batch group.
    Closes https://github.com/facebook/rocksdb/pull/2134
    
    Differential Revision: D4869667
    
    Pulled By: yiwu-arbug
    
    fbshipit-source-id: aec170847c85b90f4179d6a4608a4fe1361544e3
    e9e6e532
db_impl.h 45.6 KB