couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: Please allow _prefix for auto-created _id
Date Sun, 08 Mar 2009 00:18:05 GMT

On 8 Mar 2009, at 01:04, Antony Blakey wrote:

>
> On 08/03/2009, at 10:08 AM, Jan Lehnardt wrote:
>
>>
>> On 8 Mar 2009, at 00:22, Antony Blakey wrote:
>>
>>>
>>> On 08/03/2009, at 4:41 AM, Chris Anderson wrote:
>>>
>>>> Currently it's recommended not to POST new documents without ids to
>>>> CouchDB. Due to HTTP protocol issues this can result in duplicate
>>>> document creation.
>>>
>>> I've never really understood this. Wouldn't it mean that all POST  
>>> operations in CouchDB need to be made idempotent by the server  
>>> because they might be erroneously repeated by middleware?
>>
>> Correct, a bug in Safari / CFNetwok brought this up.
>
> I can't find a reference to a Safari/CFNetwork double post problem.  
> Do you have one? Will it become obsolete?

http://osdir.com/ml/db.couchdb.devel/2008-07/msg00127.html (lmgtfy  
"safari sends post twice", seriously, this is tiring).


> One implication of this is that a create or update might return a  
> 412, even though it has succeeded, because the client is seeing the  
> response from the second, repeated POST? And a bulk request might  
> return erroneous results as well?


Correct. As no data is lost, this is a nuisance, less a problem.


> On that basis, should only PUTs be allowed, to protect users from an  
> infrastructure bug they aren't aware of?

I've been thinking along these lines a few times now. This might be  
worth considering, but I'm no convinced yet.


> Those lmgtfy links seem to be about the double post being triggered  
> by the browser client, as opposed to e.g. a ruby client. I knew  
> about that problem, but I've not seen a problem report due to  
> *middleware* e.g. proxy/cache ignoring the non-idempotency of POST.

The point is that CouchDB can't know if requests come from a broken or  
compliant middleware system with new ones coming up all the time.

Cheers
Jan
--




Mime
View raw message