Message ID | 1583480926-99714-2-git-send-email-hzhou@ovn.org |
---|---|
State | Accepted |
Commit | cdae6100f89d04c5c29dc86a490b936a204622b7 |
Headers | show |
Series | None | expand |
On Thu, Mar 05, 2020 at 11:48:46PM -0800, Han Zhou wrote: > During election, there shouldn't be any leader. This change makes sure > that a server in candidate role always report leader as "unknown". > > Signed-off-by: Han Zhou <hzhou@ovn.org> Thanks for the patches. I applied them to master.
On Fri, Mar 6, 2020 at 2:39 PM Ben Pfaff <blp@ovn.org> wrote: > > On Thu, Mar 05, 2020 at 11:48:46PM -0800, Han Zhou wrote: > > During election, there shouldn't be any leader. This change makes sure > > that a server in candidate role always report leader as "unknown". > > > > Signed-off-by: Han Zhou <hzhou@ovn.org> > > Thanks for the patches. I applied them to master. Thanks Ben! Could you help backport these to branch-2.12 and 2.13?
On Fri, Mar 06, 2020 at 02:48:39PM -0800, Han Zhou wrote: > On Fri, Mar 6, 2020 at 2:39 PM Ben Pfaff <blp@ovn.org> wrote: > > > > On Thu, Mar 05, 2020 at 11:48:46PM -0800, Han Zhou wrote: > > > During election, there shouldn't be any leader. This change makes sure > > > that a server in candidate role always report leader as "unknown". > > > > > > Signed-off-by: Han Zhou <hzhou@ovn.org> > > > > Thanks for the patches. I applied them to master. > > Thanks Ben! Could you help backport these to branch-2.12 and 2.13? Done.
diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 2e1144c..1717ccc 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -1643,6 +1643,7 @@ raft_start_election(struct raft *raft, bool leadership_transfer) ovs_assert(raft->role != RAFT_LEADER); + raft->leader_sid = UUID_ZERO; raft->role = RAFT_CANDIDATE; /* If there was no leader elected since last election, we know we are * retrying now. */
During election, there shouldn't be any leader. This change makes sure that a server in candidate role always report leader as "unknown". Signed-off-by: Han Zhou <hzhou@ovn.org> --- ovsdb/raft.c | 1 + 1 file changed, 1 insertion(+)