Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/9749 )
Change subject: IMPALA-6694: fix "buffer pool" child profile order ...................................................................... Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/9749/1/be/src/util/runtime-profile.cc File be/src/util/runtime-profile.cc: http://gerrit.cloudera.org:8080/#/c/9749/1/be/src/util/runtime-profile.cc@359 PS1, Line 359: while (insert_pos != children_.end() && !found_child) { : found_child = insert_pos->first == child; : ++insert_pos; : } > Is it fair to expect that children_ here should end up having the same numb It should have node.num_children entries unless the source profile had some entries removed (which isn't an operation this is allowed). I don't think that invariant is generally true. If the relative order of the child profiles is changed (e.g. by calling SortChildren()) then it can be violated If first we have children A, B, C in that order in the initial update and then the order is changed, it's violated. Update([A, B, C]) -> children_ = [A, B, C] Update(B, A, D, C) -> children_ = [A, B, C, D] That happens because A and B are out of order, and the searching forward skips over A when looking for B then skips over C when looking for A, which means that D is inserted at i = 3 instead of i=2. -- To view, visit http://gerrit.cloudera.org:8080/9749 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I230f0673edf20a846fdb13191b7a292d329c1bb8 Gerrit-Change-Number: 9749 Gerrit-PatchSet: 1 Gerrit-Owner: Tim Armstrong <[email protected]> Gerrit-Reviewer: Michael Ho <[email protected]> Gerrit-Reviewer: Tim Armstrong <[email protected]> Gerrit-Comment-Date: Sat, 24 Mar 2018 00:41:35 +0000 Gerrit-HasComments: Yes
