[ovs-dev] [PATCH] vswitchd: Require "target" column to be unique in OVS database.

Saul St. John sstjohn at cs.wisc.edu
Tue Feb 12 18:01:04 UTC 2013


Previously, I was able to set setup multiple bridges on the same host to
talk to the same controller like this:

  # ovs-vsctl set-controller br0 tcp:10.0.0.1:6633
  # ovs-vsctl set-controller br1 tcp:10.0.0.1:6633

and it worked. Now, when I try to do that, I get this error:

  ovs-vsctl: transaction error: {"details":"Transaction causes multiple rows in 
  \"Controller\" table to have identical values (\"tcp:10.0.0.1:6633\") for
  index on column \"target\".  First row, with UUID 
  454b1ac9-0698-4035-b925-f8db4a475f4f, was inserted by this transaction.
  Second row, with UUID 23f3b80b-877e-4cdb-972d-8f9928c59b3a, existed in the 
  database before this transaction and was not modified by the transaction.",
  "error":"constraint violation"}

Although I can still do something like this to achieve the same effect:

  # ovs-vsctl -- set Bridge br1 controller=23f3b80b-877e-4cdb-972d-8f9928c59b3a

Should set-controller be handling the case where there already exists a
Controller record for the given target?

On Mon, Feb 11, 2013 at 01:47:12PM -0800, Ben Pfaff wrote:
> Thank you, I applied this to master.
> 
> On Mon, Feb 04, 2013 at 01:00:52PM -0800, Ethan Jackson wrote:
> > Acked-by: Ethan Jackson <ethan at nicira.com>
> > 
> > On Fri, Feb 1, 2013 at 2:51 PM, Ben Pfaff <blp at nicira.com> wrote:
> > > Commit cc7ecee48 (vswitchd: Add unique indexes for some columns.) says,
> > > in part:
> > >
> > >     With this commit, the database server itself rejects attempts to add
> > >     Port or Interface records with duplicate names or Controller or
> > >     Manager records with duplicate targets.
> > >
> > > but in fact didn't change the Controller table as described.  This commit
> > > fixes that.
> > >
> > > This commit updates the schema version number's major version, because this
> > > is a potentially non-backward compatible change, if some user depended on
> > > the ability to add Controller records with duplicate targets.  However, if
> > > anyone thinks this is a bad idea, then I'm open to discussion.
> > >
> > > Reported-by: Natasha Gude <natasha at nicira.com>
> > > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > > ---
> > > This is a repost of a patch originally posted Dec. 4, 2012.
> > >
> > >  vswitchd/vswitch.ovsschema |    7 ++++---
> > >  1 files changed, 4 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
> > > index 16125a5..025686b 100644
> > > --- a/vswitchd/vswitch.ovsschema
> > > +++ b/vswitchd/vswitch.ovsschema
> > > @@ -1,6 +1,6 @@
> > >  {"name": "Open_vSwitch",
> > > - "version": "6.11.3",
> > > - "cksum": "2234602985 17310",
> > > + "version": "7.0.0",
> > > + "cksum": "1525609876 17339",
> > >   "tables": {
> > >     "Open_vSwitch": {
> > >       "columns": {
> > > @@ -428,7 +428,8 @@
> > >           "ephemeral": true},
> > >         "status": {
> > >           "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"},
> > > -         "ephemeral": true}}},
> > > +         "ephemeral": true}},
> > > +     "indexes": [["target"]]},
> > >     "Manager": {
> > >       "columns": {
> > >         "target": {
> > > --
> > > 1.7.2.5
> > >
> > > _______________________________________________
> > > dev mailing list
> > > dev at openvswitch.org
> > > http://openvswitch.org/mailman/listinfo/dev
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list