Hello Lars Volker, Philip Zeyliger, Tim Armstrong, Dan Hecht,

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

    http://gerrit.cloudera.org:8080/8621

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

Change subject: IMPALA-3703: Store query context in thread-local variables
......................................................................

IMPALA-3703: Store query context in thread-local variables

This commit introduces the InfoTable class which can hold
information about the current thread that can be useful
in debug sessions.
It needs to be allocated on the stack in order to include
it to minidumps.

Currently an InfoTable object is created in
Thread::SuperviseThread. This object is available in all
the child stack frames through the global function
GetThreadInfoTable().

InfoTable has members for the thread name, query id, and
instance id. These are fixed size char buffers.
InfoTable also has a member called text, which is a char buffer
that holds lines of strings. A line has a format of
<key> = <value>. New data can be appended to the buffer by
calling AddExtraInfo(key, value).

If you have a fully-fledged core file, you can locate the
InfoTable for the current thread through the global pointer
impala::thread_info_table.

In a core file that has been created from a minidump,
we need to select the stack frame that allocated the InfoTable
object in order to inspect it. It is currently allocated in
Thread::SuperviseThread().

We can use printf in gdb to print the members, e.g.:
printf "%s" thread_info_table.text
printf "%s\n" thread_info_table.query_id

Currently the thread category, thread name, query id, and
instance id is stored.

I created some tests in thread-info-test.cc

Change-Id: I566f7f1db5117c498e86e0bd05b33bdcff624609
---
M be/src/common/CMakeLists.txt
A be/src/common/thread-info-test.cc
A be/src/common/thread-info.cc
A be/src/common/thread-info.h
M be/src/exec/blocking-join-node.cc
M be/src/exec/hdfs-scan-node.cc
M be/src/runtime/fragment-instance-state.cc
M be/src/runtime/query-state.cc
M be/src/util/thread.cc
9 files changed, 322 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/21/8621/4
--
To view, visit http://gerrit.cloudera.org:8080/8621
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I566f7f1db5117c498e86e0bd05b33bdcff624609
Gerrit-Change-Number: 8621
Gerrit-PatchSet: 4
Gerrit-Owner: Zoltan Borok-Nagy <borokna...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com>
Gerrit-Reviewer: Lars Volker <l...@cloudera.com>
Gerrit-Reviewer: Philip Zeyliger <phi...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <borokna...@cloudera.com>

Reply via email to