Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6EE3F61D6 for ; Mon, 20 Jun 2011 18:19:09 +0000 (UTC) Received: (qmail 89333 invoked by uid 500); 20 Jun 2011 18:19:08 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 89281 invoked by uid 500); 20 Jun 2011 18: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 89273 invoked by uid 99); 20 Jun 2011 18:19:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 18:19:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jun 2011 18:19:07 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 84755424BA6 for ; Mon, 20 Jun 2011 18:18:47 +0000 (UTC) Date: Mon, 20 Jun 2011 18:18:47 +0000 (UTC) From: "Pete Vander Giessen (JIRA)" To: dev@couchdb.apache.org Message-ID: <116845671.21788.1308593927539.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1638922960.21781.1308593808036.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (COUCHDB-1200) _update handler breaks after a conflict is resolved MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-1200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pete Vander Giessen updated COUCHDB-1200: ----------------------------------------- Description: My update handlers break after I've introduced and resolved a conflict. Despite the conflict being resolve, I get the following error when trying to run an update handler on a once-conflicted document: {"error":"conflict","reason":"Document update conflict."} The attached script reproduces the issue on 1.1.x. The issue does not appear when run against a build of trunk. was: My update handlers break after I've introduced and resolved a conflict. Despite the conflict being resolve, I get the following error when trying to run an update handler on a once-conflicted document: {"error":"conflict","reason":"Document update conflict."} The following script reproduces the issue on 1.1.x. The issue does not appear when run against a build of trunk: #!/bin/bash export HOST=http://localhost:5984 echo "Step 1a -- setup dbs" curl -X DELETE $HOST/db0 curl -X DELETE $HOST/db1 curl -X PUT $HOST/db0 curl -X PUT $HOST/db1 echo "step 1b -- create an update handler " curl -X PUT $HOST/db0/_design/foo -d '{"updates":{"bar":"function(doc, req) { doc.foo=1; return [doc, \"ok\"];}"}}' echo "step 2 -- create a doc" curl -X PUT $HOST/db0/doc1 -d '{content}' curl -X GET $HOST/db0/doc1 echo "step 3 -- replicate" curl -X POST $HOST/_replicate -d '{"source":"db0","target":"db1"}' -H "Content-Type:application/json" echo "step 4 -- a new version of the doc on both dbs" curl -X PUT $HOST/db0/doc1 -d '{"_rev":"1-05a05c54cce81cc30df678afeab60f6c","content":"some content"}' curl -X PUT $HOST/db1/doc1 -d '{"_rev":"1-05a05c54cce81cc30df678afeab60f6c","content":"some different content"}' echo "step 5 -- create a conflict " curl -X POST $HOST/_replicate -d '{"target":"db0","source":"db1"}' -H "Content-Type:application/json" echo "confirm conflict" curl -X GET $HOST/db0/doc1?conflicts=true echo "step 6 -- resolve the conflict" curl -X DELETE $HOST/db0/doc1?rev=2-2efe11aab7e71ce9124a1039129512da echo "step 7 -- check to make sure resolved" curl "$HOST/db0/doc1?conflicts=true&deleted_conflicts=true" echo "step 8 -- attempt to PUT to our update handler: this produces the error" curl -X PUT $HOST/db0/_design/foo/_update/bar/doc1?2-3b2f178dbc5e76cbd8df3ddca1963f4b -d '{}' echo "step 9 -- double-check that conflict was resolved" curl "$HOST/db0/doc1?conflicts=true&deleted_conflicts=true" echo "step 10 -- confirm that we can still do a normal PUT" curl -X PUT $HOST/db0/doc1 -d '{"_id":"doc1","_rev":"2-3b2f178dbc5e76cbd8df3ddca1963f4b","content":"some content fnord"}' > _update handler breaks after a conflict is resolved > --------------------------------------------------- > > Key: COUCHDB-1200 > URL: https://issues.apache.org/jira/browse/COUCHDB-1200 > Project: CouchDB > Issue Type: Bug > Components: Database Core, Replication > Affects Versions: 1.1 > Reporter: Pete Vander Giessen > Attachments: test_conflict_mine.sh > > > My update handlers break after I've introduced and resolved a conflict. Despite the conflict being resolve, I get the following error when trying to run an update handler on a once-conflicted document: > {"error":"conflict","reason":"Document update conflict."} > The attached script reproduces the issue on 1.1.x. The issue does not appear when run against a build of trunk. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira