Message ID | 20240315201614.236523-5-i.maximets@ovn.org |
---|---|
State | Superseded |
Headers | show |
Series | ovsdb: raft: Fixes for cluster joining state. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | success | github build: passed |
ovsrobot/intel-ovs-compilation | success | test: success |
On Fri, Mar 15, 2024 at 1:15 PM Ilya Maximets <i.maximets@ovn.org> wrote: > > Some of the failure tests can make a single-node cluster to > loose leadership. In this case the next raft_run() will > trigger election with a pre-vore enabled. This is causing s/pre-vore/pre-vote > an assertion when this server attempts to vote for itself. > > Fix that by not using pre-voting if the is only one server. s/the/there > > A new failure test introduced in later commit triggers this > assertion every time. > > Fixes: 85634fd58004 ("ovsdb: raft: Support pre-vote mechanism to deal with disruptive server.") > Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Thanks for the fix. Acked-by: Han Zhou <hzhou@ovn.org> > --- > ovsdb/raft.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ovsdb/raft.c b/ovsdb/raft.c > index 237d7ebf5..c41419052 100644 > --- a/ovsdb/raft.c > +++ b/ovsdb/raft.c > @@ -2083,7 +2083,7 @@ raft_run(struct raft *raft) > raft_start_election(raft, true, false); > } > } else { > - raft_start_election(raft, true, false); > + raft_start_election(raft, hmap_count(&raft->servers) > 1, false); > } > > } > -- > 2.43.0 >
diff --git a/ovsdb/raft.c b/ovsdb/raft.c index 237d7ebf5..c41419052 100644 --- a/ovsdb/raft.c +++ b/ovsdb/raft.c @@ -2083,7 +2083,7 @@ raft_run(struct raft *raft) raft_start_election(raft, true, false); } } else { - raft_start_election(raft, true, false); + raft_start_election(raft, hmap_count(&raft->servers) > 1, false); } }
Some of the failure tests can make a single-node cluster to loose leadership. In this case the next raft_run() will trigger election with a pre-vore enabled. This is causing an assertion when this server attempts to vote for itself. Fix that by not using pre-voting if the is only one server. A new failure test introduced in later commit triggers this assertion every time. Fixes: 85634fd58004 ("ovsdb: raft: Support pre-vote mechanism to deal with disruptive server.") Signed-off-by: Ilya Maximets <i.maximets@ovn.org> --- ovsdb/raft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)