Hello Mike Percy,

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

    http://gerrit.cloudera.org:8080/8615

to review the following change.


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
---
M src/kudu/consensus/consensus_peers.cc
M src/kudu/consensus/raft_consensus.cc
2 files changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/15/8615/1
--
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: newchange
Gerrit-Change-Id: I93d232c3a65502bf5120f955cbedc4d1e5f394da
Gerrit-Change-Number: 8615
Gerrit-PatchSet: 1
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Mike Percy <[email protected]>

Reply via email to