Open alesapin opened 1 month ago
It seems other race conditions with system.parts
also happen (see https://s3.amazonaws.com/clickhouse-test-reports/70053/57db54239f1e668b9bdb2050ae5ea34df4a94fc0/stateless_tests__tsan__s3_storage__[3_3].html):
WARNING: ThreadSanitizer: data race (pid=610)
Write of size 8 at 0x7220004f17d0 by thread T1475:
#0 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) <null> (clickhouse+0x7751a8b) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#1 DB::DataPartStorageOnDiskBase::rename(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::shared_ptr<Poco::Logger>, bool, bool) build_docker/./src/Storages/MergeTree/DataPartStorageOnDiskBase.cpp:682:14 (clickhouse+0x19d01c14) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#2 DB::IMergeTreeDataPart::renameTo(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool) build_docker/./src/Storages/MergeTree/IMergeTreeDataPart.cpp:1915:26 (clickhouse+0x19d41772) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#3 DB::MergeTreeData::Transaction::renameParts() build_docker/./src/Storages/MergeTree/MergeTreeData.cpp:6856:27 (clickhouse+0x19ea7a88) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#4 DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda1'()::operator()() const build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp:941:21 (clickhouse+0x1a29d0e3) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#5 DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda2'()::operator()() const build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp:1088:43 (clickhouse+0x1a29c9b8) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#6 DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()::operator()() const build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp:1121:13 (clickhouse+0x1a29c7d0) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#7 void DB::ZooKeeperRetriesControl::retryLoop<DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()&, void DB::ZooKeeperRetriesControl::retryLoop<DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()>(DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()&&)::'lambda'()>(DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()&&, void DB::ZooKeeperRetriesControl::retryLoop<DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()>(DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()&&)::'lambda'()&&) build_docker/./src/Common/ZooKeeper/ZooKeeperRetries.h:74:17 (clickhouse+0x1a29c7d0)
#8 void DB::ZooKeeperRetriesControl::retryLoop<DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()>(DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long)::'lambda3'()&&) build_docker/./src/Common/ZooKeeper/ZooKeeperRetries.h:48:9 (clickhouse+0x1a287454) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#9 DB::ReplicatedMergeTreeSinkImpl<false>::commitPart(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&, std::__1::shared_ptr<DB::IMergeTreeDataPart>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, unsigned long) build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp:1113:17 (clickhouse+0x1a287454)
#10 DB::ReplicatedMergeTreeSinkImpl<false>::finishDelayedChunk(std::__1::shared_ptr<DB::ZooKeeperWithFaultInjection> const&) build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp:480:33 (clickhouse+0x1a275983) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#11 DB::ReplicatedMergeTreeSinkImpl<false>::onFinish() build_docker/./src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp:1199:5 (clickhouse+0x1a2867f1) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#12 DB::ExceptionKeepingTransform::work()::$_3::operator()() const build_docker/./src/Processors/Transforms/ExceptionKeepingTransform.cpp:186:47 (clickhouse+0x1ab4b610) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#13 decltype(std::declval<DB::ExceptionKeepingTransform::work()::$_3&>()()) std::__1::__invoke[abi:v15007]<DB::ExceptionKeepingTransform::work()::$_3&>(DB::ExceptionKeepingTransform::work()::$_3&) build_docker/./contrib/llvm-project/libcxx/include/__functional/invoke.h:394:23 (clickhouse+0x1ab4b610)
#14 void std::__1::__invoke_void_return_wrapper<void, true>::__call<DB::ExceptionKeepingTransform::work()::$_3&>(DB::ExceptionKeepingTransform::work()::$_3&) build_docker/./contrib/llvm-project/libcxx/include/__functional/invoke.h:479:9 (clickhouse+0x1ab4b610)
#15 std::__1::__function::__default_alloc_func<DB::ExceptionKeepingTransform::work()::$_3, void ()>::operator()[abi:v15007]() build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:235:12 (clickhouse+0x1ab4b610)
#16 void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<DB::ExceptionKeepingTransform::work()::$_3, void ()>>(std::__1::__function::__policy_storage const*) build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:716:16 (clickhouse+0x1ab4b610)
#17 std::__1::__function::__policy_func<void ()>::operator()[abi:v15007]() const build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:848:16 (clickhouse+0x1ab4b037) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#18 std::__1::function<void ()>::operator()() const build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:1197:12 (clickhouse+0x1ab4b037)
#19 DB::runStep(std::__1::function<void ()>, DB::ThreadStatus*, std::__1::atomic<unsigned long>*) build_docker/./src/Processors/Transforms/ExceptionKeepingTransform.cpp:114:9 (clickhouse+0x1ab4b037)
#20 DB::ExceptionKeepingTransform::work() build_docker/./src/Processors/Transforms/ExceptionKeepingTransform.cpp:186:30 (clickhouse+0x1ab4aa40) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#21 DB::executeJob(DB::ExecutingGraph::Node*, DB::ReadProgressCallback*) build_docker/./src/Processors/Executors/ExecutionThreadContext.cpp:47:26 (clickhouse+0x1a7a7149) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#22 DB::ExecutionThreadContext::executeTask() build_docker/./src/Processors/Executors/ExecutionThreadContext.cpp:96:9 (clickhouse+0x1a7a7149)
#23 DB::PipelineExecutor::executeStepImpl(unsigned long, std::__1::atomic<bool>*) build_docker/./src/Processors/Executors/PipelineExecutor.cpp:289:26 (clickhouse+0x1a797254) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#24 DB::PipelineExecutor::executeSingleThread(unsigned long) build_docker/./src/Processors/Executors/PipelineExecutor.cpp:255:5 (clickhouse+0x1a7965ab) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#25 DB::PipelineExecutor::executeImpl(unsigned long, bool) build_docker/./src/Processors/Executors/PipelineExecutor.cpp:441:9 (clickhouse+0x1a7965ab)
#26 DB::PipelineExecutor::execute(unsigned long, bool) build_docker/./src/Processors/Executors/PipelineExecutor.cpp:126:9 (clickhouse+0x1a796289) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#27 DB::threadFunction(DB::CompletedPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroup>, unsigned long, bool) build_docker/./src/Processors/Executors/CompletedPipelineExecutor.cpp:49:24 (clickhouse+0x1a795049) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#28 DB::CompletedPipelineExecutor::execute()::$_0::operator()() const build_docker/./src/Processors/Executors/CompletedPipelineExecutor.cpp:89:13 (clickhouse+0x1a795049)
#29 decltype(std::declval<DB::CompletedPipelineExecutor::execute()::$_0&>()()) std::__1::__invoke[abi:v15007]<DB::CompletedPipelineExecutor::execute()::$_0&>(DB::CompletedPipelineExecutor::execute()::$_0&) build_docker/./contrib/llvm-project/libcxx/include/__functional/invoke.h:394:23 (clickhouse+0x1a795049)
#30 decltype(auto) std::__1::__apply_tuple_impl[abi:v15007]<DB::CompletedPipelineExecutor::execute()::$_0&, std::__1::tuple<>&>(DB::CompletedPipelineExecutor::execute()::$_0&, std::__1::tuple<>&, std::__1::__tuple_indices<...>) build_docker/./contrib/llvm-project/libcxx/include/tuple:1789:1 (clickhouse+0x1a795049)
#31 decltype(auto) std::__1::apply[abi:v15007]<DB::CompletedPipelineExecutor::execute()::$_0&, std::__1::tuple<>&>(DB::CompletedPipelineExecutor::execute()::$_0&, std::__1::tuple<>&) build_docker/./contrib/llvm-project/libcxx/include/tuple:1798:1 (clickhouse+0x1a795049)
#32 ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::CompletedPipelineExecutor::execute()::$_0>(DB::CompletedPipelineExecutor::execute()::$_0&&)::'lambda'()::operator()() build_docker/./src/Common/ThreadPool.h:311:13 (clickhouse+0x1a795049)
#33 decltype(std::declval<DB::CompletedPipelineExecutor::execute()::$_0>()()) std::__1::__invoke[abi:v15007]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::CompletedPipelineExecutor::execute()::$_0>(DB::CompletedPipelineExecutor::execute()::$_0&&)::'lambda'()&>(DB::CompletedPipelineExecutor::execute()::$_0&&) build_docker/./contrib/llvm-project/libcxx/include/__functional/invoke.h:394:23 (clickhouse+0x1a795049)
#34 void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::CompletedPipelineExecutor::execute()::$_0>(DB::CompletedPipelineExecutor::execute()::$_0&&)::'lambda'()&>(ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::CompletedPipelineExecutor::execute()::$_0>(DB::CompletedPipelineExecutor::execute()::$_0&&)::'lambda'()&) build_docker/./contrib/llvm-project/libcxx/include/__functional/invoke.h:479:9 (clickhouse+0x1a795049)
#35 std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::CompletedPipelineExecutor::execute()::$_0>(DB::CompletedPipelineExecutor::execute()::$_0&&)::'lambda'(), void ()>::operator()[abi:v15007]() build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:235:12 (clickhouse+0x1a795049)
#36 void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::CompletedPipelineExecutor::execute()::$_0>(DB::CompletedPipelineExecutor::execute()::$_0&&)::'lambda'(), void ()>>(std::__1::__function::__policy_storage const*) build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:716:16 (clickhouse+0x1a795049)
#37 std::__1::__function::__policy_func<void ()>::operator()[abi:v15007]() const build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:848:16 (clickhouse+0xf6dafdd) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#38 std::__1::function<void ()>::operator()() const build_docker/./contrib/llvm-project/libcxx/include/__functional/function.h:1197:12 (clickhouse+0xf6dafdd)
#39 ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::worker() build_docker/./src/Common/ThreadPool.cpp:785:17 (clickhouse+0xf6dafdd)
#40 decltype(*std::declval<ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>().*std::declval<void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)()>()()) std::__1::__invoke[abi:v15007]<void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*, void>(void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*&&) build_docker/./contrib/llvm-project/libcxx/include/__functional/invoke.h:359:23 (clickhouse+0xf6e2f7b) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#41 void std::__1::__thread_execute[abi:v15007]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>&, std::__1::__tuple_indices<2ul>) build_docker/./contrib/llvm-project/libcxx/include/thread:284:5 (clickhouse+0xf6e2f7b)
#42 void* std::__1::__thread_proxy[abi:v15007]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::__1::thread>::ThreadFromThreadPool*>>(void*) build_docker/./contrib/llvm-project/libcxx/include/thread:295:5 (clickhouse+0xf6e2f7b)
Previous read of size 8 at 0x7220004f17d0 by thread T831:
#0 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::__get_long_size[abi:v15007]() const build_docker/./contrib/llvm-project/libcxx/include/string:1584:34 (clickhouse+0x19cefaeb) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#1 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::size[abi:v15007]() const build_docker/./contrib/llvm-project/libcxx/include/string:968:31 (clickhouse+0x19cefaeb)
#2 std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::length[abi:v15007]() const build_docker/./contrib/llvm-project/libcxx/include/string:969:100 (clickhouse+0x19cefaeb)
#3 std::__1::__fs::filesystem::__is_pathable_string<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, void>::__range_end[abi:v15007](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) build_docker/./contrib/llvm-project/libcxx/include/__filesystem/path.h:111:29 (clickhouse+0x19cefaeb)
#4 void std::__1::__fs::filesystem::_PathCVT<char>::__append_source[abi:v15007]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) build_docker/./contrib/llvm-project/libcxx/include/__filesystem/path.h:332:20 (clickhouse+0x19cefaeb)
#5 std::__1::__fs::filesystem::path::path[abi:v15007]<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, void>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::__fs::filesystem::path::format) build_docker/./contrib/llvm-project/libcxx/include/__filesystem/path.h:483:5 (clickhouse+0x19cefaeb)
#6 DB::DataPartStorageOnDiskBase::getFullPath() const build_docker/./src/Storages/MergeTree/DataPartStorageOnDiskBase.cpp:54:65 (clickhouse+0x19cefaeb)
#7 DB::StorageSystemParts::processNextStorage(std::__1::shared_ptr<DB::Context const>, std::__1::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn>>>&, std::__1::vector<char8_t, std::__1::allocator<char8_t>>&, DB::StoragesInfo const&, bool) build_docker/./src/Storages/System/StorageSystemParts.cpp:243:73 (clickhouse+0x15a9dee5) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#8 DB::ReadFromSystemPartsBase::initializePipeline(DB::QueryPipelineBuilder&, DB::BuildQueryPipelineSettings const&) build_docker/./src/Storages/System/StorageSystemPartsBase.cpp:337:18 (clickhouse+0x15aa82e4) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#9 DB::ISourceStep::updatePipeline(std::__1::vector<std::__1::unique_ptr<DB::QueryPipelineBuilder, std::__1::default_delete<DB::QueryPipelineBuilder>>, std::__1::allocator<std::__1::unique_ptr<DB::QueryPipelineBuilder, std::__1::default_delete<DB::QueryPipelineBuilder>>>>, DB::BuildQueryPipelineSettings const&) build_docker/./src/Processors/QueryPlan/ISourceStep.cpp:20:5 (clickhouse+0x1adbca62) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#10 DB::QueryPlan::buildQueryPipeline(DB::QueryPlanOptimizationSettings const&, DB::BuildQueryPipelineSettings const&) build_docker/./src/Processors/QueryPlan/QueryPlan.cpp:188:47 (clickhouse+0x1ade79db) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#11 DB::InterpreterSelectQueryAnalyzer::buildQueryPipeline() build_docker/./src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:261:34 (clickhouse+0x182027d6) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#12 DB::InterpreterSelectQueryAnalyzer::execute() build_docker/./src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:228:29 (clickhouse+0x1820242f) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#13 DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) build_docker/./src/Interpreters/executeQuery.cpp:1346:40 (clickhouse+0x1865e76d) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#14 DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) build_docker/./src/Interpreters/executeQuery.cpp:1513:26 (clickhouse+0x18659917) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#15 DB::TCPHandler::runImpl() build_docker/./src/Server/TCPHandler.cpp:593:54 (clickhouse+0x1a6846b6) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#16 DB::TCPHandler::run() build_docker/./src/Server/TCPHandler.cpp:2526:9 (clickhouse+0x1a6a2be7) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#17 Poco::Net::TCPServerConnection::start() build_docker/./base/poco/Net/src/TCPServerConnection.cpp:43:3 (clickhouse+0x1ec39a62) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#18 Poco::Net::TCPServerDispatcher::run() build_docker/./base/poco/Net/src/TCPServerDispatcher.cpp:115:38 (clickhouse+0x1ec3a2d1) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#19 Poco::PooledThread::run() build_docker/./base/poco/Foundation/src/ThreadPool.cpp:205:14 (clickhouse+0x1ebb2f42) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#20 Poco::(anonymous namespace)::RunnableHolder::run() build_docker/./base/poco/Foundation/src/Thread.cpp:45:11 (clickhouse+0x1ebb120f) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
#21 Poco::ThreadImpl::runnableEntry(void*) build_docker/./base/poco/Foundation/src/Thread_POSIX.cpp:335:27 (clickhouse+0x1ebaf6e9) (BuildId: e775ea996e9cd3fb7a932f266b992ad5f20c5e3d)
Tsan report:
Thread which deleted part:
Unforutnately cannot find thread which read this
system.parts
. But it was inserted properly:I didn't understand how is it possible, we have proper check in
system.parts
: https://github.com/ClickHouse/clickhouse/blob/master/src/Storages/System/StorageSystemParts.cpp#L239-L241 and when we grap parts to remove we check shared pointer uniqueness: https://github.com/ClickHouse/clickhouse/blob/master/src/Storages/MergeTree/MergeTreeData.cpp#L2472-L2476. And all this happen with data parts lock (exclusively).