<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:29:38 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-32233] NewPrimaryWithMaxElectionId test should ensure that electionId is newer every iteration</title>
                <link>https://jira.mongodb.org/browse/SERVER-32233</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Test should make sure that OID generated here is increasing for every iteration:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.7.0/src/mongo/client/replica_set_monitor_test.cpp#L1013&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/r3.7.0/src/mongo/client/replica_set_monitor_test.cpp#L1013&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="470018">SERVER-32233</key>
            <summary>NewPrimaryWithMaxElectionId test should ensure that electionId is newer every iteration</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="13201">Fixed</resolution>
                                        <assignee username="randolph@mongodb.com">Randolph Tan</assignee>
                                    <reporter username="randolph@mongodb.com">Randolph Tan</reporter>
                        <labels>
                            <label>neweng</label>
                    </labels>
                <created>Fri, 8 Dec 2017 20:11:01 +0000</created>
                <updated>Mon, 30 Oct 2023 23:10:05 +0000</updated>
                            <resolved>Wed, 14 Feb 2018 19:18:42 +0000</resolved>
                                    <version>3.6.0</version>
                                    <fixVersion>3.7.3</fixVersion>
                                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1805997" author="xgen-internal-githook" created="Wed, 14 Feb 2018 19:16:48 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;cramaechi@me.com&apos;, &apos;name&apos;: &apos;Chibuikem Amaechi&apos;, &apos;username&apos;: &apos;cramaechi&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32233&quot; title=&quot;NewPrimaryWithMaxElectionId test should ensure that electionId is newer every iteration&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32233&quot;&gt;&lt;del&gt;SERVER-32233&lt;/del&gt;&lt;/a&gt; Ensure electionId is increasing per iteration&lt;/p&gt;

&lt;p&gt;NewPrimaryWithMaxElectionId test should ensure that electionId is newer&lt;br/&gt;
every iteration.&lt;/p&gt;

&lt;p&gt;The problem is that the test assumes that OID generated per iteration is&lt;br/&gt;
increasing. And this assumption is based on the fact that OID::gen&lt;br/&gt;
constructs a value based on the return value from time(). However, there&lt;br/&gt;
is no guarantee that time() will consistently be returning values that&lt;br/&gt;
increases over time.&lt;/p&gt;

&lt;p&gt;Use OID::fromTerm() in place of OID::gen().&lt;/p&gt;

&lt;p&gt;Closes #1207&lt;/p&gt;

&lt;p&gt;Signed-off-by: Randolph Tan &amp;lt;randolph@10gen.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/538354fddd70b3b2de8ea13f2f8dec72c973db87&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/538354fddd70b3b2de8ea13f2f8dec72c973db87&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1783148" author="cramaechi" created="Wed, 24 Jan 2018 08:00:29 +0000"  >&lt;p&gt;Hi Randolph,&lt;/p&gt;

&lt;p&gt;Thanks for the clarification. In that case, I propose we use &lt;tt&gt;OID::fromTerm()&lt;/tt&gt; in place of &lt;tt&gt;OID::gen()&lt;/tt&gt; to ensure that &lt;tt&gt;electionId&lt;/tt&gt; is increasing per iteration. As the integer value that is passed to &lt;tt&gt;OID::fromTerm()&lt;/tt&gt; increases due to the for-loop, so does the underlying data of the OID object that is returned.&lt;/p&gt;

&lt;p&gt; &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;176683_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/176683/176683_Screen+Shot+2018-01-24+at+1.29.29+AM.png&quot; title=&quot;Screen Shot 2018-01-24 at 1.29.29 AM.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;176683&quot; file-preview-title=&quot;Screen Shot 2018-01-24 at 1.29.29 AM.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/176683/_thumb_176683.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;</comment>
                            <comment id="1782892" author="renctan" created="Tue, 23 Jan 2018 22:46:26 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=cramaechi&quot; class=&quot;user-hover&quot; rel=&quot;cramaechi&quot;&gt;cramaechi&lt;/a&gt; Thanks for sharing. However, this does not fix the underlying issue. The problem is that the test assumes that OID generated per iteration is increasing. And this assumption is based on the fact that OID::gen constructs a value based on the return value from time(). However, there is no guarantee that time() will consistently be returning values that increases over time.&lt;/p&gt;</comment>
                            <comment id="1761950" author="cramaechi" created="Sat, 30 Dec 2017 16:43:06 +0000"  >&lt;p&gt;As mentioned above, there are currently no checks in place to ensure that a new &lt;tt&gt;electionId&lt;/tt&gt; is generated for every iteration of the for-loop. My proposed change would be to declare an OID variable named &lt;tt&gt;nextOID&lt;/tt&gt; and a string variable named &lt;tt&gt;prevOID&lt;/tt&gt; outside the for-loop, and then maintain them inside the for-loop so that a less-than comparison between &lt;tt&gt;prevOID&lt;/tt&gt; and &lt;tt&gt;nextOID&lt;/tt&gt;.&lt;tt&gt;toString&lt;/tt&gt;() can be passed to an ASSERT macro for processing.&lt;/p&gt;

&lt;p&gt;ex.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;src/mongo/client/replica_set_monitor_test.cpp&lt;/tt&gt;&lt;br/&gt;
&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;174473_thumb&quot; href=&quot;https://jira.mongodb.org/secure/attachment/174473/174473_Screen+Shot+2017-12-30+at+10.17.08+AM.png&quot; title=&quot;Screen Shot 2017-12-30 at 10.17.08 AM.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;174473&quot; file-preview-title=&quot;Screen Shot 2017-12-30 at 10.17.08 AM.png&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/thumbnail/174473/_thumb_174473.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;

&lt;p&gt;Please share your thoughts.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="174473" name="Screen Shot 2017-12-30 at 10.17.08 AM.png" size="174336" author="cramaechi" created="Sat, 30 Dec 2017 16:36:58 +0000"/>
                            <attachment id="176683" name="Screen Shot 2018-01-24 at 1.29.29 AM.png" size="157472" author="cramaechi" created="Wed, 24 Jan 2018 08:00:00 +0000"/>
                    </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_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sat, 30 Dec 2017 16:43:06 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years 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_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>cramaechi</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|htlvrj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htdhwf:</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_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|htlhvj:</customfieldvalue>

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