-
Type:
Sub-task
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.5.0
-
Fix Version/s: 3.5.0
-
Component/s: None
-
Labels:None
-
Hadoop Flags:Reviewed
-
Release Note:Awesome! thanks Hongchao! Committed to trunk
The findbugs complains about incrementing a volatile variable in AuthFastLeaderElection and FastLeaderElection:
volatile long logicalclock; /* Election instance */ ... logicalclock++;
Actually this is a bug. It should use AtomicLong here instead of volatile.
Leader.java and QuorumPeer.java and LearnerHandler.java:
volatile int tick;
I don't think it needs volatile here. The tick is incremented only in Leader.java:
synchronized (this) { ... if (!tickSkip) { self.tick++; } }
and it's protected by the synchronized statement. I just remove volatile keyword.