[jira] [Commented] (IMPALA-10154) Data race on coord_backend_id
[ https://issues.apache.org/jira/browse/IMPALA-10154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17195810#comment-17195810 ] ASF subversion and git services commented on IMPALA-10154: -- Commit 01316ad1c9d3d20633ee429ef95f159d2778a747 in impala's branch refs/heads/master from wzhou-code [ https://gitbox.apache.org/repos/asf?p=impala.git;h=01316ad ] IMPALA-10154: Fix data race on coord_backend_id in TSAN build This issue was introduced by the patch for IMPALA-5746. QueryState::exec_rpc_params_.coord_backend_id is set in function QuestState::Init(), but it could be accessed by QueryExecMgr object in QueryExecMgr::CancelQueriesForFailedCoordinators() before or during QueryState::Init() is called, hence cause data race. To fix it, move coord_backend_id from class ExecQueryFInstancesRequestPB to class TQueryCtx. QueryState::query_ctx_ is a constant variable and is set in QueryState c'tor so that QueryState::query_ctx_.coord_backend_id is valid and will not be changed once the QuestState object is created. Testing: - Passed tests/custom_cluster/test_process_failures.py. - Passed the core tests for normal build. - Passed the core tests against a TSAN build. Change-Id: I1c4b51e741a28b80bf3485adff8c97aabe0a3f67 Reviewed-on: http://gerrit.cloudera.org:8080/16437 Reviewed-by: Impala Public Jenkins Tested-by: Impala Public Jenkins > Data race on coord_backend_id > - > > Key: IMPALA-10154 > URL: https://issues.apache.org/jira/browse/IMPALA-10154 > Project: IMPALA > Issue Type: Bug >Reporter: Sahil Takiar >Assignee: Wenzhe Zhou >Priority: Major > Fix For: Impala 4.0 > > > TSAN is reporting a data race on > {{ExecQueryFInstancesRequestPB#coord_backend_id}} > {code:java} > WARNING: ThreadSanitizer: data race (pid=15392) > Write of size 8 at 0x7b74001104a8 by thread T83 (mutexes: write > M871582266043729400): > #0 impala::ExecQueryFInstancesRequestPB::mutable_coord_backend_id() > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/generated-sources/gen-cpp/control_service.pb.h:6625:23 > (impalad+0x20c03ed) > #1 impala::QueryState::Init(impala::ExecQueryFInstancesRequestPB const*, > impala::TExecPlanFragmentInfo const&) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/runtime/query-state.cc:216:21 > (impalad+0x20b8b29) > #2 impala::QueryExecMgr::StartQuery(impala::ExecQueryFInstancesRequestPB > const*, impala::TQueryCtx const&, impala::TExecPlanFragmentInfo const&) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/runtime/query-exec-mgr.cc:80:23 > (impalad+0x20acb59) > #3 > impala::ControlService::ExecQueryFInstances(impala::ExecQueryFInstancesRequestPB > const*, impala::ExecQueryFInstancesResponsePB*, kudu::rpc::RpcContext*) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/service/control-service.cc:157:66 > (impalad+0x22a621d) > #4 > impala::ControlServiceIf::ControlServiceIf(scoped_refptr > const&, scoped_refptr > const&)::$_1::operator()(google::protobuf::Message const*, > google::protobuf::Message*, kudu::rpc::RpcContext*) const > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/generated-sources/gen-cpp/control_service.service.cc:70:13 > (impalad+0x23622a4) > #5 std::_Function_handler google::protobuf::Message*, kudu::rpc::RpcContext*), > impala::ControlServiceIf::ControlServiceIf(scoped_refptr > const&, scoped_refptr > const&)::$_1>::_M_invoke(std::_Any_data const&, google::protobuf::Message > const*&&, google::protobuf::Message*&&, kudu::rpc::RpcContext*&&) > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/gcc-7.5.0/lib/gcc/x86_64-pc-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:316:2 > (impalad+0x23620ed) > #6 std::function google::protobuf::Message*, > kudu::rpc::RpcContext*)>::operator()(google::protobuf::Message const*, > google::protobuf::Message*, kudu::rpc::RpcContext*) const > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/gcc-7.5.0/lib/gcc/x86_64-pc-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:706:14 > (impalad+0x2a4a453) > #7 kudu::rpc::GeneratedServiceIf::Handle(kudu::rpc::InboundCall*) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/kudu/rpc/service_if.cc:139:3 > (impalad+0x2a49efe) > #8 impala::ImpalaServicePool::RunThread() > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/rpc/impala-service-pool.cc:272:15 > (impalad+0x2011a12) > #9 boost::_mfi::mf0 impala::ImpalaServicePool>::operator()(impala::ImpalaServicePool*) const >
[jira] [Commented] (IMPALA-10154) Data race on coord_backend_id
[ https://issues.apache.org/jira/browse/IMPALA-10154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17192308#comment-17192308 ] Sahil Takiar commented on IMPALA-10154: --- This looks related to IMPALA-5746, so assigning to [~wzhou]. > Data race on coord_backend_id > - > > Key: IMPALA-10154 > URL: https://issues.apache.org/jira/browse/IMPALA-10154 > Project: IMPALA > Issue Type: Bug >Reporter: Sahil Takiar >Assignee: Wenzhe Zhou >Priority: Major > > TSAN is reporting a data race on > {{ExecQueryFInstancesRequestPB#coord_backend_id}} > {code:java} > WARNING: ThreadSanitizer: data race (pid=15392) > Write of size 8 at 0x7b74001104a8 by thread T83 (mutexes: write > M871582266043729400): > #0 impala::ExecQueryFInstancesRequestPB::mutable_coord_backend_id() > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/generated-sources/gen-cpp/control_service.pb.h:6625:23 > (impalad+0x20c03ed) > #1 impala::QueryState::Init(impala::ExecQueryFInstancesRequestPB const*, > impala::TExecPlanFragmentInfo const&) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/runtime/query-state.cc:216:21 > (impalad+0x20b8b29) > #2 impala::QueryExecMgr::StartQuery(impala::ExecQueryFInstancesRequestPB > const*, impala::TQueryCtx const&, impala::TExecPlanFragmentInfo const&) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/runtime/query-exec-mgr.cc:80:23 > (impalad+0x20acb59) > #3 > impala::ControlService::ExecQueryFInstances(impala::ExecQueryFInstancesRequestPB > const*, impala::ExecQueryFInstancesResponsePB*, kudu::rpc::RpcContext*) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/service/control-service.cc:157:66 > (impalad+0x22a621d) > #4 > impala::ControlServiceIf::ControlServiceIf(scoped_refptr > const&, scoped_refptr > const&)::$_1::operator()(google::protobuf::Message const*, > google::protobuf::Message*, kudu::rpc::RpcContext*) const > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/generated-sources/gen-cpp/control_service.service.cc:70:13 > (impalad+0x23622a4) > #5 std::_Function_handler google::protobuf::Message*, kudu::rpc::RpcContext*), > impala::ControlServiceIf::ControlServiceIf(scoped_refptr > const&, scoped_refptr > const&)::$_1>::_M_invoke(std::_Any_data const&, google::protobuf::Message > const*&&, google::protobuf::Message*&&, kudu::rpc::RpcContext*&&) > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/gcc-7.5.0/lib/gcc/x86_64-pc-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:316:2 > (impalad+0x23620ed) > #6 std::function google::protobuf::Message*, > kudu::rpc::RpcContext*)>::operator()(google::protobuf::Message const*, > google::protobuf::Message*, kudu::rpc::RpcContext*) const > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/gcc-7.5.0/lib/gcc/x86_64-pc-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/std_function.h:706:14 > (impalad+0x2a4a453) > #7 kudu::rpc::GeneratedServiceIf::Handle(kudu::rpc::InboundCall*) > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/kudu/rpc/service_if.cc:139:3 > (impalad+0x2a49efe) > #8 impala::ImpalaServicePool::RunThread() > /data/jenkins/workspace/impala-private-parameterized/repos/Impala/be/src/rpc/impala-service-pool.cc:272:15 > (impalad+0x2011a12) > #9 boost::_mfi::mf0 impala::ImpalaServicePool>::operator()(impala::ImpalaServicePool*) const > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/boost-1.61.0-p2/include/boost/bind/mem_fn_template.hpp:49:29 > (impalad+0x2017a16) > #10 void boost::_bi::list1 > >::operator(), > boost::_bi::list0>(boost::_bi::type, boost::_mfi::mf0 impala::ImpalaServicePool>&, boost::_bi::list0&, int) > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/boost-1.61.0-p2/include/boost/bind/bind.hpp:259:9 > (impalad+0x201796a) > #11 boost::_bi::bind_t impala::ImpalaServicePool>, > boost::_bi::list1 > > >::operator()() > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/boost-1.61.0-p2/include/boost/bind/bind.hpp:1222:16 > (impalad+0x20178f3) > #12 > boost::detail::function::void_function_obj_invoker0 boost::_mfi::mf0, > boost::_bi::list1 > >, > void>::invoke(boost::detail::function::function_buffer&) > /data/jenkins/workspace/impala-private-parameterized/Impala-Toolchain/toolchain-packages-gcc7.5.0/boost-1.61.0-p2/include/boost/function/function_template.hpp:159:11 > (impalad+0x20176e9) > #13 boost::function0::operator()() const >