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 A188FD2C2 for ; Mon, 5 Nov 2012 09:27:52 +0000 (UTC) Received: (qmail 21773 invoked by uid 500); 5 Nov 2012 09:27:52 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 21733 invoked by uid 500); 5 Nov 2012 09:27:52 -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 21724 invoked by uid 99); 5 Nov 2012 09:27:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 09:27:52 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bchesneau@gmail.com designates 209.85.210.180 as permitted sender) Received: from [209.85.210.180] (HELO mail-ia0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Nov 2012 09:27:45 +0000 Received: by mail-ia0-f180.google.com with SMTP id f6so4006430iag.11 for ; Mon, 05 Nov 2012 01:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=urnRpalF1HzsYlLDR+L0arpTLQFDNt/geOVrlw91+bc=; b=qdp0ogsQeiOyI92CcjkeB4mA6DOCu1IfYC1yjdnFNxwR6Gn0TokeAcgn2gLIMb3iYP UENX6sHm+noPTOB1aG/Harq/pvQAsdAy7Ug6MpkVF8D0cOfkBiycAY6YGzVSWNGCa8jA B7dPzFIdNjMCUEhKH0FNt+4goPESGIyyBKnrCLE2/+KvxHjG+dBoR65NtqygecEfolWT fN/ECDmv15xM6cGxRiyt1ccGULr4TvjjQmBtmR7Dxq+0g2nOmeXGiECO1YxVBeRoN+VV kLJESGzikt+LZstpaSGe94GveReVHp2GSCyr17wdxn+3XJsCH1aTLBNHUWr4cyyiwUOK uXyA== MIME-Version: 1.0 Received: by 10.50.149.225 with SMTP id ud1mr8795746igb.32.1352107644861; Mon, 05 Nov 2012 01:27:24 -0800 (PST) Received: by 10.64.77.196 with HTTP; Mon, 5 Nov 2012 01:27:24 -0800 (PST) Received: by 10.64.77.196 with HTTP; Mon, 5 Nov 2012 01:27:24 -0800 (PST) In-Reply-To: <1132244544.68136.1352107512357.JavaMail.jiratomcat@arcas> References: <1220942000.7101.1314138329138.JavaMail.tomcat@hel.zones.apache.org> <1132244544.68136.1352107512357.JavaMail.jiratomcat@arcas> Date: Mon, 5 Nov 2012 10:27:24 +0100 Message-ID: Subject: Re: [jira] [Commented] (COUCHDB-1259) Replication ID is not stable if local server has a dynamic port number From: Benoit Chesneau To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=e89a8f3baf03debd8404cdbc1774 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f3baf03debd8404cdbc1774 Content-Type: text/plain; charset=ISO-8859-1 On Nov 5, 2012 10:25 AM, "Robert Newson (JIRA)" wrote: > > > [ https://issues.apache.org/jira/browse/COUCHDB-1259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490527#comment-13490527] > > Robert Newson commented on COUCHDB-1259: > ---------------------------------------- > > Benoit, are you vetoing this change? If so, please include a reason why improving the hit rate for replication checkpoints should not be included in our next release. how does it improve the hit rate? how is it related to this ticket? > > Everyone else, please comment on the patch itself, I want feedback on 1) the quality and correctness of the patch and 2) whether, when using UUID, whether it is correct to use UUID instead of the {Scheme, UserInfo, UUID, Path} tuple that I've chosen as I would prefer to simply use the UUID if it's correct to do so for clarity. > > https://github.com/apache/couchdb/pull/35 > > > > 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: Robert Newson > > Priority: Blocker > > Fix For: 1.3 > > > > 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 > For more information on JIRA, see: http://www.atlassian.com/software/jira --e89a8f3baf03debd8404cdbc1774--