<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:51:30 UTC 2024

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 append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-19600] Upsert results in E11000 duplicate key error</title>
                <link>https://jira.mongodb.org/browse/SERVER-19600</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I&apos;m basically upserting documents that has random sid 1..100, and then update the hit counter on them. &lt;/p&gt;

&lt;p&gt;So the document looks like that:&lt;/p&gt;
{
&apos;sid&apos;: 23,
&apos;status&apos;: &apos;active&apos;
&apos;hit&apos;: 12
}

&lt;p&gt;A timer changes the status field from &apos;active&apos; to something else occasionally.&lt;/p&gt;

&lt;p&gt;That program runs successfully on mongodb 3.0.4 with MMAPv1 engine, but throws E11000 errors with wiredtiger.&lt;/p&gt;

&lt;p&gt;javascript code to replicate:&lt;br/&gt;
&lt;a href=&quot;https://github.com/yurynix/mongodb-upsert-test&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/yurynix/mongodb-upsert-test&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It&apos;s a reduced case of my more complicated python code (pymongo 3.0.3), which has the same problem.&lt;/p&gt;

&lt;p&gt;expected result:&lt;br/&gt;
&lt;a href=&quot;https://github.com/yurynix/mongodb-upsert-test/blob/master/expected.txt&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/yurynix/mongodb-upsert-test/blob/master/expected.txt&lt;/a&gt;&lt;br/&gt;
(thats the result with the default engine)&lt;/p&gt;

&lt;p&gt;actual result:&lt;br/&gt;
&lt;a href=&quot;https://github.com/yurynix/mongodb-upsert-test/blob/master/actual.txt&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/yurynix/mongodb-upsert-test/blob/master/actual.txt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br/&gt;
Yury.&lt;/p&gt;</description>
                <environment>Ubuntu 14.04 3.16.0-43 64bit, 16GB RAM, i5-4690 CPU @ 3.50GHz</environment>
        <key id="222809">SERVER-19600</key>
            <summary>Upsert results in E11000 duplicate key error</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="ramon.fernandez@mongodb.com">Ramon Fernandez Marina</assignee>
                                    <reporter username="yurynix">Yury Michurin</reporter>
                        <labels>
                            <label>concurrency</label>
                    </labels>
                <created>Mon, 27 Jul 2015 13:24:07 +0000</created>
                <updated>Fri, 14 Aug 2015 01:03:35 +0000</updated>
                            <resolved>Thu, 30 Jul 2015 18:41:47 +0000</resolved>
                                                                    <component>WiredTiger</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1001921" author="ivan.fioravanti@4ward.it" created="Tue, 11 Aug 2015 14:56:52 +0000"  >&lt;p&gt;We are experiencing the same issue with C# client, I voted for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-14322&quot; title=&quot;Retry on predicate unique index violations of update + upsert -&amp;gt; insert when possible&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-14322&quot;&gt;&lt;del&gt;SERVER-14322&lt;/del&gt;&lt;/a&gt; right now. In the meantime we will revert to MMAPv1&lt;/p&gt;</comment>
                            <comment id="993207" author="ramon.fernandez" created="Thu, 30 Jul 2015 18:41:25 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=yurynix&quot; class=&quot;user-hover&quot; rel=&quot;yurynix&quot;&gt;yurynix&lt;/a&gt;; you&apos;re right, this looks like a case of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-14322&quot; title=&quot;Retry on predicate unique index violations of update + upsert -&amp;gt; insert when possible&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-14322&quot;&gt;&lt;del&gt;SERVER-14322&lt;/del&gt;&lt;/a&gt;. Unfortunately the only way to work around this issue at the moment is to retry the operation at the application level. It is possible that the issue is also present in MMAPv1, but it&apos;s much harder to trigger &amp;#8211; WiredTiger provides much better concurrency, which is what makes this issue appear.&lt;/p&gt;

&lt;p&gt;I&apos;m going to close this ticket as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-14322&quot; title=&quot;Retry on predicate unique index violations of update + upsert -&amp;gt; insert when possible&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-14322&quot;&gt;&lt;del&gt;SERVER-14322&lt;/del&gt;&lt;/a&gt;. Please feel free to vote for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-14322&quot; title=&quot;Retry on predicate unique index violations of update + upsert -&amp;gt; insert when possible&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-14322&quot;&gt;&lt;del&gt;SERVER-14322&lt;/del&gt;&lt;/a&gt; and watch it for further updates.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Ram&#243;n.&lt;/p&gt;</comment>
                            <comment id="989543" author="yurynix" created="Mon, 27 Jul 2015 14:14:08 +0000"  >&lt;p&gt;Ok, after further investigation, it looks like a duplicate of:&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-14322&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-14322&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I guess. &lt;br/&gt;
Still kind of weird that:&lt;br/&gt;
1. Upsert doesn&apos;t handle that for me and I should perform a retry in client code.&lt;br/&gt;
2. It only reproduces in wiredtiger for me.&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="143209">SERVER-14322</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="225416">SERVER-19920</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 30 Jul 2015 18:41:25 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 27 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>stephen.steneker@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 27 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>ivan.fioravanti@4ward.it</customfieldvalue>
            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>
            <customfieldvalue>yurynix</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkzev:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsc567:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;&lt;a href=&quot;https://github.com/yurynix/mongodb-upsert-test&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/yurynix/mongodb-upsert-test&lt;/a&gt;&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hsfti7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>