durusmail: durus-users: Conflict in sequential atomic read/modify/write
Conflict in sequential atomic read/modify/write
2006-07-26
Re: what I learned
2006-07-27
2006-07-27
2006-07-27
2006-08-01
2006-07-27
2006-07-27
2006-07-27
2006-07-27
2006-07-29
Conflict in sequential atomic read/modify/write
Mike Sandford
2006-07-26
I am using Quixote(2.4), scgi server (1.10) and durus (3.4.1). If I run with
max_children more than 1 I get ReadConflict. I already trap conflict errors
in the commit_changes method (and simply call connection.abort()) and all the
messages are comming up within the start_request routine within Quixote. The
problem is largely that all the images and javascript file requests arrive
thick and fast, each one triggering access time updates on the session.

I can reduce the impact by moving the application into a separate path and
setting the session path accordingly. I might modify quixote to update the
access time when it commits. However, these things reduce the potential
impact and do not necessarily remove the problem.

Forgive me if I have misunderstood something, but my understanding of what is
going on centers on durus and conflict handling.

The client.invalid set in the storage server records a list of oids that have
been committed on behalf of other clients. If my client reads (or, in version
3.4 makes a change to) an oid in this list then a ReadConflict is generated.

So, I have two processes, A and B. Process A reads, updates and commits oid 1.
This places '1' in the invalid list relating to process B. When process B
comes to read oid 1, after process A has finished and before anyone else can
get in and clear the invalid list, it triggers a ReadConflict. If I have one
process and attempt to read oid 1 twice in succession there is no error.

If I have it right, it looks as though two sequential read/modify/write cycles
on the same oid can cause an error in one circumstance and not in the other.

In practice, I am only interested in what someone else is doing if I have
already read the data and I now want to commit a change. This suggests to me
that there ought to be a _sync when the oid is loaded (and throw away the
invalid list) but the comments in get_stored_pickle seem to suggest that this
has aleady been done.

What have I not understood?

Mike S.
--
Mike Sandford
Director
Campbell Carr
12 Broadway
Amersham
HP7 0HP

Tel: +44 (0)1494-432323
Fax: +44 (0)1494-434888
Mob: +44 (0)7946-710026

www.campbellcarr.co.uk
m_sandford@campbellcarr.co.uk

reply