<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:16:52 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-2985] Investigate flaky test: /Client/last_write_date/pooled</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2985</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;It failed on Windows VS 2015:&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;   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; [2019/02/27 18:24:21.029] + ./src/libmongoc/Debug/test-libmongoc.exe -d -F test-results.json&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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; [2019/02/27 18:24:21.029] FAIL&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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; [2019/02/27 18:24:21.029] Assert Failure: 0 &amp;gt; 0&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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; [2019/02/27 18:24:21.029] C:\data\mci\4709715f64dc8f5af580425573d98743\mongoc\src\libmongoc\tests\test-mongoc-max-staleness.c:216  _test_last_write_date()&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;On &lt;a href=&quot;https://evergreen.mongodb.com/task/mongo_c_driver_windows_2015_test_latest_replica_set_noauth_nosasl_nossl_patch_4bdf014e67aa397c91efb847e0119e231a181a84_5c7719df2a60ed0d8fbff540_19_02_27_23_14_50&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this patch build&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The test does the following:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;sets heartbeatFrequencyMS to 500. That means the topology scanner should send ismaster&apos;s to each server if they were last updated &amp;gt;= 500ms ago.&lt;/li&gt;
	&lt;li&gt;does server selection&lt;/li&gt;
	&lt;li&gt;sleeps for 2 seconds&lt;/li&gt;
	&lt;li&gt;does server selection again&lt;/li&gt;
	&lt;li&gt;checks that the last_write_date has increased since the first server selection&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But the error indicates the server description was not updated in the second server selection attempt.&lt;/p&gt;

&lt;p&gt;It&apos;s unclear to me why this could have failed, unless the sleep really wasn&apos;t sleeping for 2 seconds, or if there&apos;s some other time dependant bug.&lt;/p&gt;</description>
                <environment></environment>
        <key id="706312">CDRIVER-2985</key>
            <summary>Investigate flaky test: /Client/last_write_date/pooled</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="kevin.albertson@mongodb.com">Kevin Albertson</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                            <label>flaky-tests</label>
                    </labels>
                <created>Thu, 28 Feb 2019 02:39:35 +0000</created>
                <updated>Sat, 28 Oct 2023 11:29:23 +0000</updated>
                            <resolved>Wed, 29 Apr 2020 03:55:49 +0000</resolved>
                                                    <fixVersion>1.17.0-beta2</fixVersion>
                    <fixVersion>1.17.0</fixVersion>
                                    <component>libmongoc</component>
                    <component>tests</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3147841" author="xgen-internal-githook" created="Sun, 31 May 2020 03:43:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2985&quot; title=&quot;Investigate flaky test: /Client/last_write_date/pooled&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2985&quot;&gt;&lt;del&gt;CDRIVER-2985&lt;/del&gt;&lt;/a&gt; fix /Client/last_write_date/pooled&lt;br/&gt;
Branch: r1.16&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/feb3bab7ed668db027c19e28b0b30f83702feca1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/feb3bab7ed668db027c19e28b0b30f83702feca1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3106166" author="xgen-internal-githook" created="Mon, 25 May 2020 21:13:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2985&quot; title=&quot;Investigate flaky test: /Client/last_write_date/pooled&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2985&quot;&gt;&lt;del&gt;CDRIVER-2985&lt;/del&gt;&lt;/a&gt; fix /Client/last_write_date/pooled&lt;br/&gt;
Branch: r1.17&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/ef9ac101184e4cfac3644c2cec77e85df33edec3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/ef9ac101184e4cfac3644c2cec77e85df33edec3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3059921" author="xgen-internal-githook" created="Wed, 29 Apr 2020 03:55:27 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kevin Albertson&apos;, &apos;email&apos;: &apos;kevin.albertson@mongodb.com&apos;, &apos;username&apos;: &apos;kevinAlbs&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2985&quot; title=&quot;Investigate flaky test: /Client/last_write_date/pooled&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2985&quot;&gt;&lt;del&gt;CDRIVER-2985&lt;/del&gt;&lt;/a&gt; fix /Client/last_write_date/pooled&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/932540ede356483f61af9811ba1b89014deafb2f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/932540ede356483f61af9811ba1b89014deafb2f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3057828" author="kevin.albertson" created="Tue, 28 Apr 2020 01:48:48 +0000"  >&lt;p&gt;Confirmed the hypothesis by downloading the mongodb directories attached to the patch build and inspecting the oplog just before the crash.&lt;/p&gt;

