monotone

Issue 32: Saner handling of database read/write transactions

Reported by Unknown User, Nov 27, 2005

(This entry was imported from the savannah tracker, original 
location: https://savannah.nongnu.org/bugs/index.php?15079)

Ideal behavior:
  -- all commands acquire either a read lock or a write lock
  -- they either succeed entirely (wrt locking, anyway), or fail 
immediately at the beginning of their run

To do this right, we should have a static difference between 
"readable db" and "readwriteable db", I think.  
(This makes certain kinds of caching harder, of course, logically 
non-writing operations might in fact want to update caches or 
something... fortunately we have no such on-disk caches ATM.)

Then each command could receive one sort of db or the other, and 
pass it on to each function it calls.  Then all the above properties 
could be achieved statically.

This full solution is a bit intrusive, though IMO fully worth it.  
In the mean time, it would be good to, e.g., have read and write 
transactions, and ensure at run time that write operations only 
occurred inside write transactions.  This solution is bad in the 
long run, though, because with it we will have another class of bugs 
that always come back sooner or later.

Created: 18 years 5 months ago by Unknown User

Status: New

Labels:
Type:Code Cleanup
Component:Storage System
Priority:Low

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status