Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/16194 )
Change subject: KUDU-2612 p6: add coordination calls to system client ...................................................................... Patch Set 3: (14 comments) http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/client/meta_cache.h File src/kudu/client/meta_cache.h: http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/client/meta_cache.h@104 PS3, Line 104: std::shared_ptr<tserver::TabletServerAdminServiceProxy> admin_proxy() const; This new method follows the suite established earlier by the proxy() method, but it seems to be not const-correct in the sense as referred at https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/const.md Maybe, remove the 'const' specified? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/client/meta_cache.cc File src/kudu/client/meta_cache.cc: http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/client/meta_cache.cc@207 PS3, Line 207: CHECK nit: switch to DCHECK()? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/integration-tests/txn_status_table-itest.cc File src/kudu/integration-tests/txn_status_table-itest.cc: http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/integration-tests/txn_status_table-itest.cc@162 PS3, Line 162: "user" nit: maybe, make this a constant (constexpr)? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/integration-tests/txn_status_table-itest.cc@177 PS3, Line 177: until it : // times out Is this actually verifiable by this test scenario? I.e., how to make sure the client did many retries until the timeout elapsed? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/integration-tests/txn_status_table-itest.cc@190 PS3, Line 190: "user" If looking at that as a black box, does it make sense to add a scenario with an attempt to begin a transaction with the same identifier, but different user name? Of that rather belongs to a unit test for TxnStatusTablet ? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/integration-tests/txn_status_table-itest.cc@231 PS3, Line 231: if (!tablets.empty()) { : return tablets[0]; : } Is there a requirement to have the same tablet identifier among the results? If so, maybe it's worth enforcing/validating that? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/integration-tests/txn_status_table-itest.cc@300 PS3, Line 300: ASSERT_OK(txn_sys_client_->CreateTxnStatusTable(100, 3)); : ASSERT_OK(txn_sys_client_->OpenTxnStatusTable()); : ASSERT_OK(txn_sys_client_->BeginTransaction(1, "user")); This looks like a pattern in all three tests scenarios. Maybe, represent this as some method or move into SetUp() ? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/integration-tests/txn_status_table-itest.cc@315 PS3, Line 315: } // namespace itest Does it make sense to add 'negative' cases to verify the timeout/deadline works as expected for BeginTransaction(), RegisterParticipant(), etc.? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/coordinator_rpc.h File src/kudu/transactions/coordinator_rpc.h: http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/coordinator_rpc.h@58 PS3, Line 58: std::unique_ptr<TxnStatusTabletContext> ctx Is it possible to allocate this on the stack and use move semantics when passing as an argument? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/coordinator_rpc.h@58 PS3, Line 58: CoordinatorRpc* Is it a requirement to return a raw pointer? If not, maybe consider returning std::unique_ptr<CoordinatorRpc> instead? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/coordinator_rpc.h@62 PS3, Line 62: virtual nit: why virtual is necessary here (the base class has virtual destructor already)? BTW, if this class isn't expected to be inherited from, maybe add 'final' to the class definition. http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/coordinator_rpc.cc File src/kudu/transactions/coordinator_rpc.cc: http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/coordinator_rpc.cc@104 PS3, Line 104: nit: the indent is one space off http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/txn_system_client.h File src/kudu/transactions/txn_system_client.h: http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/txn_system_client.h@79 PS3, Line 79: client::sp::shared_ptr<client::KuduTable> Given this interface is for internal consumption only and doesn't have the restriction to be compiled with old C++ compilers, maybe we can switch to std::shared_ptr here? Or the idea is to stay consistent with client::sp::shared_ptr facade? http://gerrit.cloudera.org:8080/#/c/16194/3/src/kudu/transactions/txn_system_client.h@85 PS3, Line 85: client::sp::shared_ptr<client::KuduClient> Ditto here w.r.t. std::shared_ptr -- To view, visit http://gerrit.cloudera.org:8080/16194 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I4126cb3dcf379b397f84578c2265dca3ece3d98c Gerrit-Change-Number: 16194 Gerrit-PatchSet: 3 Gerrit-Owner: Andrew Wong <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Thu, 23 Jul 2020 23:57:12 +0000 Gerrit-HasComments: Yes
