Alexey Serbin has posted comments on this change.

Change subject: [consensus_queue] fix race in UpdateLagMetrics()
......................................................................


Patch Set 1:

(1 comment)

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

Line 603:   std::lock_guard<simple_spinlock> l(queue_lock_);
> I think this is OK, but just to confirm... this is called from RaftConsensu
I took a look at the places where 
PeerMessageQueue::UpdateLastIndexAppendedToLeader() is called and I didn't find 
any suspicious places.  Actually, the only non-test place it's called is in 
RaftConsensus::UpdateReplica().  I also found that many methods like 
RaftConsensus::XxxUnlocked() call Queue methods which take the same lock, so I 
think it should be fine.

Otherwise, I was thinking, would use atomic instead.

I also ran consensus-related tests in many iterations via dist-test, and no 
issues were reported (at least in DEBUG build).


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I25feb676619cc1f3a94fb8e631bffd8ca02ead49
Gerrit-PatchSet: 1
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: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <[email protected]>
Gerrit-HasComments: Yes

Reply via email to