Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.
On 19 September 2016 at 11:33, Ben Pfaff wrote:
> On Mon, Sep 19, 2016 at 11:18:20AM -0700, Guru Shetty wrote:
> > On 19 September 2016 at 11:08, Ben Pfaff wrote:
> >
> > > On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote:
> > > > Without initializing the databases, commands of the form
> > > > 'ovn-nbctl --wait=sb ls-add ls0' will simply hang.
> > > >
> > > > Signed-off-by: Gurucharan Shetty
> > >
> > > It's better if the separate initialization step is optional.
> >
> > We do this everytime for OVS in do_start_ovsdb of utilities/ovs-ctl.in
> with:
> > ovs_vsctl -- init -- set Open_vSwitch . db-version="$schemaver"
> >
> > Is there a subtlety here?
>
> Setting the db-version isn't something that happens automatically, but
> the ovs-vsctl "init" command is a no-op, literally an empty function,
> because do_vsctl() always does what it would do:
>
> ovs = ovsrec_open_vswitch_first(idl);
> if (!ovs) {
> /* XXX add verification that table is empty */
> ovs = ovsrec_open_vswitch_insert(txn);
> }
>
> So the first call to ovs-vsctl, regardless of what command it is, should
> initialize the database enough for everything else to work.
>
> It looks to me like ovn-sbctl and ovn-nbctl are the same way.
>
> (Don't get me wrong, I think it's better if the databases are
> initialized explicitly. But I also think it's nice if stuff doesn't
> hang if, for example, a database gets blanked out through data loss or
> admin mistake.)
>
> > > I think
> > > that ovn-nbctl and ovn-sbctl should be initializing the databases
> > > automatically when any command runs, if they are not already
> > > initialized; that's what ovs-vsctl does, at least. Is that missing?
> > >
> >
> > It does initialize when a command is run. But no-one runs ovn-sbctl
> > commands right (unless for debugging)?. So any ovn-nbctl command that is
> > run with --wait=sb will hang.
>
> I see.
>
> I think that we can make ovn-northd do the initialization too. It's
> pretty trivial: just create an {NB,SB}_Global record if there's none at
> the moment. Then if the databases get cleared, the system recovers.
>
> So: I think that we should initialize the databases, but I also think
> that ovn-northd should be capable of it too.
>
I think I understand what you are saying. I sent a v2 based on that.
> ___
> dev mailing list
> [email protected]
> http://openvswitch.org/mailman/listinfo/dev
>
___
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.
On Mon, Sep 19, 2016 at 11:18:20AM -0700, Guru Shetty wrote:
> On 19 September 2016 at 11:08, Ben Pfaff wrote:
>
> > On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote:
> > > Without initializing the databases, commands of the form
> > > 'ovn-nbctl --wait=sb ls-add ls0' will simply hang.
> > >
> > > Signed-off-by: Gurucharan Shetty
> >
> > It's better if the separate initialization step is optional.
>
> We do this everytime for OVS in do_start_ovsdb of utilities/ovs-ctl.in with:
> ovs_vsctl -- init -- set Open_vSwitch . db-version="$schemaver"
>
> Is there a subtlety here?
Setting the db-version isn't something that happens automatically, but
the ovs-vsctl "init" command is a no-op, literally an empty function,
because do_vsctl() always does what it would do:
ovs = ovsrec_open_vswitch_first(idl);
if (!ovs) {
/* XXX add verification that table is empty */
ovs = ovsrec_open_vswitch_insert(txn);
}
So the first call to ovs-vsctl, regardless of what command it is, should
initialize the database enough for everything else to work.
It looks to me like ovn-sbctl and ovn-nbctl are the same way.
(Don't get me wrong, I think it's better if the databases are
initialized explicitly. But I also think it's nice if stuff doesn't
hang if, for example, a database gets blanked out through data loss or
admin mistake.)
> > I think
> > that ovn-nbctl and ovn-sbctl should be initializing the databases
> > automatically when any command runs, if they are not already
> > initialized; that's what ovs-vsctl does, at least. Is that missing?
> >
>
> It does initialize when a command is run. But no-one runs ovn-sbctl
> commands right (unless for debugging)?. So any ovn-nbctl command that is
> run with --wait=sb will hang.
I see.
I think that we can make ovn-northd do the initialization too. It's
pretty trivial: just create an {NB,SB}_Global record if there's none at
the moment. Then if the databases get cleared, the system recovers.
So: I think that we should initialize the databases, but I also think
that ovn-northd should be capable of it too.
___
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.
On 19 September 2016 at 11:08, Ben Pfaff wrote: > On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote: > > Without initializing the databases, commands of the form > > 'ovn-nbctl --wait=sb ls-add ls0' will simply hang. > > > > Signed-off-by: Gurucharan Shetty > > It's better if the separate initialization step is optional. We do this everytime for OVS in do_start_ovsdb of utilities/ovs-ctl.in with: ovs_vsctl -- init -- set Open_vSwitch . db-version="$schemaver" Is there a subtlety here? > I think > that ovn-nbctl and ovn-sbctl should be initializing the databases > automatically when any command runs, if they are not already > initialized; that's what ovs-vsctl does, at least. Is that missing? > It does initialize when a command is run. But no-one runs ovn-sbctl commands right (unless for debugging)?. So any ovn-nbctl command that is run with --wait=sb will hang. ___ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
Re: [ovs-dev] [PATCH] ovn-ctl: Initialize the databases.
On Sun, Sep 18, 2016 at 11:26:52PM -0700, Gurucharan Shetty wrote: > Without initializing the databases, commands of the form > 'ovn-nbctl --wait=sb ls-add ls0' will simply hang. > > Signed-off-by: Gurucharan Shetty It's better if the separate initialization step is optional. I think that ovn-nbctl and ovn-sbctl should be initializing the databases automatically when any command runs, if they are not already initialized; that's what ovs-vsctl does, at least. Is that missing? ___ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
