Commit 9e2a92c
committed
[yugabyte#26775] DocDB: Fix trace hang in PgReadTimeTest.TestFastPathCopyDuplicateKeyOnColocated test
Summary:
After commit a665c19/D43007 this test could hang with the following stack:
```
/home/centos/code/yugabyte/src/yb/gutil/atomicops-internals-tsan.h:131: @ 0x7f60fa375719 base::subtle::NoBarrier_Load(int const volatile*)
/home/centos/code/yugabyte/src/yb/gutil/spinlock.cc:103: @ 0x7f60fa375719 base::SpinLock::SpinLoop(long, int*)
/home/centos/code/yugabyte/src/yb/gutil/spinlock.cc:154: @ 0x7f60fa375719 base::SpinLock::SlowLock()
/home/centos/code/yugabyte/src/yb/gutil/spinlock.h:88: @ 0x7f60fa85e594 base::SpinLock::Lock()
/home/centos/code/yugabyte/src/yb/util/locks.h:59: @ 0x7f60fa85e594 yb::simple_spinlock::lock()
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__mutex/lock_guard.h:33: @ 0x7f60fa85e594 std::lock_guard<yb::simple_spinlock>::lock_guard[abi:ne190100](yb::simple_spinlock&)
/home/centos/code/yugabyte/src/yb/util/trace.cc:399: @ 0x7f60fa85e594 yb::Trace::AddEntry(yb::TraceEntry*)
/home/centos/code/yugabyte/src/yb/util/trace.cc:377: @ 0x7f60fa85e873 yb::Trace::SubstituteAndTrace(char const*, int, std::chrono::time_point<yb::CoarseMonoClock, std::chrono::duration<long long, std::ratio<1l, 1000000000l>>>, GStringPiece, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&, strings::internal::SubstituteArg const&)
/home/centos/code/yugabyte/src/yb/rpc/yb_rpc.cc:343: @ 0x7f60fb1bb3f0 yb::rpc::YBInboundCall::DumpPB(yb::rpc::DumpRunningRpcsRequestPB const&, yb::rpc::RpcCallInProgressPB*)
/home/centos/code/yugabyte/src/yb/rpc/rpc_with_call_id.cc:34: @ 0x7f60fb1619ff yb::rpc::ConnectionContextWithCallId::DumpPB(yb::rpc::DumpRunningRpcsRequestPB const&, yb::rpc::RpcConnectionPB*)
/home/centos/code/yugabyte/src/yb/rpc/connection.cc:544: @ 0x7f60fb0d283f yb::rpc::Connection::DumpPB(yb::rpc::DumpRunningRpcsRequestPB const&, yb::rpc::RpcConnectionPB*)
/home/centos/code/yugabyte/src/yb/rpc/reactor.cc:467: @ 0x7f60fb138776 yb::rpc::Reactor::DumpRunningRpcs(yb::rpc::DumpRunningRpcsRequestPB const&, yb::rpc::DumpRunningRpcsResponsePB*)::$_0::operator()(yb::rpc::Reactor*) const
/home/centos/code/yugabyte/src/yb/rpc/reactor.cc:212: @ 0x7f60fb138776 yb::rpc::(anonymous namespace)::RunFunctionTask<yb::rpc::Reactor::DumpRunningRpcs(yb::rpc::DumpRunningRpcsRequestPB const&, yb::rpc::DumpRunningRpcsResponsePB*)::$_0>::Run(yb::rpc::Reactor*)
/home/centos/code/yugabyte/src/yb/rpc/reactor.cc:546: @ 0x7f60fb1300d0 yb::rpc::Reactor::AsyncHandler(ev::async&, int)
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/common/include/ev++.h:479: @ 0x7f60fb13f0c8 void ev::base<ev_async, ev::async>::method_thunk<yb::rpc::Reactor, &yb::rpc::Reactor::AsyncHandler(ev::async&, int)>(ev_loop*, ev_async*, int)
@ 0x7f60f9973f1a
@ 0x7f60f9974b56
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/common/include/ev++.h:211: @ 0x7f60fb12b035 ev::loop_ref::run(int)
/home/centos/code/yugabyte/src/yb/rpc/reactor.cc:735: @ 0x7f60fb12b035 yb::rpc::Reactor::RunThread()
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__type_traits/invoke.h:117: @ 0x7f60fb13f2eb decltype(*std::declval<yb::rpc::Reactor*&>().*std::declval<void (yb::rpc::Reactor::*&)()>()()) std::__invoke[abi:ne190100]<void (yb::rpc::Reactor::*&)(), yb::rpc::Reactor*&, void>(void (yb::rpc::Reactor::*&)(), yb::rpc::Reactor*&)
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__functional/bind.h:196: @ 0x7f60fb13f2eb std::__bind_return<void (yb::rpc::Reactor::*)(), tuple<yb::rpc::Reactor*>, tuple<>, __is_valid_bind_return<void (yb::rpc::Reactor::*)(), tuple<yb::rpc::Reactor*>, tuple<>>::value>::type std::__apply_functor[abi:ne190100]<void (yb::rpc::Reactor::*)(), tuple<yb::rpc::Reactor*>, 0ul, tuple<>>(void (yb::rpc::Reactor::*&)(), tuple<yb::rpc::Reactor*>&, std::__tuple_indices<0ul>, tuple<>&&)
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__functional/bind.h:223: @ 0x7f60fb13f2eb std::__bind_return<void (yb::rpc::Reactor::*)(), tuple<yb::rpc::Reactor*>, tuple<>, __is_valid_bind_return<void (yb::rpc::Reactor::*)(), tuple<yb::rpc::Reactor*>, tuple<>>::value>::type std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>::operator()[abi:ne190100]<>()
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__type_traits/invoke.h:149: @ 0x7f60fb13f2eb decltype(std::declval<std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>&>()()) std::__invoke[abi:ne190100]<std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>&>(std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>&)
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__type_traits/invoke.h:224: @ 0x7f60fb13f2eb void std::__invoke_void_return_wrapper<void, true>::__call[abi:ne190100]<std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>&>(std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>&)
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__functional/function.h:171: @ 0x7f60fb13f2eb std::__function::__alloc_func<std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>, std::allocator<std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>>, void ()>::operator()[abi:ne190100]()
/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20250407190656-d44003a211-almalinux8-x86_64-clang19/installed/tsan/libcxx/include/c++/v1/__functional/function.h:313: @ 0x7f60fb13f2eb std::__function::__func<std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>, std::allocator<std::__bind<void (yb::rpc::Reactor::* const&)(), yb::rpc::Reactor* const&>>, void ()>::operator()()
```
Could be caused by changes in `Trace::must_print`, fixed by checking childs w/o holding lock of parent.
Jira: DB-16155
Test Plan: ./yb_build.sh tsan --gtest_filter PgReadTimeTest.TestFastPathCopyDuplicateKeyOnColocated -n 12
Reviewers: amitanand
Reviewed By: amitanand
Subscribers: ybase
Tags: #jenkins-ready
Differential Revision: https://phorge.dev.yugabyte.com/D433981 parent 49f1b8c commit 9e2a92c
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
338 | 344 | | |
339 | 345 | | |
340 | 346 | | |
| |||
0 commit comments