On Tue, Mar 26, 2013 at 08:04:15PM +0400, Boris Tobotras wrote:
> On 03/26/2013 07:42 PM, Ben Pfaff wrote:
> >The Interface row was created with the specified uuid, but it was
> >deleted immediately as part of transaction commit by the garbage
> >collector because it was unreferenced. To keep it from being garbage
> >collected, create a Port that references it and add a reference to the
> >Port from a Bridge in the same transaction.
>
> Good point, thanks! But still:
>
> > {"method":"transact","params":["Open_vSwitch",{"op":"insert","table":"Interface","row":{"name":"paci1face","type":"internal","_uuid":["uuid","d68a838d-97ca-4269-98d1-dca6c86e99ef"]}},{"op":"insert","table":"Port","row":{"name":"paci1port","interfaces":["uuid","d68a838d-97ca-4269-98d1-dca6c86e99ef"],"_uuid":["uuid","ccde0db1-130d-44f0-96ae-dddaefeaea79"]}},{"op":"insert","table":"Bridge","row":{"name":"paci1br","ports":["uuid","ccde0db1-130d-44f0-96ae-dddaefeaea79"]}},{"op":"commit","durable":true}],"id":4}
>
> < {:id 4, :error nil, :result [{:uuid ["uuid"
> "3ff4b45c-4baf-4617-8061-0f617f6a7a79"]} {:uuid ["uuid"
> "a736a968-c1de-4f24-99fd-87ee09880705"]} {:uuid ["uuid"
> "14d0de04-6a4c-4030-9c42-89fb8c10763e"]} {} {:error "referential
> integrity violation", :details "Table Port column interfaces row
> a736a968-c1de-4f24-99fd-87ee09880705 references nonexistent row
> d68a838d-97ca-4269-98d1-dca6c86e99ef in table Interface."}]}
You can't use hard-coded uuids to refer to new rows, because you
cannot know what the uuid of a new row is. Use a named-uuid.
<named-uuid>
A 2-element JSON array that represents the UUID of a row inserted
in an "insert" operation within the same transaction. The first
element of the array must be the string "named-uuid" and the
second element should be the <id> specified as the "uuid-name"
for an "insert" operation within the same transaction. For
example, if an "insert" operation within this transaction
specifies a "uuid-name" of "myrow", the following <named-uuid>
represents the UUID created by that operation:
["named-uuid", "myrow"]
A <named-uuid> may be used anywhere a <uuid> is valid.
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss