<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Tue May 21 13:42:24 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-7262/MB-7262.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-7262] curr_items after deleting/recreating a bucket on bidirectional xdcr setup seems inconsistent</title>
                <link>http://www.couchbase.com/issues/browse/MB-7262</link>
                <project id="10010" key="MB">Couchbase Server</project>
                        <description>Steps to reproduce:&lt;br/&gt;
&lt;br/&gt;
1. Create a 4node cluster cl1 with default bucket (1024 vbuckets, 1 replica)&lt;br/&gt;
2. Create a 4node cluster cl2 with default bucket (1024 vbuckets, 1 replica)&lt;br/&gt;
3. Setup bidirectional XDCR for the default bucket on cl1, cl2&lt;br/&gt;
4. Load 10k items to cl1 default bucket. &lt;br/&gt;
5. Verify both cl1, cl2 have 10k items after a while(xdcr replication)&lt;br/&gt;
6. Delete and recreate bucket default on cl1.&lt;br/&gt;
7. Add 3 documents to cl2 default bucket.&lt;br/&gt;
8. Total number of documents in default bucket on cl1 is 29 and on cl2 is 10003(expected).&lt;br/&gt;
&lt;br/&gt;
The curr_items on cl1(i.e 29) seems little strange. &lt;br/&gt;
&lt;br/&gt;
The cluster is available if you want to take a look:&lt;br/&gt;
cl1 - 10.3.2.57&lt;br/&gt;
cl2 - 10.3.3.95</description>
                <environment>build#1965</environment>
            <key id="20939">MB-7262</key>
            <summary>curr_items after deleting/recreating a bucket on bidirectional xdcr setup seems inconsistent</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/critical.png">Critical</priority>
                    <status id="6" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/closed.png">Closed</status>
                    <resolution id="3">Duplicate</resolution>
                    <security id="10011">Public</security>
                        <assignee username="dipti">Dipti Borkar</assignee>
                                <reporter username="deepkaran.salooja">Deepkaran Salooja</reporter>
                        <labels>
                        <label>2.0-release-notes</label>
                    </labels>
                <created>Mon, 26 Nov 2012 12:12:31 -0600</created>
                <updated>Wed, 10 Apr 2013 04:48:40 -0500</updated>
                    <resolved>Thu, 6 Dec 2012 19:05:54 -0600</resolved>
                            <version>2.0</version>
                                <fixVersion>2.1</fixVersion>
                                <component>cross-datacenter-replication</component>
                                <votes>0</votes>
                        <watches>3</watches>
                                                    <comments>
                    <comment id="44753" author="ketaki" created="Mon, 26 Nov 2012 13:34:24 -0600"  >Abhinav, &lt;br/&gt;
