<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:28: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-12419] mongos GLE does not work correctly if previous write was from a command</title>
                <link>https://jira.mongodb.org/browse/SERVER-12419</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;... other than write commands.&lt;/p&gt;

&lt;p&gt;For example, if you run the &apos;create&apos; command and call gle, w: 2, it never actually gets sent to the shards!&lt;/p&gt;

&lt;p&gt;We also need to confirm this on other commands that can do writes:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;aggregate (with $out)&lt;/li&gt;
	&lt;li&gt;copydb&lt;/li&gt;
	&lt;li&gt;create&lt;/li&gt;
	&lt;li&gt;drop&lt;/li&gt;
	&lt;li&gt;dropDatabase&lt;/li&gt;
	&lt;li&gt;dropIndexes&lt;/li&gt;
	&lt;li&gt;findAndModify&lt;/li&gt;
	&lt;li&gt;mapReduce (with $out)&lt;/li&gt;
	&lt;li&gt;renameCollection&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;And in this list, we need to make sure the writeConcern parameter works correctly:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;createRole&lt;/li&gt;
	&lt;li&gt;createUser&lt;/li&gt;
	&lt;li&gt;dropAllRolesFromDatabase&lt;/li&gt;
	&lt;li&gt;dropAllUsersFromDatabase&lt;/li&gt;
	&lt;li&gt;dropRole&lt;/li&gt;
	&lt;li&gt;dropUser&lt;/li&gt;
	&lt;li&gt;grantPrivilegesToRole&lt;/li&gt;
	&lt;li&gt;grantRolesToRole&lt;/li&gt;
	&lt;li&gt;grantRolesToUser&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="106983">SERVER-12419</key>
            <summary>mongos GLE does not work correctly if previous write was from a command</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="milkie@mongodb.com">Eric Milkie</assignee>
                                    <reporter username="randolph@mongodb.com">Randolph Tan</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Jan 2014 20:15:18 +0000</created>
                <updated>Mon, 11 Jul 2016 17:19:22 +0000</updated>
                            <resolved>Fri, 31 Jan 2014 13:33:50 +0000</resolved>
                                    <version>2.5.4</version>
                                    <fixVersion>2.5.5</fixVersion>
                                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="493784" author="xgen-internal-githook" created="Wed, 5 Feb 2014 16:14:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;gregstuder&apos;, u&apos;name&apos;: u&apos;Greg Studer&apos;, u&apos;email&apos;: u&apos;greg@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12419&quot; title=&quot;mongos GLE does not work correctly if previous write was from a command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12419&quot;&gt;&lt;del&gt;SERVER-12419&lt;/del&gt;&lt;/a&gt; make mongos write commands report last error&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a1c9bdb119919d53de74c906888a4125ed0a8ab0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a1c9bdb119919d53de74c906888a4125ed0a8ab0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="491192" author="xgen-internal-githook" created="Thu, 30 Jan 2014 23:04:03 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;milkie&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12419&quot; title=&quot;mongos GLE does not work correctly if previous write was from a command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12419&quot;&gt;&lt;del&gt;SERVER-12419&lt;/del&gt;&lt;/a&gt; switch to using a post-command hook to capture gle information&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/751f1101967da3593431f1b41a37867ccb169901&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/751f1101967da3593431f1b41a37867ccb169901&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="491191" author="xgen-internal-githook" created="Thu, 30 Jan 2014 23:04:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;milkie&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12419&quot; title=&quot;mongos GLE does not work correctly if previous write was from a command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12419&quot;&gt;&lt;del&gt;SERVER-12419&lt;/del&gt;&lt;/a&gt; fix error status codes to match what batch_downconvert expects&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0455a09b22d2e5fc7d0fa47e0fd8f83a9d3e03e6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0455a09b22d2e5fc7d0fa47e0fd8f83a9d3e03e6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="490632" author="xgen-internal-githook" created="Thu, 30 Jan 2014 04:19:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;milkie&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12419&quot; title=&quot;mongos GLE does not work correctly if previous write was from a command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12419&quot;&gt;&lt;del&gt;SERVER-12419&lt;/del&gt;&lt;/a&gt; Fix commands from mongos and GLE&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/b24de3a4b00cf2023a99b42c5a7e4ff5c2f0c4f7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/b24de3a4b00cf2023a99b42c5a7e4ff5c2f0c4f7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="490631" author="xgen-internal-githook" created="Thu, 30 Jan 2014 04:19:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;milkie&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12419&quot; title=&quot;mongos GLE does not work correctly if previous write was from a command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12419&quot;&gt;&lt;del&gt;SERVER-12419&lt;/del&gt;&lt;/a&gt; add electionId to mongos batch response structure&lt;/p&gt;

