[Xorp-hackers] order of create/delete operations

Michael Larson mike at vyatta.com
Tue May 9 16:41:48 PDT 2006


Yes, I can understand why the current behavior makes sense. 

The case I'm thinking of is when an underlying data value is referenced by two distinct nodes that are not directly related to each other (parent/child). So a construction similar to:


#note wrapped by a transaction.
common_parent {
   sib1 {
      foo {
         %create:
         %delete
      }
   }

   sib2 {
      foo {
         %create:
         %delete
      }
   }
}


Now, let's say that both foo's point to the same data structure, then the order of creation/deletion are important--for instance:

delete common_parent sib1 foo
create common_parent sib2 foo

is completely different from:

create common_parent sib2 foo
delete common_parent sib1 foo 


The order of execute of these two commands is not determinate (or maybe it is, but I haven't figured it out yet).

Probably it would be better to re-work the data structure in this case--but this isn't always possible (as in one case we have). Does this make sense? If deletes were always applied first in a transaction then the behavior would be deterministic and the delete operation above would always occur first.

Mike
----- Original Message -----
From: Pavlin Radoslavov <pavlin at icir.org>
To: Michael Larson <mike at vyatta.com>
Cc: xorp-hackers at icir.org
Sent: Tuesday, May 9, 2006 4:02:47 PM GMT-0800
Subject: Re: [Xorp-hackers] order of create/delete operations

> quick question/random thought...
> 
> During a commit wouldn't it make sense to apply all the delete
> xrls prior to the create/sets?
> 
> I can appreciate that this is not globally possible (across all
> nodes within a commit) due to transactions--but shouldn't this be
> true within the scope of a transaction?

I believe it was a semantic decision to have the create/sets before
the deletes.
Can you give an example that demonstrates it is better to have the
deletes before the create/sets.

Pavlin

_______________________________________________
Xorp-hackers mailing list
Xorp-hackers at icir.org
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers



More information about the Xorp-hackers mailing list