[ovs-discuss] OVN: ovn-sbctl backoff

Han Zhou hzhou at ovn.org
Fri Jul 24 00:10:03 UTC 2020


On Thu, Jul 23, 2020 at 4:34 PM <tonyliu0592 at hotmail.com> wrote:
>
> Good to know! I recall I read somewhere saying only the leader takes
write request. I will double check!
>
> Well, in that case, I have another question, why is such leader role
required? In a quorum based cluster, all nodes are equal. And why does
ovn-northd have to connect to the leader?
> Guess I will need to read more about RAFT:)
>
Quick answer: only leader node does the actual write, aso all writes are
redirected to leader, but it can be initiated from followers. ovn-northd
connects to leader for better performance because it heavily writes.
The manpage does provide more details, and yes RAFT paper has even more.

>
> Thanks!
>
> Tony
>
> On Jul 23, 2020 4:26 PM, Han Zhou <hzhou at ovn.org> wrote:
>
>
>
> On Thu, Jul 23, 2020 at 4:07 PM <tonyliu0592 at hotmail.com> wrote:
> >
> > Thanks Han for the prompt responses!
> > That option is ok for reading. If I want to write, I have to connect to
the leader, right? Then my question remains, how does ovn-sbctl find out
how to connect to the leader?
> >
>
> RAFT doesn't require you to connect to leader for writing. You can
connect to any node and write.
> However, if for any reason you want to connect to the leader, you need to
specify the DB connection method as: <server1>,<server2>,...,<serverN>. For
example: tcp:10.0.0.2:6641,tcp:10.0.0.3:6641,tcp:10.0.0.4:6641.
> You can read more details about OVSDB clustering in manpage ovsdb(7).
>
> Thanks,
> Han
>
> > Thanks again!
> >
> > Tony
> >
> > On Jul 23, 2020 3:57 PM, Han Zhou <hzhou at ovn.org> wrote:
> >
> >
> >
> > On Thu, Jul 23, 2020 at 3:43 PM Tony Liu <tonyliu0592 at hotmail.com>
wrote:
> > >
> > > Hi,
> > >
> > > In case of ovsdb cluster, when I run ovn-sbctl, it connects to the
unix socket of local sb-db.
> > > If local sb-db is not the leader, ovn-sbctl tries another server to
look for the leader.
> > > How does ovn-sbctl connect to another server? By which connection?
> > > How does ovn-sbctl know the connection?
> > > Or the local sb-db asks to be the leader to respond ovn-sbctl?
> > > I can't figure out how it works from verbose messages.
> > > Any help to clarify is appreciated!
> > >
> > >
> > > Thanks!
> > >
> > > Tony
> >
> > If you don't intentionally try to connect to the leader, you can use
ovn-sbctl --no-leader-only ... to avoid the retry.
> > If you want to avoid typing this option every time, you can export
OVN_SBCTL_OPTIONS"="--no-leader-only", and then just run ovn-sbctl ...
> > (does this answer your question?)
> >
> > Thanks,
> > Han
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20200723/fba2cf21/attachment.html>


More information about the discuss mailing list