impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philip Zeyliger (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5940: Avoid log spew by using Status::Expected.
Date Tue, 26 Sep 2017 23:03:55 GMT
Hello Alex Behm, Mostafa Mokhtar, 

I'd like you to reexamine a change. Please visit

to look at the new patch set (#2).

Change subject: IMPALA-5940: Avoid log spew by using Status::Expected.

IMPALA-5940: Avoid log spew by using Status::Expected.

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. Looking at log files from several active clusters, I identified a few
other cases where we could clean up log spew with the same (trivial)

The following messages will no longer log:

  "Failed to codegen MaterializeTuple() due to unsupported type: $0"
  "Not implemented for this format."
  "ScalarFnCall Codegen not supported for CHAR"
  "Could not codegen CodegenMaterializeExprs: "
  "Could not codegen TupleRowComparator::Compare(): $0"

These codegen related messages were happening at every execution node, and were
therefore very common.

In addition, the following messages, which were very frequent in the logs, now
will log, but without the back trace:

  "... Client ... timed-out during recv call."
  "Query Id ... not found."

To preserve the source of the messages, I used preprocessor macros __FILE__ and
__LINE__ and stuffed them into the error string. As you can see in the worked
example in the testing section below, __FILE__ includes the full source code
path, which is uglier than the logging equivalent. (glog has a helper
called "const_basename" which handles this at

The snippet I used to identify these was:

  find . -type f -name '*IMPALAD*.gz' | xargs gzcat  | awk '/^I/ { if(x) { print x; } x =
"" } / { x=" "; } { if(x) { x=x  $0 } }'  | sed -e 's/0x[0-9a-fx]* //g' | sed -e
's/[0-9a-f]\{16\}:[0-9a-f]*/QUERYID/g' |  tr -s '\t' ' ' | tr '[0-9]' 'N' | sort | uniq -c
 | sort -n | tee output.txt

I also analyzed some logs using SQL, against a pre-processed logs table:

  with v as (
    select regexp_replace(
          translate(substr(message, 42), "\n\t", "  "),
        "@.*$", "@@@...") as m
    from logs_table where `class`="")
  select m, count(*) from v group by 1 order by 2 desc limit 100

* Automated tests.
* Manual testing for one NoTrace code path:

  $ impala-python shell/gen-py/ImpalaService/ImpalaService-remote -h localhost:21000 GetRuntimeProfile
  Traceback (most recent call last):
    File "shell/gen-py/ImpalaService/ImpalaService-remote", line 106, in <module>
    File "/home/philip/src/impala/shell/gen-py/ImpalaService/", line 161,
in GetRuntimeProfile
      return self.recv_GetRuntimeProfile()
    File "/home/philip/src/impala/shell/gen-py/ImpalaService/", line 184,
in recv_GetRuntimeProfile
      raise result.error
  beeswaxd.ttypes.BeeswaxException: BeeswaxException(handle=QueryHandle(log_context='', id=''),
log_context='', SQLState='HY000', _message='GetRuntimeProfile error: /home/philip/src/impala/be/src/service/
Query id 0:0 not found.\n', errorCode=0)

  $ tail -n 1 logs/cluster/impalad.INFO
  I0926 14:51:19.867837 30582] /home/philip/src/impala/be/src/service/
Query id 0:0 not found.

Change-Id: I38088482377a1c3e794a9c8178ef83f29957a330
M be/src/common/
M be/src/common/status.h
M be/src/exec/
M be/src/exec/
M be/src/exprs/
M be/src/runtime/client-cache.h
M be/src/runtime/
M be/src/service/
M be/src/util/
9 files changed, 70 insertions(+), 27 deletions(-)

  git pull ssh:// refs/changes/00/8100/2
To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I38088482377a1c3e794a9c8178ef83f29957a330
Gerrit-Change-Number: 8100
Gerrit-PatchSet: 2
Gerrit-Owner: Philip Zeyliger <>
Gerrit-Reviewer: Alex Behm <>
Gerrit-Reviewer: Mostafa Mokhtar <>
Gerrit-Reviewer: Philip Zeyliger <>

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message