Andrew Wong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/16974 )
Change subject: KUDU-2612: add a TxnSystemClient to the tservers ...................................................................... KUDU-2612: add a TxnSystemClient to the tservers This patch adds a TxnSystemClient that gets initialized asynchronously, attempting to connect to the masters in the background in a similar fashion to the Heartbeater threads. There is some intricacy in the initialization of the client to note. Namely, if trying to connect to a set of masters while none of the masters can be reached, the KuduClientBuilder will attempt to retry connecting to each master repeatedly. This is problematic, as several tserver tests do not spin up masters. So, taking a page out of the Heartbeater book, the initialization will first ping each master. As long as at least one of them can connect, the TxnSystemClient will then proceed to attempt to connect to the cluster. This patch focuses only on adding the client initialization logic to the tservers, ensuring that even without connecting to a cluster, tservers can successfully bootstrap. This client will be used in later patches to communicate between the TxnStatusManager and transaction participants. Also note the similarities between TxnManager initialization, which happens on masters in a single-threaded threadpool. I considered reusing the implementation for tservers, but opted not to given the TxnManager initialization fairly well embedded in master code and has some initialization pieces not needed by TxnStatusManagers and participants (e.g. tservers aren't in charge of creating the transaction status table). I left a TODO to refactor for code reuse. Change-Id: I33b5a2bb5c56ae4bb4b42069af5813e2780fc4bc Reviewed-on: http://gerrit.cloudera.org:8080/16974 Tested-by: Kudu Jenkins Reviewed-by: Alexey Serbin <[email protected]> --- M src/kudu/client/client-test.cc M src/kudu/integration-tests/location_assignment-itest.cc M src/kudu/integration-tests/txn_status_table-itest.cc M src/kudu/rpc/sasl_common.cc M src/kudu/transactions/CMakeLists.txt M src/kudu/transactions/txn_system_client.cc M src/kudu/transactions/txn_system_client.h M src/kudu/tserver/tablet_server.cc M src/kudu/tserver/tablet_server.h 9 files changed, 214 insertions(+), 2 deletions(-) Approvals: Kudu Jenkins: Verified Alexey Serbin: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/16974 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I33b5a2bb5c56ae4bb4b42069af5813e2780fc4bc Gerrit-Change-Number: 16974 Gerrit-PatchSet: 6 Gerrit-Owner: Andrew Wong <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120)
