[ovs-dev] [PATCH] ovsdb: Force columns that contain weak references to be immutable.

Ben Pfaff blp at ovn.org
Mon Apr 11 05:30:04 UTC 2016

On Mon, Apr 04, 2016 at 10:38:40PM +0000, Ansari, Shad wrote:
> > 
> > HI Ben,
> > 	How does column which is weak reference  and also configured as
> > an Index? If it is mutable, and the corresponding UUID going away(deletion
> > of record) leaves column value as NULL right? And what would be the
> > behavior if the table is a Root table also?
> > I am listing down, my assumptions:
> > 
> > 	1. In table X, If the column is index and a weak reference to table y,
> > on table y row deletion, the index field would become NULL and since it is
> > an index, constraint violation would occur and to avoid, it is expected to
> > remove the row first in table X and table Y row deletion can happen in same
> > txn or consequent transactions. Correct?
> > 	2. If the table X is also a root table, and one of its column is an index
> > and weak reference to table Y, on row deletion in table Y, constraint
> > violation would occur, hence similar to above table X row cleanup is
> > expected to happen prior to table Y row deletion.
> > 
> > 	If above 2 statements is true, index with weak reference is becoming
> > equivalent to strong reference. Am I correct?
> > 
> > Thanks
> > Krishna Mohan
> Would it make sense to allow NULL values for columns that are references and indexes. Something like what MySQL allows for unique keys.
> http://dev.mysql.com/doc/refman/5.0/en/create-index.html

That's a reasonable idea.  It could theoretically break some currently
working use cases, if someone has an OVSDB schema that relies on an
index to ensure the uniqueness of an empty column.  I don't know whether
there are schemas out there that rely on this property.

I don't know how this idea would extend to multi-column indexes.

More information about the dev mailing list