<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:02:44 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-3319] insert bulk doesn&apos;t fail on duplicate, but also doesn&apos;t change the data</title>
                <link>https://jira.mongodb.org/browse/SERVER-3319</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;sometimes running a bulk insert right after an upsert(with the $set command) will result in the document containing only the data from the upsert and not the data from the insert, and the insert doesn&apos;t throw duplicate exception.&lt;br/&gt;
I wasn&apos;t able to reproduce on windows environment. only on linux shard.&lt;br/&gt;
The collection is sharded, the cluster has 3 shards, each with has a replica set. connection is using mongos.&lt;/p&gt;</description>
                <environment>CentOS 5.5, 64GB RAM, HW RAID10 w/BBU , XFS for mongo data folder (mount with nobarriers,noatime)</environment>
        <key id="18602">SERVER-3319</key>
            <summary>insert bulk doesn&apos;t fail on duplicate, but also doesn&apos;t change the data</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</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="9">Done</resolution>
                                        <assignee username="spencer@mongodb.com">Spencer Brody</assignee>
                                    <reporter username="oferfort">ofer fort</reporter>
                        <labels>
                            <label>concurrency</label>
                            <label>mongos</label>
                            <label>sharding</label>
                    </labels>
                <created>Thu, 23 Jun 2011 13:23:44 +0000</created>
                <updated>Tue, 12 Jul 2016 00:18:23 +0000</updated>
                            <resolved>Mon, 19 Sep 2011 16:13:42 +0000</resolved>
                                    <version>1.8.2</version>
                    <version>2.0.0</version>
                                    <fixVersion>2.1.0</fixVersion>
                                    <component>Concurrency</component>
                    <component>Sharding</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="55102" author="auto" created="Mon, 19 Sep 2011 16:13:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;stbrody&apos;, u&apos;name&apos;: u&apos;Spencer T Brody&apos;, u&apos;email&apos;: u&apos;spencer@10gen.com&apos;}
&lt;p&gt;Message: Fix bug where bulk inserts on sharded collection were sent as a series of single inserts. &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3319&quot; title=&quot;insert bulk doesn&amp;#39;t fail on duplicate, but also doesn&amp;#39;t change the data&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3319&quot;&gt;&lt;del&gt;SERVER-3319&lt;/del&gt;&lt;/a&gt;.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c85b73a1b0ebdf115f0818bf22f352f92a2c6121&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c85b73a1b0ebdf115f0818bf22f352f92a2c6121&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="54086" author="spencer" created="Wed, 14 Sep 2011 18:33:08 +0000"  >&lt;p&gt;There may a be a very slight performance improvement, but it will be very small - probably unnoticeable in most cases - because the writes were asynchronous anyway.&lt;/p&gt;</comment>
                            <comment id="53827" author="oferfort" created="Tue, 13 Sep 2011 20:41:29 +0000"  >&lt;p&gt;great, i hope it would also improve performance?&lt;/p&gt;</comment>
                            <comment id="53824" author="spencer" created="Tue, 13 Sep 2011 20:36:51 +0000"  >&lt;p&gt;The problem is that when doing a multi-insert with sharding, the mongos sends it as a series of single inserts to each shard.  The fix should be to group documents based on their destination shard, then send multi-inserts to each shard.&lt;/p&gt;</comment>
                            <comment id="53626" author="oferfort" created="Tue, 13 Sep 2011 05:44:24 +0000"  >&lt;p&gt;Great!&lt;br/&gt;
Let me know if I can assist in anything&lt;/p&gt;



&lt;p&gt;&#1489;-13 &#1489;&#1505;&#1508;&#1496; 2011, &#1489;&#1513;&#1506;&#1492; 01:52, &quot;Spencer Brody (JIRA)&quot; &amp;lt;jira@mongodb.org&amp;gt; &#1499;&#1514;&#1489;/&#1492;:&lt;/p&gt;


