Re: [ovs-discuss] OVN: ovn-sbctl backoff

2020-07-23 Thread Tony Liu
Appreciate it! You connected dots for me.

Tony


From: Han Zhou 
Sent: July 23, 2020 05:10 PM
To: Tony Liu 
Cc: Han Zhou ; ovs-discuss 
Subject: Re: [ovs-discuss] OVN: ovn-sbctl backoff



On Thu, Jul 23, 2020 at 4:34 PM 
mailto:tonyliu0...@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 mailto:hz...@ovn.org>> wrote:
>
>
>
> On Thu, Jul 23, 2020 at 4:07 PM 
> mailto:tonyliu0...@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: ,,...,. For 
> example: 
> tcp:10.0.0.2:6641<http://10.0.0.2:6641>,tcp:10.0.0.3:6641<http://10.0.0.3:6641>,tcp:10.0.0.4:6641<http://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 mailto:hz...@ovn.org>> 
> > wrote:
> >
> >
> >
> > On Thu, Jul 23, 2020 at 3:43 PM Tony Liu 
> > mailto:tonyliu0...@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
> >
> >
>
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVN: ovn-sbctl backoff

2020-07-23 Thread Han Zhou
On Thu, Jul 23, 2020 at 4:34 PM  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  wrote:
>
>
>
> On Thu, Jul 23, 2020 at 4:07 PM  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: ,,...,. 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  wrote:
> >
> >
> >
> > On Thu, Jul 23, 2020 at 3:43 PM Tony Liu 
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
> >
> >
>
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVN: ovn-sbctl backoff

2020-07-23 Thread tonyliu0592
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:)Thanks!TonyOn Jul 23, 2020 4:26 PM, Han Zhou  wrote:On Thu, Jul 23, 2020 at 4:07 PM  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: ,,...,. 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  wrote: On Thu, Jul 23, 2020 at 3:43 PM Tony Liu  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>>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVN: ovn-sbctl backoff

2020-07-23 Thread Han Zhou
On Thu, Jul 23, 2020 at 4:07 PM  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: ,,...,. 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  wrote:
>
>
>
> On Thu, Jul 23, 2020 at 3:43 PM Tony Liu  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
>
>
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVN: ovn-sbctl backoff

2020-07-23 Thread tonyliu0592
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?Thanks again!TonyOn Jul 23, 2020 3:57 PM, Han Zhou  wrote:On Thu, Jul 23, 2020 at 3:43 PM Tony Liu  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!>> TonyIf 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
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


Re: [ovs-discuss] OVN: ovn-sbctl backoff

2020-07-23 Thread Han Zhou
On Thu, Jul 23, 2020 at 3:43 PM Tony Liu  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
___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss


[ovs-discuss] OVN: ovn-sbctl backoff

2020-07-23 Thread Tony Liu
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

___
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss