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

[DocDB] Fix lock-order-inversion found by test PgDdlAtomicityTest.TestDatabaseGC #26164

Open
1 task done
mdbridge opened this issue Feb 22, 2025 · 0 comments
Open
1 task done
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage test_stability

Comments

@mdbridge
Copy link
Contributor

mdbridge commented Feb 22, 2025

Jira Link: DB-15497

Description

TSAN reports (one of many):

[m-1] WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=478487)
[m-1]   Cycle in lock order graph: M0 (0x7b600013e808) => M1 (0x7b600013ec08) => M0
[m-1] 
[m-1]   Mutex M1 acquired here while holding mutex M0 in main thread:
[m-1]     #0 <null> <null> (0x000000000042)
[m-1] 
[m-1]   Mutex M0 previously acquired by the same thread here:
[m-1]     #0 <null> <null> (0x000000000042)
[m-1] 
[m-1]   Mutex M0 acquired here while holding mutex M1 in thread T50:
[m-1]     #0 pthread_mutex_lock ${YB_LLVM_TOOLCHAIN_DIR}-build/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1339:3 (yb-master+0xa352b)
[m-1]     #1 std::mutex::lock() <null> (libc++.so.1+0xa7749)
[m-1]     #2 yb::RWCLock::WriteLock() ${YB_SRC_ROOT}/src/yb/util/rwc_lock.cc:149:16 (libyb_util.so+0x412aaf)
[m-1]     #3 yb::CowObject<yb::master::PersistentTableInfo>::StartMutation() ${YB_SRC_ROOT}/src/yb/util/cow_object.h:77:11 (libmaster.so+0x604789)
[m-1]     #4 yb::CowWriteLock<yb::master::PersistentTableInfo>::CowWriteLock(yb::CowObject<yb::master::PersistentTableInfo>*) ${YB_SRC_ROOT}/src/yb/util/cow_object.h:229:11 (libmaster.so+0x604789)
[m-1]     #5 yb::master::MetadataCowWrapper<yb::master::PersistentTableInfo>::LockForWrite() ${YB_SRC_ROOT}/src/yb/master/catalog_entity_base.h:87:37 (libmaster.so+0x604789)
[m-1]     #6 yb::master::CatalogManager::DeleteYsqlDBTables(string const&, yb::master::DeleteYsqlDBTablesType, yb::master::LeaderEpoch const&) ${YB_SRC_ROOT}/src/yb/master/catalog_manager.cc:9374:23 (libmaster.so+0x604789)
[m-1]     #7 yb::master::CatalogManager::DeleteYsqlDatabaseAsync(scoped_refptr<yb::master::NamespaceInfo>, yb::master::LeaderEpoch const&) ${YB_SRC_ROOT}/src/yb/master/catalog_manager.cc:9224:14 (libmaster.so+0x5fe363)
[m-1] 
[m-1]   Mutex M1 previously acquired by the same thread here:
[m-1]     #0 pthread_mutex_lock ${YB_LLVM_TOOLCHAIN_DIR}-build/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1339:3 (yb-master+0xa352b)
[m-1]     #1 std::mutex::lock() <null> (libc++.so.1+0xa7749)
[m-1]     #2 yb::RWCLock::WriteLock() ${YB_SRC_ROOT}/src/yb/util/rwc_lock.cc:149:16 (libyb_util.so+0x412aaf)
[m-1]     #3 yb::CowObject<yb::master::PersistentTableInfo>::StartMutation() ${YB_SRC_ROOT}/src/yb/util/cow_object.h:77:11 (libmaster.so+0x604789)
[m-1]     #4 yb::CowWriteLock<yb::master::PersistentTableInfo>::CowWriteLock(yb::CowObject<yb::master::PersistentTableInfo>*) ${YB_SRC_ROOT}/src/yb/util/cow_object.h:229:11 (libmaster.so+0x604789)
[m-1]     #5 yb::master::MetadataCowWrapper<yb::master::PersistentTableInfo>::LockForWrite() ${YB_SRC_ROOT}/src/yb/master/catalog_entity_base.h:87:37 (libmaster.so+0x604789)
[m-1]     #6 yb::master::CatalogManager::DeleteYsqlDBTables(string const&, yb::master::DeleteYsqlDBTablesType, yb::master::LeaderEpoch const&) ${YB_SRC_ROOT}/src/yb/master/catalog_manager.cc:9374:23 (libmaster.so+0x604789)
[m-1]     #7 yb::master::CatalogManager::DeleteYsqlDatabaseAsync(scoped_refptr<yb::master::NamespaceInfo>, yb::master::LeaderEpoch const&) ${YB_SRC_ROOT}/src/yb/master/catalog_manager.cc:9224:14 (libmaster.so+0x5fe363)

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@mdbridge mdbridge added area/docdb YugabyteDB core features status/awaiting-triage Issue awaiting triage labels Feb 22, 2025
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue test_stability labels Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage test_stability
Projects
None yet
Development

No branches or pull requests

2 participants