[ 
https://issues.apache.org/jira/browse/IMPALA-14791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18062167#comment-18062167
 ] 

ASF subversion and git services commented on IMPALA-14791:
----------------------------------------------------------

Commit 6cec0bfe179162a0943108cc624ac74ce4b5fbaa in impala's branch 
refs/heads/master from Zoltan Borok-Nagy
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=6cec0bfe1 ]

IMPALA-14791: Fix crash in PlanToJson when sink was not executed

impala-http-handler.cc::SinkToJsonHelper had the assumption that we
always have a TPlanNodeExecSummary for the sink, but it is not true.
In some cases we don't have plan node exec summaries, e.g.:
* CTAS query failed to create the target table, so execution did not
  start
* Admission control rejected query execution

This patch set fixes SinkToJsonHelper to work well in case of missing
summaries.

Testing:
 * e2e added with failing CTAS
 * custom tests added with failing CTAS and INSERT due to admission
   control

Change-Id: I4fe6ed48d365a34380991f544e1ff628e95fa89e
Reviewed-on: http://gerrit.cloudera.org:8080/24050
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> PlanToJson can crash Impala if the query failed
> -----------------------------------------------
>
>                 Key: IMPALA-14791
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14791
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Zoltán Borók-Nagy
>            Assignee: Zoltán Borók-Nagy
>            Priority: Major
>
> Repro:
> {noformat}
> bin/impala-py.test 
> tests/custom_cluster/test_blacklisted_dbs_and_tables.py::TestBlacklistedDbsAndTables::test_inconsistent_blacklist
> {noformat}
> Then on the web ui: /Queries => Click on query ID of "create table 
> functional.alltypes as select 1"
> Stack trace:
> {noformat}
> #0  0x0000731c9b0969fc in pthread_kill () from /lib/x86_64-linux-gnu/libc.so.6
> #1  0x0000731c9b042476 in raise () from /lib/x86_64-linux-gnu/libc.so.6
> #2  0x0000731c9b0287f3 in abort () from /lib/x86_64-linux-gnu/libc.so.6
> #3  0x0000000002745c99 in google::DumpStackTraceAndExit () at 
> /mnt/source/glog/glog-0.6.0-p2/src/utilities.cc:178
> #4  0x00000000061f2c2d in google::LogMessage::Fail () at 
> /mnt/source/glog/glog-0.6.0-p2/src/logging.cc:1968
> #5  0x00000000061f61c5 in google::LogMessage::SendToLog (this=0x731a8dfee460) 
> at /mnt/source/glog/glog-0.6.0-p2/src/logging.cc:1942
> #6  0x00000000061f263b in google::LogMessage::Flush (this=0x731a8dfee460) at 
> /mnt/source/glog/glog-0.6.0-p2/src/logging.cc:1799
> #7  0x00000000061f3bf9 in google::LogMessageFatal::~LogMessageFatal 
> (this=<optimized out>, __in_chrg=<optimized out>) at 
> /mnt/source/glog/glog-0.6.0-p2/src/logging.cc:2579
> #8  0x000000000324a948 in (anonymous namespace)::SinkToJsonHelper (sink=..., 
> summaries=..., it=0x731a8dfee558, document=0x731a8dfef290, 
> value=0x731a8dfee560) at 
> /home/boroknagyz/Impala/be/src/service/impala-http-handler.cc:1188
> #9  0x000000000324ae5d in impala::PlanToJson (fragments=..., summary=..., 
> document=0x731a8dfef290, value=0x731a8dfee7e0) at 
> /home/boroknagyz/Impala/be/src/service/impala-http-handler.cc:1229
> #10 0x000000000324c95b in impala::ImpalaHttpHandler::QuerySummaryHandler 
> (this=0x3a400740, include_json_plan=true, include_summary=true, req=..., 
> document=0x731a8dfef290) at 
> /home/boroknagyz/Impala/be/src/service/impala-http-handler.cc:1378
> #11 0x0000000003252c43 in operator()<kudu::WebCallbackRegistry::WebRequest, 
> rapidjson::GenericDocument<rapidjson::UTF8<> > >(const 
> kudu::WebCallbackRegistry::WebRequest &, 
> rapidjson::GenericDocument<rapidjson::UTF8<char>, 
> rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, 
> rapidjson::CrtAllocator> *) const (__closure=0x3933f020, req=..., 
> doc=0x731a8dfef290) at 
> /home/boroknagyz/Impala/be/src/service/impala-http-handler.cc:188
> #12 0x0000000003252c79 in 
> boost::detail::function::void_function_obj_invoker2<impala::ImpalaHttpHandler::RegisterHandlers(impala::Webserver*,
>  bool)::<lambda(const auto:31&, auto:32*)>, void, const 
> kudu::WebCallbackRegistry::WebRequest&, 
> rapidjson::GenericDocument<rapidjson::UTF8<char>, 
> rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, 
> rapidjson::CrtAllocator>*>::invoke(boost::detail::function::function_buffer 
> &, const kudu::WebCallbackRegistry::WebRequest &, 
> rapidjson::GenericDocument<rapidjson::UTF8<char>, 
> rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, 
> rapidjson::CrtAllocator> *) (function_obj_ptr=..., a0=..., a1=0x731a8dfef290)
>     at 
> /home/boroknagyz/Impala/toolchain/toolchain-packages-gcc10.4.0/boost-1.74.0-p1/include/boost/function/function_template.hpp:158
> #13 0x000000000366d790 in boost::function2<void, 
> kudu::WebCallbackRegistry::WebRequest const&, 
> rapidjson::GenericDocument<rapidjson::UTF8<char>, 
> rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>, 
> rapidjson::CrtAllocator>*>::operator() (
>     this=0x3933f018, a0=..., a1=0x731a8dfef290) at 
> /home/boroknagyz/Impala/toolchain/toolchain-packages-gcc10.4.0/boost-1.74.0-p1/include/boost/function/function_template.hpp:763
> #14 0x0000000003669acb in impala::Webserver::RenderUrlWithTemplate 
> (this=0x367f9180, connection=0x3976b000, req=..., url_handler=..., 
> output=0x731a8dff1620, content_type=0x731a8dff17d8, csrf_token=...)
>     at /home/boroknagyz/Impala/be/src/util/webserver.cc:1271
> #15 0x0000000003666fa1 in impala::Webserver::BeginRequestCallback 
> (this=0x367f9180, connection=0x3976b000, request_info=0x3976b000) at 
> /home/boroknagyz/Impala/be/src/util/webserver.cc:1059
> #16 0x0000000003664b2f in impala::Webserver::BeginRequestCallbackStatic 
> (connection=0x3976b000) at 
> /home/boroknagyz/Impala/be/src/util/webserver.cc:733
> #17 0x000000000367e525 in handle_request ()
> #18 0x00000000036808a3 in process_new_connection ()
> #19 0x0000000003680f73 in worker_thread ()
> {noformat}
> DCHECK hit:
> {noformat}
> DCHECK(summary_it != summaries.end());
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to