<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Thu Jun 20 04:11:50 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.couchbase.com/issues/si/jira.issueviews:issue-xml/MB-6041/MB-6041.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[MB-6041] XDC replication keeps on replicating even after replication document is removed</title>
                <link>http://www.couchbase.com/issues/browse/MB-6041</link>
                <project id="10010" key="MB">Couchbase Server</project>
                        <description>- create replication&lt;br/&gt;
- upload some data into the source bucket&lt;br/&gt;
- remove the replication (replication document is not present in _replicator/_all_docs anymore)&lt;br/&gt;
- observe that number of items in the destination bucket keeps growing&lt;br/&gt;
&lt;br/&gt;
seeing in this on current HEAD</description>
                <environment></environment>
            <key id="18686">MB-6041</key>
            <summary>XDC replication keeps on replicating even after replication document is removed</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/major.png">Major</priority>
                    <status id="5" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10011">Public</security>
                        <assignee username="junyi">Junyi Xie</assignee>
                                <reporter username="Aliaksey Artamonau">Aliaksey Artamonau</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Jul 2012 14:54:58 -0500</created>
                <updated>Wed, 29 Aug 2012 14:23:19 -0500</updated>
                    <resolved>Tue, 28 Aug 2012 14:00:02 -0500</resolved>
                                            <fixVersion>2.0</fixVersion>
                                <component>cross-datacenter-replication</component>
                                <votes>0</votes>
                        <watches>0</watches>
                                                    <comments>
                    <comment id="34156" author="junyi" created="Fri, 27 Jul 2012 14:59:57 -0500"  >There could be some delay between the time you remove the rep doc and XDCR manager got notified and canceled all replications. Can you please provide the log of source?&lt;br/&gt;
</comment>
                    <comment id="34160" author="Aliaksey Artamonau" created="Fri, 27 Jul 2012 15:26:04 -0500"  >It seems that it happens when there are more than one replication (possibly to the same cluster). I initially observed it when I had two replications between two clusters. Then I tried to reproduced with only one replication. It worked flawlessly. Then I tried it with two replications again and again observed the bug. Attaching a diag from a source.</comment>
                    <comment id="34567" author="junyi" created="Wed, 1 Aug 2012 17:15:49 -0500"  >Cannot open xz file  on MacOS. Can you upload a .gz or .tar package? Thanks</comment>
                    <comment id="35547" author="peter" created="Wed, 15 Aug 2012 13:23:05 -0500"  >Ketaki, can you try this one out before and after Damien&amp;#39;s changes.</comment>
                    <comment id="36603" author="abhinav" created="Wed, 22 Aug 2012 19:10:48 -0500"  >- Set up a 2:2 unidirectional replication on build 1623.&lt;br/&gt;
- Load on source, replication kicks off on destination.&lt;br/&gt;
- Deleted the replication on the source side:&lt;br/&gt;
&amp;nbsp;&amp;nbsp;- Replication ceases to stop immediately on the destination.&lt;br/&gt;
&amp;nbsp;&amp;nbsp;- I expected the replication would stop when the item count reaches the count on the source when I killed the replication.&lt;br/&gt;
&amp;nbsp;&amp;nbsp;- However, the count surpasses that check point but does stop at a point much later, with the load on the source still going.</comment>
                    <comment id="36635" author="junyi" created="Wed, 22 Aug 2012 21:38:01 -0500"  >Locally I created 1-1 clusters, each with two bucktes, default and default2.   Start two concurrent XDCR for default and defult2, and then delete the two replication docs from UI. Both replications stopped within several seconds after I deleted the replication doc.  At least at local testing, I do not see any issue.  &lt;br/&gt;
