Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deflake write-prepared and write-unprepared tests #8696

Closed

Commits on Aug 24, 2021

  1. Deflake write-prepared and write-unprepared tests

    Summary: The `JobContext::job_snapshot` referenced DB state but could
    have been deleted by a BG thread after the signal/unlock allowing
    shutdown to proceed. Then we would see an error like this (valgrind):
    
    ```
    ==354104== Thread 2:
    ==354104== Invalid read of size 8
    ==354104==    at 0x694C4D: rocksdb::ManagedSnapshot::~ManagedSnapshot() (snapshot_impl.cc:20)
    ==354104==    by 0x58F5BA: operator() (unique_ptr.h:81)
    ==354104==    by 0x58F5BA: operator() (unique_ptr.h:75)
    ==354104==    by 0x58F5BA: ~unique_ptr (unique_ptr.h:292)
    ==354104==    by 0x58F5BA: rocksdb::JobContext::~JobContext() (job_context.h:221)
    ==354104==    by 0x5F155E: rocksdb::DBImpl::BackgroundCallCompaction(rocksdb::DBImpl::PrepickedCompaction*, rocksdb::Env::Priority) (db_impl_compaction_flush.cc:2696)
    ==354104==    by 0x5F1BC2: rocksdb::DBImpl::BGWorkCompaction(void*) (db_impl_compaction_flush.cc:2468)
    ==354104==    by 0x83707A: operator() (std_function.h:688)
    ==354104==    by 0x83707A: rocksdb::ThreadPoolImpl::Impl::BGThread(unsigned long) (threadpool_imp.cc:266)
    ==354104==    by 0x8373ED: rocksdb::ThreadPoolImpl::Impl::BGThreadWrapper(void*) (threadpool_imp.cc:307)
    ==354104==    by 0x492A800: execute_native_thread_routine (in /usr/local/fbcode/platform009/lib/libstdc++.so.6.0.28)
    ==354104==    by 0x4A5020B: start_thread (in /usr/local/fbcode/platform009/lib/libpthread-2.30.so)
    ==354104==    by 0x4CF281E: clone (in /usr/local/fbcode/platform009/lib/libc-2.30.so)
    ```
    
    Test Plan: unable to repro
    
    Reviewers:
    
    Subscribers:
    
    Tasks:
    
    Tags:
    ajkr committed Aug 24, 2021
    Configuration menu
    Copy the full SHA
    1e40d64 View commit details
    Browse the repository at this point in the history