git-hulk commented on issue #2596:
URL: https://github.com/apache/kvrocks/issues/2596#issuecomment-2409896161

   The DB lock was used to protect the db pointer from being freed while using. 
All threads currently can guarantee that, so I think we should not use the db 
lock in Context construction and destruction. cc @PokIsemaine 
   
   Can refer to the stack:
   
   ```
   Thread 25 (Thread 0xffff7e326bc0 (LWP 45) "compact-check"):
   #0  0x0000ffffa7dab694 in __futex_abstimed_wait_common64 (private=0, 
cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xffffa79ad7a8) at 
./nptl/futex-internal.c:57
   #1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, 
clockid=0, expected=0, futex_word=0xffffa79ad7a8) at ./nptl/futex-internal.c:87
   #2  __GI___futex_abstimed_wait_cancelable64 
(futex_word=futex_word@entry=0xffffa79ad7a8, expected=expected@entry=0, 
clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at 
./nptl/futex-internal.c:139
   #3  0x0000ffffa7dae1d0 in __pthread_cond_wait_common (abstime=0x0, 
clockid=0, mutex=0xffffa79ad380, cond=0xffffa79ad780) at 
./nptl/pthread_cond_wait.c:503
   #4  ___pthread_cond_wait (cond=0xffffa79ad780, mutex=0xffffa79ad380) at 
./nptl/pthread_cond_wait.c:618
   #5  0x0000aaaad6580b80 in rocksdb::port::CondVar::Wait() ()
   #6  0x0000aaaad640d38c in rocksdb::InstrumentedCondVar::Wait() ()
   #7  0x0000aaaad6273b8c in 
rocksdb::DBImpl::RunManualCompaction(rocksdb::ColumnFamilyData*, int, int, 
rocksdb::CompactRangeOptions const&, rocksdb::Slice const*, rocksdb::Slice 
const*, bool, bool, unsigned long, std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&, int*) ()
   #8  0x0000aaaad6274628 in 
rocksdb::DBImpl::CompactRangeInternal(rocksdb::CompactRangeOptions const&, 
rocksdb::ColumnFamilyHandle*, rocksdb::Slice const*, rocksdb::Slice const*, 
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > 
const&) ()
   #9  0x0000aaaad627519c in 
rocksdb::DBImpl::CompactRange(rocksdb::CompactRangeOptions const&, 
rocksdb::ColumnFamilyHandle*, rocksdb::Slice const*, rocksdb::Slice const*) ()
   #10 0x0000aaaad60e4ccc in 
engine::Storage::Compact(rocksdb::ColumnFamilyHandle*, rocksdb::Slice const*, 
rocksdb::Slice const*) ()
   #11 0x0000aaaad615f1b4 in 
CompactionChecker::PickCompactionFilesForCf(engine::ColumnFamilyConfig const&) 
[clone .isra.0] ()
   #12 0x0000aaaad60bc730 in 
std::thread::_State_impl<std::thread::_Invoker<std::tuple<util::CreateThread<Server::Start()::{lambda()#2}>(char
 const*, Server::Start()::{lambda()#2})::{lambda()#1}> > >::_M_run() [clone 
.lto_priv.0] ()
   #13 0x0000aaaad69052dc in execute_native_thread_routine ()
   #14 0x0000ffffa7daee30 in start_thread (arg=0xffffe904fbe7) at 
./nptl/pthread_create.c:442
   #15 0x0000ffffa7e17adc in thread_start () at 
../sysdeps/unix/sysv/linux/aarch64/clone.S:79
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to