Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 18890 invoked from network); 8 Feb 2009 21:02:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2009 21:02:22 -0000 Received: (qmail 84747 invoked by uid 500); 8 Feb 2009 21:02:22 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 84423 invoked by uid 500); 8 Feb 2009 21:02:22 -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 84412 invoked by uid 99); 8 Feb 2009 21:02:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 13:02:21 -0800 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=FS_REPLICA,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of patrick.antivackis@gmail.com designates 209.85.218.163 as permitted sender) Received: from [209.85.218.163] (HELO mail-bw0-f163.google.com) (209.85.218.163) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 21:02:15 +0000 Received: by bwz7 with SMTP id 7so785593bwz.11 for ; Sun, 08 Feb 2009 13:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=cSNj/Ak/Qzliiuqy3heLotZazzH0jyR9LLSLcOmsuqM=; b=bivNCI4+R04qfRTTCQ9BkHbHpggBjSTyOOMW9rUwVl+y0b82M6V3okkDHSfau81c8c MTezgdHc5s05dCUscSJC1+O2BJN0cO3647xk8W55JpDJ39YscKTeJbVz9L2rjl5dcxCY Qt/+en5BgdfNmiUP8fkVWnlG4tcZqMXdGHd0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pqZbdkmabIpPgENTo96wdEnXW2u7PXZmMEjjE6FeDP4hWZjh10gLR5ZJgXtgauCX4T 0S20OUPVLG53H6OFHeerLVzeMzDKthtFpT+rcfksGwgRLw4d3DB+yYK38cqYoIM065i0 VYpjr8fCKrqtrrUUnsIIQ0ktR4poRX9LDAyqI= MIME-Version: 1.0 Received: by 10.223.112.204 with SMTP id x12mr1239947fap.70.1234126913395; Sun, 08 Feb 2009 13:01:53 -0800 (PST) In-Reply-To: <2A30A4F1-C443-465D-A025-36704A628883@gmail.com> References: <5B2D5ED2-6B85-41D7-BA78-3DD4BE7AFE13@apache.org> <7060483c0902080850w126d4208yd50bb65921c9137d@mail.gmail.com> <7060483c0902080914w1eadaf12h8525e4af53c5aee9@mail.gmail.com> <7060483c0902081038l30df1bd7h1219a7a079a7b00a@mail.gmail.com> <2C826622-ECCD-46A8-9BF1-A3B4A140CE02@gmail.com> <7060483c0902081211s2462eed3gae6c458317ee5a94@mail.gmail.com> <2A30A4F1-C443-465D-A025-36704A628883@gmail.com> Date: Sun, 8 Feb 2009 22:01:53 +0100 Message-ID: <7060483c0902081301u268c4cc2qe237bf5c7d42ff7f@mail.gmail.com> Subject: Re: proposed replication rev history changes From: Patrick Antivackis To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=001636c5b1f447dd7b04626e90a5 X-Virus-Checked: Checked by ClamAV on apache.org --001636c5b1f447dd7b04626e90a5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi Adam, Ok thanks, after logging couch_rep, i catch it. As the Node just store the replicator record of the source and not both the record of the source and the record of the target. 2009/2/8 Adam Kocoloski > Hi Patrick, this is true: > > if key of the myDoc is lower then the replicator records, then it means >> the document hasn't change since last replication. >> > > However, in your example #3 revseqs 5,6, and 7 on Node A happened after the > last replication, so the key for myDoc in the _all_docs_by_seq view will be > greater than the update_seq in the replication record. Hope that helps, > > Adam > > > On Feb 8, 2009, at 3:11 PM, Patrick Antivackis wrote: > > Sorry Paul, but i thought Couch could do miracles. >> >> Adam, back to the _all_docs_by_seq view, if key of the myDoc is lower then >> the replicator records, then it means the document hasn't change since >> last >> replication. So no conflict or do I still miss something >> >> 2009/2/8 Paul Davis >> >> On Sun, Feb 8, 2009 at 1:48 PM, Adam Kocoloski >> > >>> wrote: >>> >>>> >>>> On Feb 8, 2009, at 1:38 PM, Patrick Antivackis wrote: >>>> >>>> 3) >>>>> NodeA : >>>>> _id : myDoc _rev : 7-moe actual-rev-history [1-bart, 2-lisa, 3-homer, >>>>> 4-marge, 5-patty, 6-selma, 7-moe] damien-rev-history [5-patty, 6-selma, >>>>> 7-moe] patrick-damien-rev-history [1-bart, 6-selma, 7-moe] >>>>> NodeB : >>>>> _id : myDoc _rev : 4-marge actual-rev-history [1-bart, 2-lisa, 3-homer, >>>>> 4-marge] damien-rev-history [ 2-lisa, 3-homer, 4-marge] >>>>> patrick-damien-rev-history [1-bart, 3-homer, 4-marge] >>>>> >>>>> Actual revision system : OK can find there is no conflict, NodeA is >>>>> just >>>>> up >>>>> to date compare to nodeB >>>>> Damien's proposal : KO comparing [5-patty, 6-selma, 7-moe] with [ >>>>> >>>> 2-lisa, >>> >>>> 3-homer, 4-marge] >>>>> Keeping first revision combined with Damien's proposal :we compare >>>>> [1-bart, >>>>> 6-selma, 7-moe] with [1-bart, 3-homer, 4-marge], sure it's the same >>>>> document, but with have rev 6 and 7 on NodeA and rev 3 and 4 on NodeB. >>>>> Using >>>>> the replication record on both source and target, we can find than >>>>> revision >>>>> 3 and 4 were already replicated, so for sure rev 6 and 7 coming from >>>>> >>>> NodeA >>> >>>> are updates of the document. So OK we can find there is no conflict, >>>>> >>>> NodeA >>> >>>> is just up to date compare to nodeB >>>>> >>>>> >>>>> So compared to Damien's proposal, keeping first revision seems a good >>>>> >>>> idea >>> >>>> to me. >>>>> >>>>> Do I miss something or am I wrong ? >>>>> >>>> >>>> The replication records don't include the fact that 3 and 4 made it to >>>> >>> Node >>> >>>> B. The replicator consumes the _all_docs_by_seq view, which only stores >>>> >>> the >>> >>>> latest revision for each document. The replication history only tracks >>>> >>> the >>> >>>> index in that view at the end of each replication, so it knows which >>>> documents have not changed in the interim. Best, >>>> >>>> Adam >>>> >>>> >>>> >>>> >>> As Adam points out, you've got a "Then a miracle happens" step with >>> checking that rev's 3 and 4 are the same revisions. This means that >>> the two systems are more or less the same but yours is gonna have >>> added complexity. >>> >>> Also remember that _rev lists aren't actually lists, they're trees. >>> >>> HTH, >>> Paul Davis >>> >>> > --001636c5b1f447dd7b04626e90a5--