&lt;br/&gt;
Aliaksey, can you please retry the latest code to see if the issue still exists?  Thanks.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="36682" author="Aliaksey Artamonau" created="Thu, 23 Aug 2012 11:20:43 -0500"  >I was able to reproduce it by creating two replications from the same bucket on the source to two different buckets on destination. Probably it&amp;#39;s not very realistic scenario. But it might uncover an important issue. Will attach diag from the source cluster shortly.</comment>
                    <comment id="36683" author="Aliaksey Artamonau" created="Thu, 23 Aug 2012 11:25:05 -0500"  >Replications stopped finally stopped several minutes after I removed corresponding replication documents.</comment>
                    <comment id="37105" author="junyi" created="Tue, 28 Aug 2012 13:57:30 -0500"  >I tried the same setting as yours (1 -&amp;gt; 1 replication,  &lt;a href=&apos;mailto:default@node1&apos;&gt;default@node1&lt;/a&gt; -&amp;gt; &lt;a href=&apos;mailto:default@node2&apos;&gt;default@node2&lt;/a&gt;, and &lt;a href=&apos;mailto:default@node1&apos;&gt;default@node1&lt;/a&gt; -&amp;gt; &lt;a href=&apos;mailto:default2@node2&apos;&gt;default2@node2&lt;/a&gt;), and it seems there is nothing wrong.&lt;br/&gt;
