Alexey Serbin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/17236 )

Change subject: [consensus] small cleanup on consensus::Peer
......................................................................


Patch Set 1:

(1 comment)

Thank you for review!

http://gerrit.cloudera.org:8080/#/c/17236/1/src/kudu/consensus/consensus_peers.cc
File src/kudu/consensus/consensus_peers.cc:

http://gerrit.cloudera.org:8080/#/c/17236/1/src/kudu/consensus/consensus_peers.cc@276
PS1, Line 276:   if (!has_sent_first_request_) {
             :     // Set the 'immutable' fields in the request only once upon 
first request.
             :     request_.set_tablet_id(tablet_id_);
             :     request_.set_caller_uuid(leader_uuid_);
             :     request_.set_dest_uuid(peer_pb_.permanent_uuid());
             :     has_sent_first_request_ = true;
             :   }
> Just for my own understanding, it doesn't really matter when this gets set
Exactly -- it doesn't matter when exactly to set these fields as long this is 
done before the request is being sent, or logged, or otherwise used.

Also, since 'tablet_id_', 'leader_uuid_', 'peer_pb_.permanent_uuid()' are 
de-facto immutable fields in the whole lifespan of a Peer object, it's possible 
to set them just once instead of re-setting them over and over again.



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Iefce6791d12fbd126ee30104d1005209ad3de3ff
Gerrit-Change-Number: 17236
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Bankim Bhavsar <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Mon, 29 Mar 2021 23:48:14 +0000
Gerrit-HasComments: Yes

Reply via email to