• yiwu-arbug's avatar
    Disable compactions on initial open of rocksdb (#29) · c5f2551d
    yiwu-arbug authored
    Summary:
    On `TitanDBImpl::Open` we open rocksdb twice, and the first time is just to get list of CFs and construct table factory. Compaction can run at this point, generating SST files without custom table property. This can cause problem later on, since `OnCompactionCompleted` assume the property always exist and even use it to detect new blob file generated from the compaction. This patch disable auto compaction for the first rocksdb open to avoid such problem.
    
    The test shown here demo the issue without disabling compaction: https://gist.github.com/yiwu-arbug/34c561d0daf4f9c293bb7b2825d77bf2
    
    Test Plan:
    Existing tests
    Signed-off-by: 's avatarYi Wu <yiwu@pingcap.com>
    c5f2551d
db_impl.cc 25.9 KB