From dev-return-18384-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Wed Oct 5 10:21:57 2011 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 403B59A8D for ; Wed, 5 Oct 2011 10:21:57 +0000 (UTC) Received: (qmail 33355 invoked by uid 500); 5 Oct 2011 10:21:56 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 33278 invoked by uid 500); 5 Oct 2011 10:21:56 -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 33209 invoked by uid 99); 5 Oct 2011 10:21:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 10:21:56 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,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; Wed, 05 Oct 2011 10:21:55 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id BB9032A9F07 for ; Wed, 5 Oct 2011 10:21:34 +0000 (UTC) Date: Wed, 5 Oct 2011 10:21:34 +0000 (UTC) From: "Filipe Manana (Assigned) (JIRA)" To: dev@couchdb.apache.org Message-ID: <918044963.11128.1317810094770.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1220942000.7101.1314138329138.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Assigned] (COUCHDB-1259) Replication ID is not stable if local server has a dynamic port number 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-1259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Filipe Manana reassigned COUCHDB-1259: -------------------------------------- Assignee: Filipe Manana > Replication ID is not stable if local server has a dynamic port number > ---------------------------------------------------------------------- > > Key: COUCHDB-1259 > URL: https://issues.apache.org/jira/browse/COUCHDB-1259 > Project: CouchDB > Issue Type: Bug > Components: Replication > Affects Versions: 1.1 > Reporter: Jens Alfke > Assignee: Filipe Manana > Attachments: couchdb-1259.patch, couchdb-1259.patch > > > I noticed that when Couchbase Mobile running on iOS replicates to/from a remote server (on iriscouch in this case), the replication has to fetch the full _changes feed every time it starts. Filipe helped me track down the problem -- the replication ID is coming out different every time. The reason for this is that the local port number, which is one of the inputs to the hash that generates the replication ID, is randomly assigned by the OS. (I.e. it uses a port number of 0 when opening its listener socket.) This is because there could be multiple apps using Couchbase Mobile running on the same device and we can't have their ports colliding. > The underlying problem is that CouchDB is attempting to generate a unique ID for a particular pair of {source, destination} databases, but it's basing it on attributes that aren't fundamental to the database and can change, like the hostname or port number. > One solution, proposed by Filipe and me, is to assign each database (or each server?) a random UUID when it's created, and use that to generate replication IDs. > Another solution, proposed by Damien, is to have CouchDB let the client work out the replication ID on its own, and set it as a property in the replication document (or the JSON body of a _replicate request.) This is even more flexible and will handle tricky scenarios like full P2P replication where there may be no low-level way to uniquely identify the remote database being synced with. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira