Matthew Jacobs has posted comments on this change. Change subject: Clarify synchronization policy for 'done_' in KuduScanNode ......................................................................
Patch Set 1: (6 comments) http://gerrit.cloudera.org:8080/#/c/5494/1//COMMIT_MSG Commit Message: PS1, Line 9: calrify sp http://gerrit.cloudera.org:8080/#/c/5494/1/be/src/exec/kudu-scan-node.cc File be/src/exec/kudu-scan-node.cc: PS1, Line 202: materialized_row_batches_->Shutdown(); not really in scope for your change but it's confusing that we call Shutdown() from 3 different places. I think it might be possible for it to be called multiple times though I don't think it's an issue, just confusing. Maybe we can clean this up when we move this to MT. Line 217: unique_lock<mutex> lock(lock_); it would be handy for this to return null if done_. I don't think it's strictly necessary but it might get confusing right now where the caller in RunScannerThread ends up incrementing next_scan_token_idx_ unnecessarily, and there is some logic elsewhere which does check next_scan_token_idx_. PS1, Line 257: while (!done_) { Now that I look at this more, I think this is weird that we check_ done but still have this wrapped in a while(!eos) loop , so even after we find this is done_ we keep fetching rows until eos. Also, at that point we incr scan_ranges_complete_counter which isn't really accurate. I think it'd be better to have l253 check !eos && !done_ so that the outer while loop stops as well. PS1, Line 281: done_ please add a comment that even if this read conflicts with a write to done_, ProcessScanToken() will return early, GetNextScanToken() will not change the state of the token_idx/it will return null (per my comment on that fn), and then this while loop will exit. http://gerrit.cloudera.org:8080/#/c/5494/1/be/src/exec/kudu-scan-node.h File be/src/exec/kudu-scan-node.h: PS1, Line 96: For performance reasons, remove this, it makes it sound like the performance reason _is what makes it safe_. -- To view, visit http://gerrit.cloudera.org:8080/5494 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72c5f1fecf4bcf737d71a1fa13e59361604485f0 Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Sailesh Mukil <[email protected]> Gerrit-Reviewer: Lars Volker <[email protected]> Gerrit-Reviewer: Matthew Jacobs <[email protected]> Gerrit-HasComments: Yes
