Jean-Daniel Cryans has submitted this change and it was merged.
Change subject: ts_itest-base.h: wait for bootstrapping to finish when waiting
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.
Tested-by: Adar Dembo <a...@cloudera.com>
Reviewed-by: Jean-Daniel Cryans
5 files changed, 50 insertions(+), 14 deletions(-)
Jean-Daniel Cryans: Looks good to me, approved
Adar Dembo: Verified
To view, visit http://gerrit.cloudera.org:8080/3308
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Owner: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Jean-Daniel Cryans
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>