<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:59:45 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-22218] Push opeartion failed if push and upsert for same document were built into same BulkOperation execution</title>
                <link>https://jira.mongodb.org/browse/SERVER-22218</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Two separated opeartion: push and upsert were built in same BulkOperation.&lt;br/&gt;
if two operation will operate on same document, it will cause the push operation failed.&lt;/p&gt;</description>
                <environment>MongoDB 3.0.5&lt;br/&gt;
C++ driver: 1.0.1&lt;br/&gt;
OS: centos 7</environment>
        <key id="259165">SERVER-22218</key>
            <summary>Push opeartion failed if push and upsert for same document were built into same BulkOperation execution</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="4">Incomplete</resolution>
                                        <assignee username="wan.bachtiar@mongodb.com">Wan Bachtiar</assignee>
                                    <reporter username="gabriel.wang">gabriel.wang</reporter>
                        <labels>
                            <label>legacy-cxx</label>
                    </labels>
                <created>Mon, 18 Jan 2016 16:45:14 +0000</created>
                <updated>Thu, 14 Apr 2016 15:17:54 +0000</updated>
                            <resolved>Thu, 4 Feb 2016 22:48:08 +0000</resolved>
                                                                    <component>Concurrency</component>
                    <component>Performance</component>
                    <component>Write Ops</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1164343" author="wan.bachtiar" created="Thu, 4 Feb 2016 22:34:54 +0000"  >&lt;p&gt;Hi Gabriel,&lt;/p&gt;

&lt;p&gt;We haven&#8217;t heard back from you for some time, so I&#8217;m going to mark this ticket as resolved. &lt;br/&gt;
If this is still an issue for you, please feel free to re-open the ticket and provide additional information.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Wan.&lt;/p&gt;</comment>
                            <comment id="1148005" author="wan.bachtiar" created="Tue, 19 Jan 2016 22:59:59 +0000"  >&lt;p&gt;Hi Gabriel, &lt;/p&gt;

&lt;p&gt;I noticed (from your google groups thread) that you are using WiredTiger storage engine. This behaviour may be caused by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21275&quot; title=&quot;Document not found due to WT commit visibility issue&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21275&quot;&gt;&lt;del&gt;SERVER-21275&lt;/del&gt;&lt;/a&gt;, which was fixed in v3.0.8.&lt;br/&gt;
Could you please upgrade to v3.0.8 and try again ? See if that resolves the issue that you are seeing. &lt;/p&gt;

&lt;p&gt;Thanks, &lt;br/&gt;
Wan.&lt;/p&gt;</comment>
                            <comment id="1147215" author="gabriel.wang" created="Tue, 19 Jan 2016 14:23:21 +0000"  >&lt;p&gt;Hi Wan,&lt;/p&gt;

&lt;p&gt;Thanks for your prompt response.&lt;/p&gt;

&lt;p&gt;I thought this issue related to server because the most work of bulk operation happen on server side.&lt;/p&gt;

&lt;p&gt;As you mentioned about the bulkOpereation mode and the real order of $push and $set operation. &lt;br/&gt;
In my project,  I have set the bulk Operation as ordered mode when I initialize it by call:&lt;/p&gt;

&lt;p&gt;BulkOperationBuilder bulk = db_conn_.initializeOrderedBulkOp(db_collection_ns_);&lt;/p&gt;

&lt;p&gt;According to the calling sequence, the $push is the last one operation on a given document. It&apos;s impossible that a $push happen before a $set for a specific document.  Moreover, the $set and $push performed on different fields of a document.&lt;/p&gt;

&lt;p&gt;This issue occurs only when very heavy writing operation on a collection, and about 1/1000 $push operation failed, and most of $push performed correctly.  &lt;/p&gt;

&lt;p&gt;Thanks for your help in advance.&lt;/p&gt;</comment>
                            <comment id="1146885" author="wan.bachtiar" created="Tue, 19 Jan 2016 05:48:48 +0000"  >&lt;p&gt;Hi Gabriel, &lt;/p&gt;

&lt;p&gt;I have tested the BulkOperationBuilder for mongo-cxx-driver legacy v1.0.1. It behaves as expected. &lt;/p&gt;

&lt;p&gt;In your case, you may want to specify whether you would like an ordered or unordered bulk operation. You can specify this option with either the initialisation methods or the constructor. See &lt;a href=&quot;http://api.mongodb.org/cxx/legacy-1.0.1/classmongo_1_1_bulk_operation_builder.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;BulkOperationBuilder class reference&lt;/a&gt; for more info.&lt;/p&gt;

&lt;p&gt;Example of using the constructor:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongo::BulkOperationBuilder p_builder(conn, collection_namespace, ordered_bool);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;If you are using an unordered bulk operation, and when the &lt;tt&gt;$push&lt;/tt&gt; operation is being executed first before the &lt;tt&gt;$set&lt;/tt&gt;, the &lt;tt&gt;$set&lt;/tt&gt; will overwrite &lt;tt&gt;$push&lt;/tt&gt;. This may appear that the &lt;tt&gt;$push&lt;/tt&gt; operation has not been performed correctly. &lt;/p&gt;

&lt;p&gt;Note that the latest stable version of mongo-cxx-legacy driver is currently &lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/releases/tag/legacy-1.1.0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;v1.1.0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB Server. If you have any follow-up questions on bulk operations ordering, please post on the &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user group&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Kind regards, &lt;/p&gt;

&lt;p&gt;Wan.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 19 Jan 2016 05:48:48 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 1 week, 6 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>
                            8 years, 1 week, 6 days 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>gabriel.wang</customfieldvalue>
            <customfieldvalue>wan.bachtiar@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrkkev:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hshh3r:</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;BulkOperationBuilder p_builder&lt;br/&gt;
  p_builder.find(queryObj).upsert().updateOne(BSON(&quot;$set&quot;&amp;lt;&amp;lt;bsonObj_1));&lt;br/&gt;
p_builder.find(queryObj).update(BSON(&quot;$push&quot;&amp;lt;&amp;lt;bsonObj_2));&lt;/p&gt;

&lt;p&gt;p_builder.execute()&lt;/p&gt;

&lt;p&gt;If both query hit same document, the push operation didn&apos;t create the  array correctly. &lt;/p&gt;

&lt;p&gt;If move push operation away from bulkOperationBuilder and run it in the non-bulk mode, the array field was created correctly.&lt;br/&gt;
Moreover, even push operation failed in the bulkOpeation mode, there is no exception raised for the bulkOperation.execute(). &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|hsfb6f:</customfieldvalue>

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