• R
    Improve perf of Pessimistic Transaction expirations (and optimistic transactions) · 6f71d3b6
    reid horuff 提交于
    Summary:
    copy from task 8196669:
    
    1) Optimistic transactions do not support batching writes from different threads.
    2) Pessimistic transactions do not support batching writes if an expiration time is set.
    
    In these 2 cases, we currently do not do any write batching in DBImpl::WriteImpl() because there is a WriteCallback that could decide at the last minute to abort the write.  But we could support batching write operations with callbacks if we make sure to process the callbacks correctly.
    
    To do this, we would first need to modify write_thread.cc to stop preventing writes with callbacks from being batched together.  Then we would need to change DBImpl::WriteImpl() to call all WriteCallback's in a batch, only write the batches that succeed, and correctly set the state of each batch's WriteThread::Writer.
    
    Test Plan: Added test WriteWithCallbackTest to write_callback_test.cc which creates multiple client threads and verifies that writes are batched and executed properly.
    
    Reviewers: hermanlee4, anthony, ngbronson
    
    Subscribers: leveldb, dhruba
    
    Differential Revision: https://reviews.facebook.net/D52863
    6f71d3b6
transaction_impl.h 3.8 KB