Mike Percy has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/8615 )
Change subject: consensus: fix reporting of errors in CANNOT_PREPARE case ...................................................................... consensus: fix reporting of errors in CANNOT_PREPARE case This fixes the handling of CANNOT_PREPARE on the leader side to properly extract the correct error status from the response protobuf. A small typo resulted in calling StatusFromPB() on an uninitialized PB rather than on the actual place where the error was being set, causing a warning like: W1120 20:52:37.124464 38069 consensus_peers.cc:422] T 560e48bbfb8b4bcaad64f68af7a260d8 P f943a8757adf425f85915366458b0b7f -> Peer abc22956e2884b1db7baa1ca276a06f9 (127.36.112.129:42951): Couldn't send request to peer abc22956e2884b1db7baa1ca276a06f9 for tablet 560e48bbfb8b4bcaad64f68af7a260d8. Status: Runtime error: (unknown error code). Retrying in the next heartbeat period. Already tried 1 times. Now, it properly reports: W1120 20:55:46.801003 41186 consensus_peers.cc:422] T d076ba9e671843fc81080f39bdedc881 P 5c8b928b87c5450bb5e7486f1447a4eb -> Peer 02eeb46a805a4de282263fa9805cb25a (127.39.194.66:35783): Couldn't send request to peer 02eeb46a805a4de282263fa9805cb25a for tablet d076ba9e671843fc81080f39bdedc881. Status: Illegal state: Rejecting Update request from peer 5c8b928b87c5450bb5e7486f1447a4eb for term 1. Could not prepare a single transaction due to: Illegal state: Not initializing new transaction; the tablet is stopped. Retrying in the next heartbeat period. Already tried 9 times. Additionally, this improves the logging on the follower side to be slightly more clear about the CANNOT_PREPARE case. Change-Id: I93d232c3a65502bf5120f955cbedc4d1e5f394da Reviewed-on: http://gerrit.cloudera.org:8080/8615 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <[email protected]> --- M src/kudu/consensus/consensus_peers.cc M src/kudu/consensus/raft_consensus.cc 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Kudu Jenkins: Verified Mike Percy: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/8615 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I93d232c3a65502bf5120f955cbedc4d1e5f394da Gerrit-Change-Number: 8615 Gerrit-PatchSet: 2 Gerrit-Owner: Todd Lipcon <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]>
