"Bert Huijben" <b...@qqmail.nl> writes:

> * The atomic operations. WC-NG operations that can operate without outside
> knowledge learned before the operation.
>
> These functions that are just one sqlite transaction by itself, just need to
> make sure nobody else has a write lock. Having a write lock is not required
> for operations like just changing the actual properties on a node. Of course
> nobody else can own a write lock, or it might change the properties after
> sending the commit data, but before moving the data to the base_node table.

It's not just commits.  WC-NG is supposed to be backwards compatible
with 1.6 which means that once a process takes a 1.6 write lock no
other process can modify the wc; it makes no difference whether that
modification is atomic or not.

You also seem to be implying that some operations don't need to create
write locks, that atomic operations merely need to ensure no write
locks exist.  At what point does this check occur?

  - process A: start atomic transaction
  - process B: take a 1.6 write lock
  - process A: continue atomic transaction
  - process B: use 1.6 write lock
  - process A: continue atomic transaction
  - process B: remove 1.6 write lock
  - process A: complete/commit/finalise atomic transaction

Does the atomic transaction in one process block the 1.6 write lock
creation in another process?  That's just like having the transaction
take a write lock.

Does the atomic transaction check all the way through for a write
lock?  That doesn't even seem possible.

Does the transaction do some sort of write lock counting to make sure
that none have been created during the transaction?  I don't see
anything like that in the code.

> Once we have a central DB it will be really easy to perform this nobody else
> has a write lock check. (Checking if we ourselves have a write lock ourself
> is just a memory lookup of course).

So the plan is that locking remains broken until centralised metadata?

> * Partial operations
>
> These operations rely on data read before the wc_db operation and only work
> correctly if the data didn't change since reading. All entry based
> operations are in this category and the WC-NG work tries to redesign several
> of these operation to the first class of operations.
>
> These operations really need a write lock and we need far more checks here.

-- 
Philip

Reply via email to