&lt;p&gt;Note that this will require some modifications/backporting to 2.4.10 for full support.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f83e6f60ab26f037b686d54168376fa1c8df82ce&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f83e6f60ab26f037b686d54168376fa1c8df82ce&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="490630" author="xgen-internal-githook" created="Thu, 30 Jan 2014 04:19:44 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;milkie&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12419&quot; title=&quot;mongos GLE does not work correctly if previous write was from a command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12419&quot;&gt;&lt;del&gt;SERVER-12419&lt;/del&gt;&lt;/a&gt; Add support for electionId in replsets and wElectionId in GLE command&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a40d78d52823547b5cfe8de8b50edb95b45cf902&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a40d78d52823547b5cfe8de8b50edb95b45cf902&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="490629" author="xgen-internal-githook" created="Thu, 30 Jan 2014 04:19:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;milkie&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-12419&quot; title=&quot;mongos GLE does not work correctly if previous write was from a command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-12419&quot;&gt;&lt;del&gt;SERVER-12419&lt;/del&gt;&lt;/a&gt; standardize on one type for HostOpTimeMaps&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/dbc5a216866359da39c9a43a5f52cd28df8cb60c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/dbc5a216866359da39c9a43a5f52cd28df8cb60c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="486799" author="milkie" created="Thu, 23 Jan 2014 21:06:21 +0000"  >&lt;p&gt;Note that this is problematic for talking to 2.4 shards as well.  The code currently only records the ConnectionString and the optime; it doesn&apos;t record the state of the replica set.  So if mongos calls getLastError on 2.4 replica set shards, it may not work correctly if the primary has moved.  &lt;br/&gt;
This problem will be solved by the same fix as above; we will include an election id along with the optime for each shard ConnectionString that we store in our HostOpTimeMap.&lt;/p&gt;</comment>
                            <comment id="485206" author="milkie" created="Tue, 21 Jan 2014 21:22:13 +0000"  >&lt;p&gt;Current plan is to fetch the current internal optime to simulate the current behavior of calling getLastError with a write concern after a non-write command on mongos.  &lt;/p&gt;

&lt;p&gt;Commands on mongod will append the last written optime and the election id (which will uniquely identify a primary&apos;s term) to the command response, if responding to a mongos.  This will be detected via ShardingState::needCollectionMetadata().&lt;br/&gt;
getLastError on mongod will take a new optional parameter, an election id (OID).  If the objectID passed in does not match the current election id, the command will return an error as the primary has moved since the write occurred.&lt;/p&gt;

&lt;p&gt;After running a command, mongos will need to remember the last primary it talked to, in addition to the optime and election id embedded in the command response. Upon receipt of a getLastError command, if the previous write was not a Write Command, mongos will need to issue getLastError to the proper primary node, passing in the optime and election id that it received from the command&apos;s response.&lt;/p&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="57142">SERVER-7739</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="107565">SERVER-12474</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="108256">SERVER-12535</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="108900">SERVER-12559</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="109724">SERVER-12623</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>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 21 Jan 2014 21:22:13 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        10 years, 2 weeks 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>
                            10 years, 2 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10249"><![CDATA[Cannot]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrm3i7:</customfieldvalue>

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

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

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