Todd Lipcon has posted comments on this change. ( http://gerrit.cloudera.org:8080/13178 )
Change subject: IMPALA-4658: Potential race if compiler reorders ReachedLimit() usage. ...................................................................... Patch Set 2: (2 comments) http://gerrit.cloudera.org:8080/#/c/13178/2/be/src/exec/exec-node.h File be/src/exec/exec-node.h: http://gerrit.cloudera.org:8080/#/c/13178/2/be/src/exec/exec-node.h@390 PS2, Line 390: int64_t num_rows_returned_; might be worth using a DFAKE_SCOPED_LOCK_THREAD_LOCKED from gutil/threading/thread_collision_warner.h on the write path to the non-shared variant which would ensure in debug builds that only a single thread ever modifies this value http://gerrit.cloudera.org:8080/#/c/13178/2/be/src/exec/exec-node.h@391 PS2, Line 391: AtomicInt64 num_rows_returned_shared_; > It's a bit of a matter of taste but I think it would be better to just have agreed, I find it very confusing to have two separate variables here, unless the semantics are something like: - the "num_rows_returned_" is non-atomic and can only be modified by a special thread which is bound to this execnode (used by non-multi-threaded nodes) - the "_shared_" variant can be used by multi-threaded nodes - all readers should operate by loading both and adding the results together. in other words, having two separate write paths seems fine as long as there is a consolidated read path. Another option here is to use a striped counter (see LongAdder from kudu/util/striped64.h ) which might be fast enough to use multi-threaded. -- To view, visit http://gerrit.cloudera.org:8080/13178 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4cbbfad80f7ab87dd6f192a24e2c68f7c66b047e Gerrit-Change-Number: 13178 Gerrit-PatchSet: 2 Gerrit-Owner: Abhishek Rawat <ara...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-Comment-Date: Tue, 30 Apr 2019 21:18:13 +0000 Gerrit-HasComments: Yes