<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:12:27 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>[CDRIVER-1414] Add mongoc_write_concern_t to mongoc_cursor_t</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-1414</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;I&apos;m accepting &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/358&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Pull Request 358&lt;/a&gt;, which adds mongoc_collection_aggregate_with_write_concern, but I noticed a problem. The algorithm there is:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Select a server&lt;/li&gt;
	&lt;li&gt;If its wire version is 5+ and the user passed a write concern, append it to the command document&lt;/li&gt;
	&lt;li&gt;Create a cursor with the command document&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Then, as always, when the user runs mongoc_cursor_next, its algorithm is:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Select a server&lt;/li&gt;
	&lt;li&gt;Send the command document to the server&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But the two selections may select different members of the replica set or different mongos servers in a sharded cluster, and these servers may have different wire versions!&lt;/p&gt;

&lt;p&gt;Instead, let&apos;s add a mongoc_write_concern_t to mongoc_cursor_t, similar to the read prefs and read concern it has already. Whenever a cursor is created, &lt;b&gt;if and only if it&apos;s created by one of the command helpers whose names end in &lt;tt&gt;_with_write_concern&lt;/tt&gt;&lt;/b&gt;, set the cursor&apos;s write concern. Don&apos;t append it to the command document yet.&lt;/p&gt;

&lt;p&gt;Then, when the user calls mongoc_cursor_next it calls _mongoc_cursor_cursorid_refresh_from_command which calls _mongoc_cursor_run_command. In there we get a server stream and know its wire version for certain. If it&apos;s 5+ and cursor-&amp;gt;write_concern is not NULL or the default, append the write concern to the command before the call to mongoc_cluster_run_command_monitored.&lt;/p&gt;</description>
                <environment></environment>
        <key id="303957">CDRIVER-1414</key>
            <summary>Add mongoc_write_concern_t to mongoc_cursor_t</summary>
                <type id="5" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14716&amp;avatarType=issuetype">Sub-task</type>
                            <parent id="293112">CDRIVER-1322</parent>
                                    <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="9">Done</resolution>
                                        <assignee username="fiona.rowan@mongodb.com">Fiona Rowan</assignee>
                                    <reporter username="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Jul 2016 01:26:23 +0000</created>
                <updated>Wed, 10 Aug 2016 22:10:37 +0000</updated>
                            <resolved>Thu, 4 Aug 2016 01:12:59 +0000</resolved>
                                                    <fixVersion>1.4.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1344527" author="xgen-internal-githook" created="Tue, 2 Aug 2016 14:24:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@emptysquare.net&apos;}
&lt;p&gt;Message: Merge pull request #380 from fionaRowan/C-1414&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1414&quot; title=&quot;Add mongoc_write_concern_t to mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1414&quot;&gt;&lt;del&gt;CDRIVER-1414&lt;/del&gt;&lt;/a&gt;: parse writeConcernErrors in command helper&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/98713feddcc334e667c0f7a0cff82c4f5a900dcd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/98713feddcc334e667c0f7a0cff82c4f5a900dcd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1344526" author="xgen-internal-githook" created="Tue, 2 Aug 2016 14:24:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;name&apos;: u&apos;Fiona Rowan&apos;, u&apos;email&apos;: u&apos;fiona.rowan@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1414&quot; title=&quot;Add mongoc_write_concern_t to mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1414&quot;&gt;&lt;del&gt;CDRIVER-1414&lt;/del&gt;&lt;/a&gt;: parse writeConcernErrors in command helper&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/954b787f6217b69c2a6b7dee432654d27a5f741c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/954b787f6217b69c2a6b7dee432654d27a5f741c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1342197" author="xgen-internal-githook" created="Sat, 30 Jul 2016 12:53:42 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@emptysquare.net&apos;}
&lt;p&gt;Message: Merge pull request #372 from fionaRowan/&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1414&quot; title=&quot;Add mongoc_write_concern_t to mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1414&quot;&gt;&lt;del&gt;CDRIVER-1414&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1414&quot; title=&quot;Add mongoc_write_concern_t to mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1414&quot;&gt;&lt;del&gt;CDRIVER-1414&lt;/del&gt;&lt;/a&gt;: add mongoc_write_concern_t to mongoc_cursor_t&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/6fcafbec048982eaf2f622178c366d53d25fcf75&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/6fcafbec048982eaf2f622178c366d53d25fcf75&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1342196" author="xgen-internal-githook" created="Sat, 30 Jul 2016 12:53:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@emptysquare.net&apos;}
&lt;p&gt;Message: Merge pull request #372 from fionaRowan/&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1414&quot; title=&quot;Add mongoc_write_concern_t to mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1414&quot;&gt;&lt;del&gt;CDRIVER-1414&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1414&quot; title=&quot;Add mongoc_write_concern_t to mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1414&quot;&gt;&lt;del&gt;CDRIVER-1414&lt;/del&gt;&lt;/a&gt;: add mongoc_write_concern_t to mongoc_cursor_t&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/6fcafbec048982eaf2f622178c366d53d25fcf75&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/6fcafbec048982eaf2f622178c366d53d25fcf75&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1342195" author="xgen-internal-githook" created="Sat, 30 Jul 2016 12:53:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;name&apos;: u&apos;Fiona Rowan&apos;, u&apos;email&apos;: u&apos;fiona.rowan@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1414&quot; title=&quot;Add mongoc_write_concern_t to mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1414&quot;&gt;&lt;del&gt;CDRIVER-1414&lt;/del&gt;&lt;/a&gt;: add mongoc_write_concern_t to mongoc_cursor_t&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/b0a696036d40e526d1ef9c9f8512361b398f8308&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/b0a696036d40e526d1ef9c9f8512361b398f8308&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsnofb:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="970">C Driver 2016 sprint 5</customfieldvalue>
    <customfieldvalue id="1164">C Driver 2016 sprint 6</customfieldvalue>
    <customfieldvalue id="1203">C Driver 2016 sprint 7</customfieldvalue>

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