&lt;br/&gt;
Can you repro this and add information on this?&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="44791" author="abhinav" created="Mon, 26 Nov 2012 14:39:49 -0600"  >On reproducing this:&lt;br/&gt;
- After the bucket is deleted, and upon recreation of the bucket, I delete and recreate replication as well, replication worked as expected.&lt;br/&gt;
- However I did notice one thing (when I do not recreate the replication), from the original description of the bug, at stage 7: Upon adding 3 items, 27 items were replicated to c1.&lt;br/&gt;
- After this, when i delete and recreate replication on c2, the correct number of items were replicated on c1.&lt;br/&gt;
- Moving on, added 3 items on c1 (currently 10006 items), the 3 items weren&amp;#39;t replicated to c2 (as after recreation of bucket on c1, replication wasn&amp;#39;t re-setup, replicating just shows as &amp;quot;starting-up&amp;quot;), upon re-setting up the replication on c1, the right number of items were replicated to c2.&lt;br/&gt;
- Deleted the bucket on c2 now: No replication errors seen on c1 (for about 15min)&lt;br/&gt;
- After recreating the bucket on c2, the replication from c2 stays in &amp;quot;starting-up&amp;quot; state, while replication on c1 says &amp;quot;replicating&amp;quot;, but no items replicated.&lt;br/&gt;
- Add 3 items on c1, 37 items somehow replicated to c2, against c1&amp;#39;s now 10009.&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- 3 XDCR errors on c1:&lt;br/&gt;
&lt;br/&gt;
2012-11-26 12:37:01 - Error replicating vbucket 537: {bad_return_value, {db_not_found, &amp;lt;&amp;lt;&amp;quot;&lt;a href=&quot;http://Administrator:*****@10.3.121.127:8092/default%2f537%3baabf41c1fa84ae48124892ea6cf855e7/&quot;&gt;http://Administrator:*****@10.3.121.127:8092/default%2f537%3baabf41c1fa84ae48124892ea6cf855e7/&lt;/a&gt;&amp;quot;&amp;gt;&amp;gt;}}&lt;br/&gt;
2012-11-26 12:35:51 - Error replicating vbucket 246: {bad_return_value, {db_not_found, &amp;lt;&amp;lt;&amp;quot;&lt;a href=&quot;http://Administrator:*****@10.1.3.237:8092/default%2f246%3baabf41c1fa84ae48124892ea6cf855e7/&quot;&gt;http://Administrator:*****@10.1.3.237:8092/default%2f246%3baabf41c1fa84ae48124892ea6cf855e7/&lt;/a&gt;&amp;quot;&amp;gt;&amp;gt;}}&lt;br/&gt;
2012-11-26 12:26:13 - Error replicating vbucket 770: {bad_return_value, {db_not_found, &amp;lt;&amp;lt;&amp;quot;&lt;a href=&quot;http://Administrator:*****@10.3.2.55:8092/default%2f770%3baabf41c1fa84ae48124892ea6cf855e7/&quot;&gt;http://Administrator:*****@10.3.2.55:8092/default%2f770%3baabf41c1fa84ae48124892ea6cf855e7/&lt;/a&gt;&amp;quot;&amp;gt;&amp;gt;}}&lt;br/&gt;
&lt;br/&gt;
- Recreate replication on c1: items start replicating to c2, and replication completes successfully.&lt;br/&gt;
- Replication on c2 however still says &amp;quot;starting-up&amp;quot; and this changes to &amp;quot;replicating&amp;quot; only upon recreating the replication.</comment>
                    <comment id="44801" author="junyi" created="Mon, 26 Nov 2012 16:03:56 -0600"  >This is a corner case touching the dark side of bucket identity management in XDCR (probably a generic issue in couchbase server).&lt;br/&gt;
&lt;br/&gt;
This happens only when&lt;br/&gt;
&lt;br/&gt;
1) you delete a bucket during an inbound ongoing replication, without deleting the replication first,  and immediately create another one with the same name&lt;br/&gt;
and&lt;br/&gt;
2) after you re-create the bucket with the same name, you load some data on the source to wake up some vb replicators&lt;br/&gt;
&lt;br/&gt;
IMHO, the expected behavior is that no replication should happen after you re-create the bucket, because even with the same name, they are considered completely different buckets and thus no replication should resume. &lt;br/&gt;
&lt;br/&gt;
Today XDCR does not check the UUID and make sure the remote cluster is still the old one when replicator is initialized. Instead, it is just trying fetch the remote cluster and start replicating. In short, we do not maintain the identity of remote cluster during XDCR, although we do that during replication of single vb replicator.  In this test case filed by Deepkaran,  data loading at step 7 woke up few vb replicators at C2, and they started replication without checking the bucket identity change at the other side. &lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
Some thoughts to fix the issue&lt;br/&gt;
&lt;br/&gt;
First of all, today we should recommend or requite users to delete any bucket only AFTER the users have deleted all XDCR toward that bucket. It is not clear to me to how to identify an inbound XDCR for a bucket since the incoming traffic from XDCR is just a stream of setMeta/getMeta/deleteWithMeta&lt;br/&gt;
&lt;br/&gt;
Second, probably we should maintain the remote bucket identity for the whole XDCR, instead of single vb replicator. Say, we can store the UUID of remote bucket when XDCR is created, and each time when vb replicator is initialized we should check to make sure the remote bucket UUID does not change.&lt;br/&gt;
&lt;br/&gt;
This fix may possibly involve change in both XDCR and remote_cluster_info module. At this time, it does not look a blocker to me, and I would like to defer the fix to 2.0.1 given the limited timing.  &lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="45505" author="kzeller" created="Wed, 5 Dec 2012 14:38:23 -0600"  >Added to RN as:&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Be aware that if you are using XDCR for replication to a destination bucket and you remove and create a &lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new bucket with the same name, it has a different UUIDs. Therefore any replication you had established &lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;with the deleted bucket will not apply to the new bucket.&lt;br/&gt;
&lt;br/&gt;
Will add to XDCR chapter.</comment>
                    <comment id="45507" author="junyi" created="Wed, 5 Dec 2012 14:49:12 -0600"  >Karen / Dipti,&lt;br/&gt;
&lt;br/&gt;
What Karen said is what I wanted but today the Couchbase server itself does not have consistent way to identify bucket. Within XDCR, we use UUID to identify a bucket and post docs to that bucket, but this does not apply for normal front-end operations. For example, if you are loading some data to a bucket, in the middle of which you delete it and recreate a new bucket with the same name,  you are still able to continue loading your data to the new bucket. That essentially means we still use the name to identify a bucket in some cases.&lt;br/&gt;
&lt;br/&gt;
Within XDCR, either using UUID or name as bucket identifier is OK with me, but we need to be consistent that the XDCR behavior is consistent with other Couchbase Server components.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
Dipti,&lt;br/&gt;
&lt;br/&gt;
I put this bug on hold and hand it over to you.  You may want to talk to ns_server team to find out which way to go, then XDCR will fix this issue accordingly.&lt;br/&gt;
&lt;br/&gt;
Thanks,&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="45629" author="junyi" created="Thu, 6 Dec 2012 19:04:57 -0600"  >We already have one bug handling bucket identity issue. This one is a duplicate to &lt;a href=&quot;http://www.couchbase.com/issues/browse/MB-7266&quot; title=&quot;XDCR never starts up after deletion and recreation of bucket (with the same name) in a unidirectional scenario&quot;&gt;&lt;strike&gt;MB-7266&lt;/strike&gt;&lt;/a&gt;. </comment>
                    <comment id="45630" author="junyi" created="Thu, 6 Dec 2012 19:05:54 -0600"  >&lt;a href=&quot;http://www.couchbase.com/issues/browse/MB-7266&quot; title=&quot;XDCR never starts up after deletion and recreation of bucket (with the same name) in a unidirectional scenario&quot;&gt;&lt;strike&gt;MB-7266&lt;/strike&gt;&lt;/a&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                        <customfield id="customfield_10180" key="com.atlassian.jira.ext.charting:firstresponsedate">
                <customfieldname>Date of First Response</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>Mon, 26 Nov 2012 13:34:24 -0600</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>3380</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>