Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/11923 )
Change subject: [location_awareness] Register client with location when connect to cluster ...................................................................... Patch Set 6: (4 comments) http://gerrit.cloudera.org:8080/#/c/11923/6/src/kudu/master/master-test.cc File src/kudu/master/master-test.cc: http://gerrit.cloudera.org:8080/#/c/11923/6/src/kudu/master/master-test.cc@1626 PS6, Line 1626: TestConnectToMasterRegisterLocation It would be nice to have a scenario to verify how the system behaves in case if the location-assignment command returns an error. http://gerrit.cloudera.org:8080/#/c/11923/6/src/kudu/master/master_service.cc File src/kudu/master/master_service.cc: http://gerrit.cloudera.org:8080/#/c/11923/6/src/kudu/master/master_service.cc@536 PS6, Line 536: resp->set_client_location(location); generic/paranoid nit: if GetClientLocation() didn't return Status::OK(), I think we should not try to set the location field in the response. I think that's one of the best practices if you think of the GetClientLocation() as a black box and don't have an assurance that the 'location' out argument is not touched in case of non-OK return code from the function. http://gerrit.cloudera.org:8080/#/c/11923/6/src/kudu/master/ts_descriptor.cc File src/kudu/master/ts_descriptor.cc: http://gerrit.cloudera.org:8080/#/c/11923/6/src/kudu/master/ts_descriptor.cc@410 PS6, Line 410: if (!location_mapping_cmd.empty()) { style code/readability nit: prefer the 'return early' style here, i.e. if (location_mapping_cmd.empty()) { return Status::OK(); } // Continue with the logic specific to the process of running the location command ... You can get more details about this at: https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code http://gerrit.cloudera.org:8080/#/c/11923/6/src/kudu/master/ts_descriptor.cc@415 PS6, Line 415: if (s.ok()) { : *location = std::move(location_temp); : } else { : KLOG_EVERY_N_SECS(ERROR, 60) << Substitute( : "Unable to assign location to client: $0", : registration.rpc_addresses(0).host()); : return s; : } the same style nit: prefer the 'return early' style -- To view, visit http://gerrit.cloudera.org:8080/11923 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0efb327293d86168a30b05305f69d011ad15587a Gerrit-Change-Number: 11923 Gerrit-PatchSet: 6 Gerrit-Owner: Fengling Wang <fw...@cloudera.com> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Fengling Wang <fw...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Will Berkeley <wdberke...@gmail.com> Gerrit-Comment-Date: Tue, 20 Nov 2018 21:19:00 +0000 Gerrit-HasComments: Yes