&lt;p&gt;   [&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;amp;focusedCommentId=53567#comment-53567&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-3319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;amp;focusedCommentId=53567#comment-53567&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;Spencer Brody commented on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3319&quot; title=&quot;insert bulk doesn&amp;#39;t fail on duplicate, but also doesn&amp;#39;t change the data&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3319&quot;&gt;&lt;del&gt;SERVER-3319&lt;/del&gt;&lt;/a&gt;:&lt;br/&gt;
---------------------------------------&lt;/p&gt;

&lt;p&gt;I have successfully reproduced the problem.  Tomorrow I will dig into trying&lt;br/&gt;
to figure out the cause.&lt;/p&gt;

&lt;p&gt;insert bulk doesn&apos;t fail on duplicate, but also doesn&apos;t change the data&lt;/p&gt;

&lt;p&gt;-----------------------------------------------------------------------&lt;/p&gt;


&lt;p&gt;               Key: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3319&quot; title=&quot;insert bulk doesn&amp;#39;t fail on duplicate, but also doesn&amp;#39;t change the data&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3319&quot;&gt;&lt;del&gt;SERVER-3319&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;               URL: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3319&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-3319&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;           Project: Core Server&lt;/p&gt;

&lt;p&gt;        Issue Type: Bug&lt;/p&gt;

&lt;p&gt;        Components: Concurrency, sharding&lt;/p&gt;

&lt;p&gt;  Affects Versions: 1.8.2&lt;/p&gt;

&lt;p&gt;       Environment: CentOS 5.5, 64GB RAM, HW RAID10 w/BBU , XFS for mongo&lt;br/&gt;
data folder (mount with nobarriers,noatime)&lt;/p&gt;

&lt;p&gt;          Reporter: ofer fort&lt;/p&gt;

&lt;p&gt;          Assignee: Spencer Brody&lt;/p&gt;

&lt;p&gt;          Priority: Critical&lt;/p&gt;

&lt;p&gt;            Labels: concurrency, mongos, sharding&lt;/p&gt;

&lt;p&gt;           Fix For: debugging with submitter&lt;/p&gt;


&lt;p&gt;       Attachments: MongoTester.java&lt;/p&gt;



&lt;p&gt;sometimes running a bulk insert right after an upsert(with the $set command)&lt;br/&gt;
will result in the document containing only the data from the upsert and not&lt;br/&gt;
the data from the insert, and the insert doesn&apos;t throw duplicate exception.&lt;/p&gt;

&lt;p&gt;I wasn&apos;t able to reproduce on windows environment. only on linux shard.&lt;/p&gt;

&lt;p&gt;The collection is sharded, the cluster has 3 shards, each with has a replica&lt;br/&gt;
set. connection is using mongos.&lt;/p&gt;


&lt;p&gt;&amp;#8211;&lt;br/&gt;
This message is automatically generated by JIRA.&lt;br/&gt;
For more information on JIRA, see: &lt;a href=&quot;http://www.atlassian.com/software/jira&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.atlassian.com/software/jira&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="53567" author="spencer" created="Mon, 12 Sep 2011 22:51:59 +0000"  >&lt;p&gt;I have successfully reproduced the problem.  Tomorrow I will dig into trying to figure out the cause.&lt;/p&gt;</comment>
                            <comment id="53561" author="oferfort" created="Mon, 12 Sep 2011 21:54:37 +0000"  >&lt;p&gt;yes, you are right.&lt;br/&gt;
my shard key is _id, which is a sequential number i&apos;m setting.&lt;/p&gt;</comment>
                            <comment id="53558" author="spencer" created="Mon, 12 Sep 2011 21:47:32 +0000"  >&lt;p&gt;Yes, of the environment where you got this attached test case to fail.&lt;/p&gt;

&lt;p&gt;Just to confirm, with this test case, if I see &quot;insert failed due to duplicate!!&lt;span class=&quot;error&quot;&gt;Unable to render embedded object: File (&amp;quot; then things are working as intended, but if I see &amp;quot;OUR PROPERTIES ARE NOT THERE) not found.&lt;/span&gt;!!&quot; then I&apos;ve reproduced the bug?&lt;/p&gt;

&lt;p&gt;What is your shard key?  _id?&lt;/p&gt;</comment>
                            <comment id="53541" author="oferfort" created="Mon, 12 Sep 2011 20:45:04 +0000"  >&lt;p&gt;of the test environment? it might take some time till i can set it up again&lt;/p&gt;</comment>
                            <comment id="53539" author="spencer" created="Mon, 12 Sep 2011 20:40:26 +0000"  >&lt;p&gt;Can you attach the output of db.printShardingStatus()?&lt;/p&gt;</comment>
                            <comment id="38889" author="infin1ty" created="Thu, 23 Jun 2011 15:36:07 +0000"  >&lt;p&gt;I have managed to reproduce this error in a test environment.&lt;br/&gt;
tried with 3 config servers (after that with 1 config server), 3 shards and one mongos.&lt;br/&gt;
I have also tried with both replicasets and without replicasets (per shard).&lt;br/&gt;
The only error i can see is this:&lt;br/&gt;
Thu Jun 23 14:15:59 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn4&amp;#93;&lt;/span&gt; delete failed b/c of StaleConfigException, retrying  left:4 ns: storage.object patt: { _id: &lt;/p&gt;
{ $lt: 15 }
&lt;p&gt; }&lt;br/&gt;
Using a non-sharded server (stand-alone mongod) it works as expected (i get failed due to duplicate)&lt;/p&gt;
</comment>
                    </comments>
                    <attachments>
                            <attachment id="12113" name="MongoTester.java" size="4055" author="oferfort" created="Thu, 23 Jun 2011 13:23:44 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 23 Jun 2011 15:36:07 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 22 weeks, 2 days 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 22 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>auto</customfieldvalue>
            <customfieldvalue>infin1ty</customfieldvalue>
            <customfieldvalue>oferfort</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrox3b:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8850</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_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|ht0dyv:</customfieldvalue>

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