incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <B.Cand...@pobox.com>
Subject Re: New bulk docs behavior - transactional
Date Sun, 05 Apr 2009 19:46:02 GMT
On Thu, Apr 02, 2009 at 11:09:24PM -0700, Scott Shumaker wrote:
> How about something like the following?
> 
> During an 'transactional bulk write':
> 
> - For each document in the transaction,
> 
>    - Attempt to create a new rev of the document, specially flagged so
> it doesn't show up in views, document fetches, or replications (return
> the last version of this documents instead).
>    - This rev SHOULD be examined when checking for conflicts with
> subsequent writes (so no new writes to the document can happen while
> the transaction is in progress - they return with a conflict error).

In that case, is this new magic rev not just the same as a lock?

Implementing a per-document lock within one database is simple enough, and
indeed it could be done in a sharded environment too. However it would be
extremely difficult to implement if you allow multi-master replication too.
You would also need procedures to recover locks due to transactions which
have stalled or silently aborted (remembering that HTTP is a stateless
protocol)

Regards,

Brian.

Mime
View raw message