Alexey Serbin has submitted this change and it was merged.

Change subject: [mini_cluster] fix crash in GetLeaderMasterIndex()
......................................................................


[mini_cluster] fix crash in GetLeaderMasterIndex()

If at least one of the mini-masters is shutdown by explicit call
of the MiniMaster::Shutdown() method, the subsequent call of
MiniCluster::GetLeaderMasterIndex() crashes while trying to access
the underlying Master object.  That's because the shared_ptr wrapper
has been reset by prior call of the MiniMaster::Shutdown() call.

This patch adds a check for the presence of the Master object in the
wrapper prior to call of Master::Shutdown().

Besides, added a way to specify no placeholder for the
index parameter for MiniCluster::GetLeaderMasterIndex().  That's
for the use case when it's necessary to wait for the master
to be established in the mini-cluster with no intent to get its index.

Change-Id: Icbb64ee44e22b5f32a2351e0e1289826a8485c84
Reviewed-on: http://gerrit.cloudera.org:8080/5870
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Alexey Serbin <[email protected]>
---
M src/kudu/integration-tests/mini_cluster.cc
M src/kudu/integration-tests/mini_cluster.h
M src/kudu/master/mini_master.h
3 files changed, 16 insertions(+), 6 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Alexey Serbin: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/5870
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icbb64ee44e22b5f32a2351e0e1289826a8485c84
Gerrit-PatchSet: 4
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to