Hello Todd Lipcon,

I'd like you to do a code review.  Please visit


to review the following change.

Change subject: ts_itest-base.h: wait for bootstrapping to finish when waiting 
for replicas

ts_itest-base.h: wait for bootstrapping to finish when waiting for replicas

WaitForReplicasAndUpdateLocations() is called by many itests during test
setup. The context is almost always the same:
1. Start a mini cluster, waiting for all tservers to heartbeat.
2. Create a client.
3. Create a table using the client, waiting for table creation to finish.
4. Using WaitForReplicasAndUpdateLocations(), create a tablet to tserver
   multimap via direct GetTableLocations() RPCs.
5. Send RPCs directly to specific tablets using the map built in step 4.

Today's implementation of GetTableLocations() also guarantees that step #4
only completes when all replicas have finished bootstrapping. I have a patch
outstanding that removes that guarantee. Why? Because it's not terribly
useful outside of testing (a tserver can restart at any time, so clients
must always be prepared for TABLET_NOT_RUNNING responses) and because it
simplifies master state. To keep these itests working, we need to find
another way to provide the guarantee.

So here's the fix: use ExternalMiniCluster::WaitForTabletsRunning() to
ensure that all tablets on every server are actually running. But first we
must augment it to wait for a specific tablet count, otherwise it may return
despite a tserver working on a slow CreateTablet() RPC.

Change-Id: I116e0bd8ec9d7abbe830d1d0ea4e35465d990a28
M src/kudu/integration-tests/alter_table-randomized-test.cc
M src/kudu/integration-tests/external_mini_cluster.cc
M src/kudu/integration-tests/external_mini_cluster.h
M src/kudu/integration-tests/ts_itest-base.h
M src/kudu/integration-tests/ts_recovery-itest.cc
5 files changed, 52 insertions(+), 15 deletions(-)

  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/08/3308/1
To view, visit http://gerrit.cloudera.org:8080/3308
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I116e0bd8ec9d7abbe830d1d0ea4e35465d990a28
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to