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 E1155DC9D for ; Tue, 23 Oct 2012 22:02:12 +0000 (UTC) Received: (qmail 77303 invoked by uid 500); 23 Oct 2012 22:02:12 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 77151 invoked by uid 500); 23 Oct 2012 22:02:12 -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 77142 invoked by uid 99); 23 Oct 2012 22:02:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Oct 2012 22:02:12 +0000 Date: Tue, 23 Oct 2012 22:02:12 +0000 (UTC) From: "Jens Alfke (JIRA)" To: dev@couchdb.apache.org Message-ID: <1717857261.18595.1351029732341.JavaMail.jiratomcat@arcas> In-Reply-To: <1420685725.7669.1350849252319.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (COUCHDB-1570) Replicator writes corrupt remote checkpoint document on error; breaks replication 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-1570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Alfke updated COUCHDB-1570: -------------------------------- Summary: Replicator writes corrupt remote checkpoint document on error; breaks replication (was: Replicator writes corrupt remote checkpoint document on error; breaks revision forever) > Replicator writes corrupt remote checkpoint document on error; breaks replication > --------------------------------------------------------------------------------- > > Key: COUCHDB-1570 > URL: https://issues.apache.org/jira/browse/COUCHDB-1570 > Project: CouchDB > Issue Type: Bug > Components: Replication > Affects Versions: 1.2 > Environment: Mac OS X 10.8.2 > Reporter: Jens Alfke > Assignee: Randall Leeds > Priority: Blocker > Fix For: 1.3 > > > If a 'push' replication receives error responses from the remote server while PUTting documents, it may write a corrupt checkpoint document to the remote server -- its _revisions._ids property is null. Any subsequent attempt to push to that server will cause the replicator to abort with an error when reading that replication document, since it requires _revisions.ids to be an array. > The only workaround for this, short of deleting the remote database entirely, is to (a) identify the URL of the remote checkpoint document, and (b) delete it from the remote server. Otherwise you will never be able to push to that database again. > Here's a failed replication attempt: > $ curl -X POST --user snej :5984/_replicate --header Content-Type:application/json --data '{"source":"demo-shopping-attachments","target":"http://localhost:4984/demo-shopping-attachments","create_target":true}' > {"error":"doc_validation","reason":"_revisions.ids isn't a array."} > Here's the contents of the remote checkpoint document, once I identified its ID: > $ curl :4984/demo-shopping-attachments/_local/5b913befe682d7bd1fbc24b1ce31cbc5 > {"_id":"_local/5b913befe682d7bd1fbc24b1ce31cbc5","_rev":"0-1","_revisions":{"ids":null,"start":0},"history":[{"doc_write_failures":2,"docs_read":2,"docs_written":0,"end_last_seq":207,"end_time":"Sun, 21 Oct 2012 19:40:04 GMT","missing_checked":17,"missing_found":2,"recorded_seq":207,"session_id":"9a24dc37885b5b4e507ea90702b2fecf","start_last_seq":0,"start_time":"Sun, 21 Oct 2012 19:40:04 GMT"}],"replication_id_version":2,"session_id":"9a24dc37885b5b4e507ea90702b2fecf","source_last_seq":207} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira