Abhishek Rawat has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/19087 )

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


Patch Set 4:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/19087/4/be/src/exec/topn-node.cc
File be/src/exec/topn-node.cc:

http://gerrit.cloudera.org:8080/#/c/19087/4/be/src/exec/topn-node.cc@701
PS4, Line 701:     for (auto& entry : partition_heaps_) {
Looking at the default destructor for TopNNode::Heap::~Heap(), it will do 
exactly what TopnNode::Heap::Close() is doing today
```
void TopNNode::Heap::Close() {
  priority_queue_.Clear();    <<< calls std::vector::clear
  overflowed_ties_.clear();   << std::vector::clear
}
```
https://github.com/apache/impala/blob/master/be/src/util/priority-queue.h#L82

So, I think it should be safe to remove the second loop here. As in case of an 
exception if rematerialized_heaps does cleanup (by calling default destructor) 
it should be same as the cleanup being done by TopnNode::Heap::Close()



--
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: comment
Gerrit-Change-Id: Iaf45b6ef777f68e1843c076a935e4189acc6990b
Gerrit-Change-Number: 19087
Gerrit-PatchSet: 4
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Comment-Date: Wed, 05 Oct 2022 04:23:02 +0000
Gerrit-HasComments: Yes

Reply via email to