&lt;p&gt;This appears to be due to a noop write in the oplog shortly before second insert in the test:&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;   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;local&amp;gt; db.oplog.rs.find().sort({ts:-1})&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;{ &quot;ts&quot; : Timestamp(1587642727, 1), &quot;t&quot; : NumberLong(1), &quot;h&quot; : NumberLong(&quot;-3145035210528304586&quot;), &quot;v&quot; : 2, &quot;op&quot; : &quot;n&quot;, &quot;ns&quot; : &quot;&quot;, &quot;wall&quot; : ISODate(&quot;2020-04-23T11:52:07.635Z&quot;), &quot;o&quot; : { &quot;msg&quot; : &quot;periodic noop&quot; } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;{ &quot;ts&quot; : Timestamp(1587642725, 2), &quot;t&quot; : NumberLong(1), &quot;h&quot; : NumberLong(&quot;-2339260708452859779&quot;), &quot;v&quot; : 2, &quot;op&quot; : &quot;i&quot;, &quot;ns&quot; : &quot;test.test_last_write_date_157177752_2840&quot;, &quot;ui&quot; : UUID(&quot;66705f00-c15c-48a8-8a4a-c920a57f541b&quot;), &quot;wall&quot; : ISODate(&quot;2020-04-23T11:52:05.987Z&quot;), &quot;o&quot; : { &quot;_id&quot; : ObjectId(&quot;5ea18165d0cf7c3936089e94&quot;) } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;{ &quot;ts&quot; : Timestamp(1587642725, 1), &quot;t&quot; : NumberLong(1), &quot;h&quot; : NumberLong(&quot;6206579937116025356&quot;), &quot;v&quot; : 2, &quot;op&quot; : &quot;n&quot;, &quot;ns&quot; : &quot;&quot;, &quot;wall&quot; : ISODate(&quot;2020-04-23T11:52:05.634Z&quot;), &quot;o&quot; : { &quot;msg&quot; : &quot;periodic noop&quot; } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;{ &quot;ts&quot; : Timestamp(1587642723, 4), &quot;t&quot; : NumberLong(1), &quot;h&quot; : NumberLong(&quot;-5631330227419792400&quot;), &quot;v&quot; : 2, &quot;op&quot; : &quot;i&quot;, &quot;ns&quot; : &quot;test.test_last_write_date_157177752_2840&quot;, &quot;ui&quot; : UUID(&quot;66705f00-c15c-48a8-8a4a-c920a57f541b&quot;), &quot;wall&quot; : ISODate(&quot;2020-04-23T11:52:03.984Z&quot;), &quot;o&quot; : { &quot;_id&quot; : ObjectId(&quot;5ea18163d0cf7c3936089e93&quot;) } }&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;This appears to be due to a recent change in mongo orchestration to start the periodic noop writer with an interval of 1s instead of 10s: &lt;a href=&quot;https://github.com/10gen/mongo-orchestration/commit/066ec58c817947ca136c25690a705fd4e4db2a7b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/10gen/mongo-orchestration/commit/066ec58c817947ca136c25690a705fd4e4db2a7b&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Though, this does beg the question whether there was a different reason this test was failing before.&lt;/p&gt;</comment>
                            <comment id="3057749" author="kevin.albertson" created="Tue, 28 Apr 2020 01:08:14 +0000"  >&lt;p&gt;This test comes from the max stalenes spec, the &quot;Parse lastWriteDate&quot; test: &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness-tests.rst#parse-lastwritedate&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness-tests.rst#parse-lastwritedate&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Observations&lt;/b&gt;&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;lastWriteDate has second granularity. If two inserts occurred within the same second, the same lastWriteDate would be reported.&lt;/li&gt;
	&lt;li&gt;I&apos;ve only seen this happened on the &quot;pooled&quot; test.&lt;/li&gt;
	&lt;li&gt;The test selects a secondary, but this still persists even if the test targets the primary.&lt;/li&gt;
	&lt;li&gt;With lots of debug statements, I was able to capture the ismasters received from all three nodes during the test. &lt;a href=&quot;https://evergreen.mongodb.com/task/mongo_c_driver_asan_ubuntu_test_asan_3.6_replica_set_noauth_nosasl_nossl_patch_14b0d73c1851b74d46345c8c554b8bf7aae941e1_5ea17e543627e022535abc8b_20_04_23_11_39_01&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Reference&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;A timeline:&lt;br/&gt;
11:52:03.0975 test starts&lt;br/&gt;
11:52:03.0980 primary recieves lastWriteDate=1587642723000&lt;br/&gt;
11:52:03.0981 secondary receives lastWriteDate=1587642723000&lt;br/&gt;
11:52:05.0987 secondary receives lastWriteDate=1587642725000&lt;br/&gt;
11:52:06.0487 primary receives lastWriteDate=1587642725000&lt;br/&gt;
No server receives an ismaster reply containing a larger lastWriteDate for the remainder of the test.&lt;/p&gt;

&lt;p&gt;Both server descriptions s0 and s1 have lastWriteDate of 1587642725000 in the end. This is first received two seconds after the test starts.&lt;/p&gt;

&lt;p&gt;Hypothesis: If there was a write from something external (e.g. from the oplog noop writer, a session being deleted, etc.) to the oplog just before the first server selection, then the insert may be happening within the same lastWriteDate second. I can confirm this by  dumping the oplog.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="1345019">CDRIVER-3664</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CDRIVER-2733</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr7dcv:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>