Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 4462 invoked from network); 8 Mar 2009 00:19:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Mar 2009 00:19:09 -0000 Received: (qmail 54353 invoked by uid 500); 8 Mar 2009 00:19:08 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 54321 invoked by uid 500); 8 Mar 2009 00:19:08 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 54310 invoked by uid 99); 8 Mar 2009 00:19:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Mar 2009 16:19:08 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Mar 2009 00:18:57 +0000 Received: from [10.0.1.6] (e178194190.adsl.alicedsl.de [::ffff:85.178.194.190]) (AUTH: LOGIN jan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Sun, 08 Mar 2009 00:18:36 +0000 Message-Id: <3436ABAD-1FD6-408B-81CA-B1F17B151F97@apache.org> From: Jan Lehnardt To: dev@couchdb.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Please allow _prefix for auto-created _id Date: Sun, 8 Mar 2009 01:18:05 +0100 References: <8E00D3FC-52B5-40BC-9DA4-2D2F3580C22B@gmail.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org 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 --