Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 24126 invoked from network); 2 Feb 2010 20:17:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Feb 2010 20:17:41 -0000 Received: (qmail 22329 invoked by uid 500); 2 Feb 2010 20:17:41 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 22253 invoked by uid 500); 2 Feb 2010 20:17:40 -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 22243 invoked by uid 99); 2 Feb 2010 20:17:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Feb 2010 20:17:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of adam.kocoloski@gmail.com designates 209.85.212.52 as permitted sender) Received: from [209.85.212.52] (HELO mail-vw0-f52.google.com) (209.85.212.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Feb 2010 20:17:32 +0000 Received: by vws9 with SMTP id 9so161899vws.11 for ; Tue, 02 Feb 2010 12:17:11 -0800 (PST) Received: by 10.220.124.106 with SMTP id t42mr4831536vcr.32.1265141831636; Tue, 02 Feb 2010 12:17:11 -0800 (PST) Received: from ?10.1.10.164? (c-66-31-20-188.hsd1.ma.comcast.net [66.31.20.188]) by mx.google.com with ESMTPS id 42sm2769241vws.12.2010.02.02.12.17.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Feb 2010 12:17:10 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1077) Subject: Re: associating UUIDs to DBs From: Adam Kocoloski In-Reply-To: Date: Tue, 2 Feb 2010 15:17:07 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <55047b711002012202j1878120epfb6a34629fcb812b@mail.gmail.com> To: dev@couchdb.apache.org X-Mailer: Apple Mail (2.1077) On Feb 2, 2010, at 2:48 PM, Randall Leeds wrote: > On Tue, Feb 2, 2010 at 11:39, Chris Anderson = wrote: >> On Tue, Feb 2, 2010 at 11:25 AM, Randall Leeds = wrote: >>> I'm not entirely happy with this patch and I'd like some help = figuring >>> out what to do about it. >>>=20 >>> I foresee problems when database files are copied or backed up on >>> disk. It's possible to end up with two couchdb instances hosting >>> databases with the same uuid. The problem is that the uuid is no >>> longer meaningful, as it doesn't do what it was intended to = (uniquely >>> identify the database). >>>=20 >>> Can anyone see a way around this? >>>=20 >>=20 >> I think we don't mind this. As I mentioned above, when we see that 2 >> db files have the same uuid we can do a fast-forward replication by >> starting from the lower of the 2 dbs sequence #s for replication. >> (maybe... Adam, does this sound sane?) >=20 > If changes had been made to both dbs separately then the lower > sequence # might be beyond the sequence number at which the histories > diverged and the changes to the "younger" db would be lost. Yes, that's the problem we'll need to solve if we're going to use UUIDs = to fast-forward replication. Off the top of my head, one way to do that = would be store a DB revid calculated in the same way as the document = revids (and seed it with the UUID at the beginning). Then if you find = an update_seq where the revision IDs match, you can start the = replication from that point. There may be cheaper ways, though. Adam=