Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DF305200D18 for ; Wed, 27 Sep 2017 01:04:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DD7C81609EA; Tue, 26 Sep 2017 23:04:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 07EBB1609D7 for ; Wed, 27 Sep 2017 01:04:02 +0200 (CEST) Received: (qmail 38987 invoked by uid 500); 26 Sep 2017 23:04:02 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 38971 invoked by uid 99); 26 Sep 2017 23:04:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 23:04:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 875FDC881A for ; Tue, 26 Sep 2017 23:04:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.612 X-Spam-Level: ** X-Spam-Status: No, score=2.612 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LOTSOFHASH=0.25, RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id BGj1RoaKPbjV for ; Tue, 26 Sep 2017 23:03:57 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 105C55F666 for ; Tue, 26 Sep 2017 23:03:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id v8QN3tVX013045; Tue, 26 Sep 2017 23:03:55 GMT Message-Id: <201709262303.v8QN3tVX013045@ip-10-146-233-104.ec2.internal> X-Gerrit-PatchSet: 2 Date: Tue, 26 Sep 2017 23:03:55 +0000 From: "Philip Zeyliger (Code Review)" To: Alex Behm , Mostafa Mokhtar , impala-cr@cloudera.com, reviews@impala.incubator.apache.org X-Gerrit-MessageType: newpatchset Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5940=3A_Avoid_log_spew_by_using_Status=3A=3AExpected=2E=0A?= X-Gerrit-Change-Id: I38088482377a1c3e794a9c8178ef83f29957a330 X-Gerrit-Change-Number: 8100 X-Gerrit-ChangeURL: X-Gerrit-Commit: c1e9117593e11402c43b585f9335a3d16d48921d In-Reply-To: References: Reply-To: philip@cloudera.com, impala-cr@cloudera.com, marcelk@gmail.com, mmokhtar@cloudera.com, alex.behm@cloudera.com, reviews@impala.incubator.apache.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.14.2 Content-Type: multipart/alternative; boundary="mTwxsUF60fM="; charset=UTF-8 archived-at: Tue, 26 Sep 2017 23:04:04 -0000 --mTwxsUF60fM= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Alex Behm, Mostafa Mokhtar, I'd like you to reexamine a change=2E P= lease visit http://gerrit=2Ecloudera=2Eorg:8080/8100 to look at the n= ew patch set (#2)=2E Change subject: IMPALA-5940: Avoid log spew by using = Status::Expected=2E =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E IMPALA-5940: Avoid log spew by using Status::Expected=2E In IMPALA= -5926, we fixed a case where closing the session triggered a stack trace in= the logs which impacted performance for short-running queries=2E Looking a= t log files from several active clusters, I identified a few other cases wh= ere we could clean up log spew with the same (trivial) approach=2E The fol= lowing messages will no longer log: "Failed to codegen MaterializeTuple(= ) due to unsupported type: $0" "Not implemented for this format=2E" "Sc= alarFnCall Codegen not supported for CHAR" "Could not codegen CodegenMate= rializeExprs: " "Could not codegen TupleRowComparator::Compare(): $0" Th= ese codegen related messages were happening at every execution node, and we= re therefore very common=2E In addition, the following messages, which wer= e very frequent in the logs, now will log, but without the back trace: "= =2E=2E=2E Client =2E=2E=2E timed-out during recv call=2E" "Query Id =2E= =2E=2E not found=2E" To preserve the source of the messages, I used prepro= cessor macros __FILE__ and __LINE__ and stuffed them into the error string= =2E As you can see in the worked example in the testing section below, __FI= LE__ includes the full source code path, which is uglier than the logging e= quivalent=2E (glog has a helper called "const_basename" which handles this = at https://github=2Ecom/google/glog/blob/2a6df66252d266080489c310b8146e63b6= 6b2add/src/utilities=2Ecc#L279) The snippet I used to identify these was: = find =2E -type f -name '*IMPALAD*=2Egz' | xargs gzcat | awk '/^I/ { if(= x) { print x; } x =3D "" } /status=2Ecc/ { x=3D" "; } { if(x) { x=3Dx $0 }= }' | sed -e 's/0x[0-9a-fx]* //g' | sed -e 's/[0-9a-f]\{16\}:[0-9a-f]*/QUE= RYID/g' | tr -s '\t' ' ' | tr '[0-9]' 'N' | sort | uniq -c | sort -n | te= e output=2Etxt I also analyzed some logs using SQL, against a pre-processe= d logs table: with v as ( select regexp_replace( regexp_repl= ace( translate(substr(message, 42), "\n\t", " "), "[a-= zA-Z0-9=2E-]*[=2E][a-zA-Z0-9-]*:[0-9]*", ""), "@=2E= *$", "@@@=2E=2E=2E") as m from logs_table where `class`=3D"status=2Ecc"= ) select m, count(*) from v group by 1 order by 2 desc limit 100 Testing= : * Automated tests=2E * Manual testing for one NoTrace code path: $ imp= ala-python shell/gen-py/ImpalaService/ImpalaService-remote -h localhost:210= 00 GetRuntimeProfile 'beeswaxd=2Ettypes=2EQueryHandle()' Traceback (most = recent call last): File "shell/gen-py/ImpalaService/ImpalaService-remot= e", line 106, in pp=2Epprint(client=2EGetRuntimeProfile(eval= (args[0]),)) File "/home/philip/src/impala/shell/gen-py/ImpalaService/I= mpalaService=2Epy", line 161, in GetRuntimeProfile return self=2Erecv= _GetRuntimeProfile() File "/home/philip/src/impala/shell/gen-py/ImpalaS= ervice/ImpalaService=2Epy", line 184, in recv_GetRuntimeProfile raise= result=2Eerror beeswaxd=2Ettypes=2EBeeswaxException: BeeswaxException(ha= ndle=3DQueryHandle(log_context=3D'', id=3D''), log_context=3D'', SQLState= =3D'HY000', _message=3D'GetRuntimeProfile error: /home/philip/src/impala/be= /src/service/impala-server=2Ecc:641: Query id 0:0 not found=2E\n', errorCod= e=3D0) $ tail -n 1 logs/cluster/impalad=2EINFO I0926 14:51:19=2E867837= 30582 status=2Ecc:147] /home/philip/src/impala/be/src/service/impala-serve= r=2Ecc:641: Query id 0:0 not found=2E Change-Id: I38088482377a1c3e794a9c81= 78ef83f29957a330 --- M be/src/common/status=2Ecc M be/src/common/status=2Eh= M be/src/exec/hdfs-avro-scanner=2Ecc M be/src/exec/hdfs-scan-node-base=2Ec= c M be/src/exprs/scalar-fn-call=2Ecc M be/src/runtime/client-cache=2Eh M be= /src/runtime/tuple=2Ecc M be/src/service/impala-server=2Ecc M be/src/util/t= uple-row-compare=2Ecc 9 files changed, 70 insertions(+), 27 deletions(-) = git pull ssh://gerrit=2Ecloudera=2Eorg:29418/Impala-ASF refs/changes/00/8= 100/2 -- To view, visit http://gerrit=2Ecloudera=2Eorg:8080/8100 To unsubs= cribe, visit http://gerrit=2Ecloudera=2Eorg:8080/settings Gerrit-Project: = Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Cha= nge-Id: I38088482377a1c3e794a9c8178ef83f29957a330 Gerrit-Change-Number: 810= 0 Gerrit-PatchSet: 2 Gerrit-Owner: Philip Zeyliger = Gerrit-Reviewer: Alex Behm Gerrit-Reviewer: Mo= stafa Mokhtar Gerrit-Reviewer: Philip Zeyliger --mTwxsUF60fM=--