&lt;br/&gt;
From the log below, XDCR replication manager got notified from ns_server instantly after I deleted the replication doc from UI, it instantly shutdown all ongoing bucket replication process, with no delay.  And all XDCR activity stopped at source right after that. However, there could be some activity on destination cluster even after XDCR stopped replication on source side, because it may take a while to persist all items in memory to storage.  I am not sure if there is any delay between UI stats and the real activity.  Also, if both nodes in your test are on the local machine with 1024 vbuckets, it may take longer to finish.  I think the delay should be much shorter if we use VMs to conduct the test. &lt;br/&gt;
&lt;br/&gt;
At this time I am not sure what to fix.  I merged some logs for timing purpose, and will ask Ketaki to do the same test on VM. If it is really an issue, we will reopen this bug and investigate the logs from VM.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
[couchdb:info,2012-08-28T14:43:47.255,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.742.0&amp;gt;:couch_log:info:39]127.0.0.1 - - DELETE /_replicator/1d38c26cdc5c5bb0e6be126e8ae272be%2Fdefault%2Fdefault?rev=1-9ee1a1c9 200&lt;br/&gt;
[xdcr:debug,2012-08-28T14:43:47.257,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:xdc_rep_manager:xdc_rep_manager:process_update:174]replication doc deleted (docId: &amp;lt;&amp;lt;&amp;quot;1d38c26cdc5c5bb0e6be126e8ae272be/default/default&amp;quot;&amp;gt;&amp;gt;), stop all replications&lt;br/&gt;
[xdcr:debug,2012-08-28T14:43:47.258,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:xdc_rep_manager:xdc_replication_sup:stop_replication:49]all replications for DocId &amp;lt;&amp;lt;&amp;quot;1d38c26cdc5c5bb0e6be126e8ae272be/default/default&amp;quot;&amp;gt;&amp;gt; have been stopped&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
[ns_server:debug,2012-08-28T14:43:47.259,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.2113.0&amp;gt;:ns_pubsub:do_subscribe_link:134]Parent process of subscription {ns_config_events,&amp;lt;0.2112.0&amp;gt;} exited with reason shutdown&lt;br/&gt;
[ns_server:debug,2012-08-28T14:43:47.260,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.2113.0&amp;gt;:ns_pubsub:do_subscribe_link:149]Deleting {ns_config_events,&amp;lt;0.2112.0&amp;gt;} event handler: ok&lt;br/&gt;
[xdcr:debug,2012-08-28T14:43:47.296,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.11655.0&amp;gt;:xdc_vbucket_rep_worker:find_missing:121]after conflict resolution at target (&amp;quot;&lt;a href=&quot;http://Administrator:&quot;&gt;http://Administrator:&lt;/a&gt;&lt;a href=&apos;mailto:asdasd@127.0.0.1&apos;&gt;asdasd@127.0.0.1&lt;/a&gt;:9501/default%2f87%3b5816\&lt;br/&gt;
f256233b9dffc119c2c32325a512/&amp;quot;), out of all 396 docs the number of docs we need to replicate is: 396&lt;br/&gt;
[couchdb:info,2012-08-28T14:43:47.304,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.1858.0&amp;gt;:couch_log:info:39]checkpointing view update at seq 5 for _replicator _design/_replicator_info&lt;br/&gt;
[couchdb:info,2012-08-28T14:43:47.320,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.1852.0&amp;gt;:couch_log:info:39]127.0.0.1 - - GET /_replicator/_design/_replicator_info/_view/infos?group_level=1&amp;amp;_=1346179427278 200&lt;br/&gt;
[ns_server:debug,2012-08-28T14:44:00.037,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:compaction_daemon:compaction_daemon:handle_info:269]Starting compaction for the following buckets: &lt;br/&gt;
[&amp;lt;&amp;lt;&amp;quot;default&amp;quot;&amp;gt;&amp;gt;]&lt;br/&gt;
[ns_server:info,2012-08-28T14:44:00.074,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.13612.0&amp;gt;:compaction_daemon:try_to_cleanup_indexes:439]Cleaning up indexes for bucket `default`&lt;br/&gt;
[ns_server:info,2012-08-28T14:44:00.164,&lt;a href=&apos;mailto:n_0@127.0.0.1&apos;&gt;n_0@127.0.0.1&lt;/a&gt;:&amp;lt;0.13612.0&amp;gt;:compaction_daemon:spawn_bucket_compactor:404]Compacting bucket default with config: &lt;br/&gt;
[{database_fragmentation_threshold,{30,undefined}},&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="37107" author="junyi" created="Tue, 28 Aug 2012 14:00:02 -0500"  >&lt;a href=&quot;http://review.couchbase.org/#/c/20196/5&quot;&gt;http://review.couchbase.org/#/c/20196/5&lt;/a&gt;</comment>
                    <comment id="37168" author="thuan" created="Tue, 28 Aug 2012 19:02:28 -0500"  >Integrated in github-ns-server-2-0 #456 (See [&lt;a href=&quot;http://qa.hq.northscale.net/job/github-ns-server-2-0/456/&quot;&gt;http://qa.hq.northscale.net/job/github-ns-server-2-0/456/&lt;/a&gt;])&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://www.couchbase.com/issues/browse/MB-6041&quot; title=&quot;XDC replication keeps on replicating even after replication document is removed&quot;&gt;&lt;strike&gt;MB-6041&lt;/strike&gt;&lt;/a&gt;: add logs to time replication stop (Revision 1b1cf1f99f6e84b0baaa90a9ac2504b46e1d583a)&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Result = SUCCESS&lt;br/&gt;
Junyi Xie : &lt;br/&gt;
Files : &lt;br/&gt;
* src/xdc_rep_manager.erl&lt;br/&gt;
* src/xdc_replication_sup.erl&lt;br/&gt;
</comment>
                </comments>
                    <attachments>
                    <attachment id="14168" name="ns-diag-20120727231728.txt.xz" size="676520" author="Aliaksey Artamonau" created="Fri, 27 Jul 2012 15:26:46 -0500" />
                    <attachment id="14563" name="ns-diag-20120823192112.txt.bz2" size="1852821" author="Aliaksey Artamonau" created="Thu, 23 Aug 2012 11:23:43 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                        <customfield id="customfield_10180" key="com.atlassian.jira.ext.charting:firstresponsedate">
                <customfieldname>Date of First Response</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>Fri, 27 Jul 2012 14:59:57 -0500</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                                                                                                                                                                <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>4552</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                                                                                                                                        <customfield id="customfield_10181" key="com.atlassian.jira.ext.charting:timeinstatus">
                <customfieldname>Time In Status</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                    </customfields>
    </item>
</channel>
</rss>