Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 32098 invoked from network); 21 Mar 2010 12:10:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Mar 2010 12:10:46 -0000 Received: (qmail 63375 invoked by uid 500); 21 Mar 2010 12:10:45 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 63341 invoked by uid 500); 21 Mar 2010 12:10:45 -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 63333 invoked by uid 99); 21 Mar 2010 12:10:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Mar 2010 12:10:45 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fdmanana@gmail.com designates 209.85.218.214 as permitted sender) Received: from [209.85.218.214] (HELO mail-bw0-f214.google.com) (209.85.218.214) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Mar 2010 12:10:36 +0000 Received: by bwz6 with SMTP id 6so4361290bwz.33 for ; Sun, 21 Mar 2010 05:10:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=83Os9T9lwyWTeOP1Aocd72FtDK41DULg6kyemwvr7GY=; b=Hkx6mauudXZWRD4vvpAjGgbazb0DkeVkKuPujY3nH+1fCXDf2EiiCEQ2Fo7v/igRkZ bYWrC5NIwjwdIHt5SUl3cgHIf27DYycN6N4DlRrvQ9Soc1Z+PcrBGYTgzfJ9XSK3f56/ ynBy/jo75Y0ztBVE8NnuO4T3ldOxGPFy5E6Qs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; b=gPIMu3V5OWiCOdVz0wwNvvnMfI+noRtbpRfHF2RRMyxO6R4G/lpVSe1sFkuxHkwUh+ z7Lbvdp6WUBQrfcnqcQ8xJIIXBYFMUqi/22p/KdMhy2p6wEnYtak4APgLSn3B/vr2fXs nR7YBJD+y53Cy/+afUq07I4rt1nH/E0MxVYVc= MIME-Version: 1.0 Received: by 10.204.32.145 with SMTP id c17mr1110109bkd.126.1269173415589; Sun, 21 Mar 2010 05:10:15 -0700 (PDT) Reply-To: fdmanana@gmail.com In-Reply-To: <20100320002205.4A5EE2388978@eris.apache.org> References: <20100320002205.4A5EE2388978@eris.apache.org> Date: Sun, 21 Mar 2010 12:10:15 +0000 Message-ID: Subject: Re: svn commit: r925497 - /couchdb/trunk/src/couchdb/couch_rep.erl From: Filipe David Manana To: dev@couchdb.apache.org Cc: Jan Lehnardt Content-Type: multipart/mixed; boundary=000325556576983c4f04824e76f9 X-Virus-Checked: Checked by ClamAV on apache.org --000325556576983c4f04824e76f9 Content-Type: multipart/alternative; boundary=000325556576983c4704824e76f7 --000325556576983c4704824e76f7 Content-Type: text/plain; charset=UTF-8 Jan, It would also be a good idea to do the same with the filtered replication specific parameters ("filter" and "query_params"). The patch attached to this email does it. Also, don't forget the regression test attached to https://issues.apache.org/jira/browse/COUCHDB-703 cheers On Sat, Mar 20, 2010 at 12:22 AM, wrote: > Author: jan > Date: Sat Mar 20 00:22:04 2010 > New Revision: 925497 > > URL: http://svn.apache.org/viewvc?rev=925497&view=rev > Log: > backwards compatible ids for non-docid replications > > Modified: > couchdb/trunk/src/couchdb/couch_rep.erl > > Modified: couchdb/trunk/src/couchdb/couch_rep.erl > URL: > http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=925497&r1=925496&r2=925497&view=diff > > ============================================================================== > --- couchdb/trunk/src/couchdb/couch_rep.erl (original) > +++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010 > @@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) -> > QueryParams = proplists:get_value(<<"query_params">>, Props), > DocIds = proplists:get_value(<<"doc_ids">>, Props), > Base = couch_util:to_hex(erlang:md5( > - term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds]) > + case DocIds of > + undefined -> > + term_to_binary([HostName, Src, Tgt, Filter, QueryParams]); > + DocIds -> > + term_to_binary([HostName, Src, Tgt, Filter, QueryParams, > DocIds]) > + end > )), > Extension = maybe_append_options( > [<<"continuous">>, <<"create_target">>], Props), > > > -- Filipe David Manana, fdmanana@gmail.com "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men." --000325556576983c4704824e76f7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Jan,

It would also be a good idea to do the same with the=20 filtered replication specific parameters ("filter" and "quer= y_params").=20 The patch attached to this email does it.

Also, don't forget the= =20 regression test attached to https://issues.apache.org/jira/browse/COUC= HDB-703

cheers

On Sat, Mar 20, 2010 at 12:22 = AM, <jan@apache.org= > wrote:
Author: jan
Date: Sat Mar 20 00:22:04 2010
New Revision: 925497

URL: http://svn.apache.org/viewvc?rev=3D925497&view=3Drev
Log:
backwards compatible ids for non-docid replications

Modified:
=C2=A0 =C2=A0couchdb/trunk/src/couchdb/couch_rep.erl

Modified: couchdb/trunk/src/couchdb/couch_rep.erl
URL:
http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch= _rep.erl?rev=3D925497&r1=3D925496&r2=3D925497&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
--- couchdb/trunk/src/couchdb/couch_rep.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010
@@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) ->
=C2=A0 =C2=A0 QueryParams =3D proplists:get_value(<<"query_para= ms">>, Props),
=C2=A0 =C2=A0 DocIds =3D proplists:get_value(<<"doc_ids"&g= t;>, Props),
=C2=A0 =C2=A0 Base =3D couch_util:to_hex(erlang:md5(
- =C2=A0 =C2=A0 =C2=A0 =C2=A0term_to_binary([HostName, Src, Tgt, Filter, Qu= eryParams, DocIds])
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0case DocIds of
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0undefined ->
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0term_to_binary([HostName, Src, T= gt, Filter, QueryParams]);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0DocIds ->
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0term_to_binary([HostName, Src, T= gt, Filter, QueryParams, DocIds])
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0 )),
=C2=A0 =C2=A0 Extension =3D maybe_append_options(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 [<<"continuous">>, <&= lt;"create_target">>], Props),





--
Filipe David Manana,fdmanana@gmail.com

"= Reasonable men adapt themselves to the world.
Unreasonable men adapt th= e world to themselves.
That's why all progress depends on unreasonable men."

--000325556576983c4704824e76f7-- --000325556576983c4f04824e76f9--