Subject: [NGO] Re: partial locks

From: Balazs Lengyel <[email-masked]>
Date: Mon, 07 May 2007 11:34:36 +0200

Hello,
I would like to allow the locking only of complete subtrees to simplify partial-locking. I 
would like to avoid situations when in a database like

<interfaces>
   <interface>
     <name>eth0</name>
     <mtu>1500</mtu>
     <adminState>enabled</adminState>
   </interface>
   <interface>
     <name>eth1</name>
     <mtu>1500</mtu>
     <adminState>disabled</adminState>
   </interface>
</interfaces>

only the elements corresponding to the paths /interfaces/interface[eth0]/mtu and 
/interfaces/interface[eth1] are locked, but node /interfaces/interface[eth1]/mtu is not locked.

Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
TSP System Manager
ECN: 831 7320                        Fax: +36 1 4377792
Tel: +36-1-437-7320     email: [email-masked]

_______________________________________________
NGO mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/ngo

---

From: Andy Bierman <[email-masked]>
Date: Tue, 08 May 2007 08:01:34 -0700

Balazs Lengyel wrote:
> Hello,
> I would like to allow the locking only of complete subtrees to simplify 
> partial-locking. I would like to avoid situations when in a database like
> 

All XML subtrees are complete trees.
Do you mean you want to constrain a lock to identify an integral
number of conceptual rows?

> only the elements corresponding to the paths 
> /interfaces/interface[eth0]/mtu and /interfaces/interface[eth1] are 
> locked, but node /interfaces/interface[eth1]/mtu is not locked.
> 

The choice of Xpath expression in the lock is critical.
The slightest inaccuracy will lock the wrong nodes.
Since the Xpath expression results can change from moment
to moment, there is no way for the manager to know exactly
which nodes are locked -- in advance, during, or after the <lock> RPC.

I am not a fan of full Xpath for locking.

What if the lock was given as:

   /interfaces/interface[ifMtu=1500]

As soon as the ifMtu is changed, the <interface> element that
contains it is no longer locked.

The Xpath expression must be limited to an absolute path expression,
which contains only elements and/or attributes defined as keys to
distinguish multiple instances.  Otherwise the set of locked nodes
will be dynamic and possibly non-deterministic over time, which is
an unacceptable 'feature' for a lock mechanism.

> Balazs

Andy