David Ribeiro Alves has posted comments on this change. Change subject: WIP KUDU-1330: Add a tool to unsafely recover from loss of majority replicas ......................................................................
Patch Set 1: (1 comment) http://gerrit.cloudera.org:8080/#/c/6066/1/src/kudu/consensus/raft_consensus.cc File src/kudu/consensus/raft_consensus.cc: PS1, Line 1556: RaftConsensus::ReplaceConfig I'll let mike address the pending/active config concerns of this method, since he understands them better. In general I do think that this should have some pre-checks to reduce the possibility that users mess up a cluster. We could check that there are pending messages and that there is no progress in consensus for a while, for one. This can be a big number (an admin is unlikely to use the tool to fix a tablet if it got stuck 10 secs ago). Regarding the arguments maybe this method shouldn't be so general. Maybe it should accept instead a list of uuids to remove from the config (since it's only going to be used for that purpose) and make sure that those uuids are indeed part of the current config (to make sure the user didn't send this command to the wrong tablet, for instance). Regarding the method itself, I think this needs a refactoring to make sure that when you generate the request you generate one that is consistent. Specifically I think you need to get a snapshot of the relevant state for your request (i.e. obtain a lock and get: last op id, current term, committed config and timestamp for the new message). then release lock to build the new config request with the info from the snapshot and then call update. This will make sure that there are no inconsistencies on the core params of the request. -- To view, visit http://gerrit.cloudera.org:8080/6066 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I908d8c981df74d56dbd034e72001d379fb314700 Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Dinesh Bhat <din...@cloudera.com> Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Tidy Bot Gerrit-HasComments: Yes