Yida Wu has uploaded a new patch set (#3). ( 
http://gerrit.cloudera.org:8080/19087 )

Change subject: IMPALA-11631 Fix impala crashes in 
impala::TopNNode::Heap::Close()
......................................................................

IMPALA-11631 Fix impala crashes in impala::TopNNode::Heap::Close()

The bug is introduced by IMPALA-9979, if RematerializeTuples()
fails in ReclaimTuplePool(), it returns immediately with an error,
however, some Heap unique_ptr in the partition_heaps_ could be
already moved to the rematerialized_heaps, while the Close() of
the TopNNode doesn't know which Heap unique_ptr is released in
partition_heaps_, still calls Close() on the released Heap
unique_ptr, which leads to a crash.

The patch changes the logic of moving each Heap object after
one rematerialize process succeeds, instead, we will move all the
Heap objects in the partition_heaps_ only when all the
rematerialize processes succeed. Therefore, there will be no half
released partition_heaps_.

Because it could be difficult for a testcase to inject an error
for this case to create a crash. I did some hacking in the
code to inject a memory allocation failure in certain cases,
reproduced the issue, and proved the patch can solve the issue
manually.

Tests:
Ran core tests.
Passed manual test.

Change-Id: Iaf45b6ef777f68e1843c076a935e4189acc6990b
---
M be/src/exec/topn-node.cc
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/87/19087/3
--
To view, visit http://gerrit.cloudera.org:8080/19087
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iaf45b6ef777f68e1843c076a935e4189acc6990b
Gerrit-Change-Number: 19087
Gerrit-PatchSet: 3
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>

Reply via email to