<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:11:57 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-46612] Test that $unionWith obeys the read preference set on the original command</title>
                <link>https://jira.mongodb.org/browse/SERVER-46612</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Split from &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46309&quot; title=&quot;Test that $unionWith obeys the readConcern set on the original command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46309&quot;&gt;&lt;del&gt;SERVER-46309&lt;/del&gt;&lt;/a&gt;, confirm that the read preference is obeyed for the sub-operations in $unionWith.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1223859">SERVER-46612</key>
            <summary>Test that $unionWith obeys the read preference set on the original command</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="ted.tuckman@mongodb.com">Ted Tuckman</assignee>
                                    <reporter username="charlie.swanson@mongodb.com">Charlie Swanson</reporter>
                        <labels>
                    </labels>
                <created>Wed, 4 Mar 2020 16:27:24 +0000</created>
                <updated>Sun, 29 Oct 2023 22:11:17 +0000</updated>
                            <resolved>Fri, 17 Apr 2020 17:05:53 +0000</resolved>
                                                    <fixVersion>4.4.0-rc2</fixVersion>
                    <fixVersion>4.7.0</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3047006" author="xgen-internal-githook" created="Mon, 20 Apr 2020 14:26:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Ted Tuckman&apos;, &apos;email&apos;: &apos;ted.tuckman@mongodb.com&apos;, &apos;username&apos;: &apos;TedTuckman&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46612&quot; title=&quot;Test that $unionWith obeys the read preference set on the original command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46612&quot;&gt;&lt;del&gt;SERVER-46612&lt;/del&gt;&lt;/a&gt; Test that $unionWith obeys the read preference set on the original command&lt;/p&gt;

&lt;p&gt;cherry picked from commit (97e181dfdf8516ea4b7543e62130057e61a5ebc3)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/dcdba40124edb26c0995b56f75cb0762722a1304&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/dcdba40124edb26c0995b56f75cb0762722a1304&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3044948" author="xgen-internal-githook" created="Fri, 17 Apr 2020 16:22:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Ted Tuckman&apos;, &apos;email&apos;: &apos;ted.tuckman@mongodb.com&apos;, &apos;username&apos;: &apos;TedTuckman&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46612&quot; title=&quot;Test that $unionWith obeys the read preference set on the original command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46612&quot;&gt;&lt;del&gt;SERVER-46612&lt;/del&gt;&lt;/a&gt; Test that $unionWith obeys the read preference set on the original command&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/97e181dfdf8516ea4b7543e62130057e61a5ebc3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/97e181dfdf8516ea4b7543e62130057e61a5ebc3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3038620" author="charlie.swanson" created="Tue, 14 Apr 2020 13:23:57 +0000"  >&lt;p&gt;Oh very interesting. I think that the find was just added to help debug where the problem is. It&apos;s not actually meant to be necessary for the test. I have confirmed that removing the find does cause the test to fail in the way I remember. &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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.615-0400 assert: [[ { &quot;_id&quot; : -1, &quot;count&quot; : 2 }, { &quot;_id&quot; : 1, &quot;count&quot; : 3 } ]] != [[ { &quot;_id&quot; : -1, &quot;count&quot; : 3 }, { &quot;_id&quot; : 1, &quot;count&quot; : 3 } ]] are not equal&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.616-0400 doassert@src/mongo/shell/assert.js:20:14&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.616-0400 assert.eq@src/mongo/shell/assert.js:179:9&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.616-0400 @jstests/sharding/union_with_read_preference.js:132: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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.616-0400 @jstests/sharding/union_with_read_preference.js:3:2&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.616-0400 uncaught exception: Error: [[ { &quot;_id&quot; : -1, &quot;count&quot; : 2 }, { &quot;_id&quot; : 1, &quot;count&quot; : 3 } ]] != [[ { &quot;_id&quot; : -1, &quot;count&quot; : 3 }, { &quot;_id&quot; : 1, &quot;count&quot; : 3 } ]] are not equal :&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.616-0400 doassert@src/mongo/shell/assert.js:20:14&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.617-0400 assert.eq@src/mongo/shell/assert.js:179:9&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.617-0400 @jstests/sharding/union_with_read_preference.js:132: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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.617-0400 @jstests/sharding/union_with_read_preference.js:3:2&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.617-0400 failed to load: jstests/sharding/union_with_read_preference.js&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;[js_test:union_with_read_preference] 2020-04-14T09:19:02.617-0400 exiting with code -3&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;That&apos;s very strange. Also, without that find the test is now failing both on OP_QUERY and regular &quot;sharding&quot; suites. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=max.hirschhorn&quot; class=&quot;user-hover&quot; rel=&quot;max.hirschhorn&quot;&gt;max.hirschhorn&lt;/a&gt; so am I to understand that readConcern &quot;local&quot; will cause the shard to refresh? Would &quot;majority&quot; not do the same thing? Why is the read on behalf of the union not doing the same thing? If I run the aggregate with &lt;tt&gt;readConcern: {level: &quot;majority&quot;&lt;/tt&gt;} I get the same result. And the same with level &quot;local&quot;. How did you bump the ASIO level to 4? I don&apos;t see that in your debugging.patch&lt;/p&gt;</comment>
                            <comment id="3038504" author="ted.tuckman" created="Tue, 14 Apr 2020 12:28:32 +0000"  >&lt;p&gt;So changing the find to force a refresh does make the test pass in both cases. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=charlie.swanson&quot; class=&quot;user-hover&quot; rel=&quot;charlie.swanson&quot;&gt;charlie.swanson&lt;/a&gt; was that the intention of the find? I was operating under the assumption that the union was supposed to do that, but if that is the point of the find then we can just use the test with the above change.&lt;/p&gt;</comment>
                            <comment id="3038078" author="max.hirschhorn@10gen.com" created="Tue, 14 Apr 2020 01:44:27 +0000"  >&lt;p&gt;I applied the &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/255639/255639_debugging.patch&quot; title=&quot;debugging.patch attached to SERVER-46612&quot;&gt;debugging.patch&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; on top of commit 9810e6d6986a3dc5bc1b5c57a524155bdba45452 and ran the &lt;tt&gt;union_with_read_preference.js&lt;/tt&gt; test with the &quot;network.asio&quot; log-level set to 4 in order to trace both the requests and the responses. Comparing the two between a passing and failing run made me realize that specifying &lt;tt&gt;&amp;#45;&amp;#45;readMode=legacy&lt;/tt&gt; to the mongo shell &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b4f1c5ed8af0ed6340c1795071ed061ae7facf14/src/mongo/shell/session.js#L240-L249&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;disables logical sessions&lt;/a&gt;. Note that the server technically supports causal consistency (being that it is a read concern option) outside of logical sessions, but normal drivers won&apos;t ever expose it to our users this way. &lt;a href=&quot;https://docs.mongodb.com/manual/reference/read-concern-available/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;The rule for the default read concern level when a command is run on a secondary is based on around whether the operation is in a logical session&lt;/a&gt; (though I&apos;ll admit I couldn&apos;t find in the C++ where that actually happens).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The only difference in the logs seems to be when we insert the documents into that collection &#8211; in the passing version this triggers a refresh of the collection shard version on the shards, whereas the insert doesnt trigger that in the failing version&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The find command on the &lt;tt&gt;union_with_read_preference_db.second_union_target&lt;/tt&gt; collection is triggering the collection metadata refresh.&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;[js_test:union_with_read_preference] 2020-04-13T20:34:36.351-0400 s20028| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:34:36.350-04:00&quot;},&quot;s&quot;:&quot;D4&quot;,&quot;c&quot;:&quot;ASIO&quot;,    &quot;id&quot;:22596,  &quot;ctx&quot;:&quot;conn10&quot;,&quot;msg&quot;:&quot;startCommand&quot;,&quot;attr&quot;:{&quot;request&quot;:&quot;RemoteCommand 114 -- target:[hanamizu:20022] db:union_with_read_preference_db cmd:{ find: \&quot;second_union_target\&quot;, readConcern: { afterClusterTime: Timestamp(1586824476, 48) }, runtimeConstants: { localNow: new Date(1586824476350), clusterTime: Timestamp(1586824476, 48) }, shardVersion: [ Timestamp(3, 0), ObjectId(&apos;5e95051b676fb0420f047bd3&apos;) ], lsid: { id: UUID(\&quot;8e26cb19-e907-44d7-8ede-dc919acfdfa1\&quot;), uid: BinData(0, E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855) } }&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;...&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;[js_test:union_with_read_preference] 2020-04-13T20:34:36.374-0400 s20028| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:34:36.374-04:00&quot;},&quot;s&quot;:&quot;D2&quot;,&quot;c&quot;:&quot;ASIO&quot;,    &quot;id&quot;:22597,  &quot;ctx&quot;:&quot;conn10&quot;,&quot;msg&quot;:&quot;Request finished with response&quot;,&quot;attr&quot;:{&quot;requestId&quot;:114,&quot;response&quot;:&quot;{ operationTime: Timestamp(1586824476, 49), ok: 0.0, errmsg: \&quot;epoch mismatch detected for union_with_read_preference_db.second_union_target\&quot;, code: 13388, codeName: \&quot;StaleConfig\&quot;, ns: \&quot;union_with_read_preference_db.second_union_target\&quot;, vReceived: Timestamp(3, 0), vReceivedEpoch: ObjectId(&apos;5e95051b676fb0420f047bd3&apos;), vWanted: Timestamp(0, 0), vWantedEpoch: ObjectId(&apos;000000000000000000000000&apos;), shardId: \&quot;union_with_read_pref-rs0\&quot;, $gleStats: { lastOpTime: Timestamp(0, 0), electionId: ObjectId(&apos;000000000000000000000000&apos;) }, lastCommittedOpTime: Timestamp(1586824476, 47), $configServerState: { opTime: { ts: Timestamp(1586824476, 40), t: 1 } }, $clusterTime: { clusterTime: Timestamp(1586824476, 49), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } } }&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;[js_test:union_with_read_preference] 2020-04-13T20:34:36.374-0400 s20028| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:34:36.374-04:00&quot;},&quot;s&quot;:&quot;D1&quot;,&quot;c&quot;:&quot;QUERY&quot;,   &quot;id&quot;:22840,  &quot;ctx&quot;:&quot;conn10&quot;,&quot;msg&quot;:&quot;Received error status for query {query_Short} on attempt {retries} of {kMaxRetries}: {ex}&quot;,&quot;attr&quot;:{&quot;query_Short&quot;:&quot;ns: union_with_read_preference_db.second_union_target query: {} sort: {} projection: {}&quot;,&quot;retries&quot;:1,&quot;kMaxRetries&quot;:10,&quot;ex&quot;:&quot;StaleConfig{ ns: \&quot;union_with_read_preference_db.second_union_target\&quot;, vReceived: Timestamp(3, 1), vReceivedEpoch: ObjectId(&apos;5e95051b676fb0420f047bd3&apos;), vWanted: Timestamp(0, 0), vWantedEpoch: ObjectId(&apos;000000000000000000000000&apos;), shardId: \&quot;union_with_read_pref-rs1\&quot; }: epoch mismatch detected for union_with_read_preference_db.second_union_target&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;[js_test:union_with_read_preference] 2020-04-13T20:34:36.374-0400 s20028| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:34:36.374-04:00&quot;},&quot;s&quot;:&quot;D1&quot;,&quot;c&quot;:&quot;SH_REFR&quot;, &quot;id&quot;:24106,  &quot;ctx&quot;:&quot;conn10&quot;,&quot;msg&quot;:&quot;Refreshing cached collection {namespace} with version {currentCollectionVersion}&quot;,&quot;attr&quot;:{&quot;namespace&quot;:&quot;union_with_read_preference_db.second_union_target&quot;,&quot;currentCollectionVersion&quot;:{&quot;0&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:3,&quot;i&quot;:1}},&quot;1&quot;:{&quot;$oid&quot;:&quot;5e95051b676fb0420f047bd3&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;...&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;[js_test:union_with_read_preference] 2020-04-13T20:34:36.374-0400 d20022| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:34:36.374-04:00&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;SH_REFR&quot;, &quot;id&quot;:24104,  &quot;ctx&quot;:&quot;ShardServerCatalogCacheLoader-0&quot;,&quot;msg&quot;:&quot;Refreshed cached collection&quot;,&quot;attr&quot;:{&quot;namespace&quot;:&quot;union_with_read_preference_db.second_union_target&quot;,&quot;newVersion&quot;:{&quot;0&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:3,&quot;i&quot;:1}},&quot;1&quot;:{&quot;$oid&quot;:&quot;5e95051b676fb0420f047bd3&quot;}},&quot;oldVersion&quot;:&quot;&quot;,&quot;durationMillis&quot;:6}}&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;[js_test:union_with_read_preference] 2020-04-13T20:34:36.378-0400 s20028| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-04-13T20:34:36.377-04:00&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;COMMAND&quot;, &quot;id&quot;:51803,  &quot;ctx&quot;:&quot;conn10&quot;,&quot;msg&quot;:&quot;Slow query&quot;,&quot;attr&quot;:{&quot;type&quot;:&quot;command&quot;,&quot;ns&quot;:&quot;union_with_read_preference_db.second_union_target&quot;,&quot;appName&quot;:&quot;MongoDB Shell&quot;,&quot;command&quot;:{&quot;find&quot;:&quot;second_union_target&quot;,&quot;filter&quot;:{},&quot;lsid&quot;:{&quot;id&quot;:{&quot;$uuid&quot;:&quot;8e26cb19-e907-44d7-8ede-dc919acfdfa1&quot;}},&quot;$clusterTime&quot;:{&quot;clusterTime&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1586824476,&quot;i&quot;:48}},&quot;signature&quot;:{&quot;hash&quot;:{&quot;$binary&quot;:{&quot;base64&quot;:&quot;AAAAAAAAAAAAAAAAAAAAAAAAAAA=&quot;,&quot;subType&quot;:&quot;0&quot;}},&quot;keyId&quot;:0}},&quot;readConcern&quot;:{&quot;afterClusterTime&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1586824476,&quot;i&quot;:48}}},&quot;$readPreference&quot;:{&quot;mode&quot;:&quot;secondary&quot;},&quot;$db&quot;:&quot;union_with_read_preference_db&quot;},&quot;nShards&quot;:2,&quot;cursorExhausted&quot;:true,&quot;numYields&quot;:0,&quot;nreturned&quot;:2,&quot;reslen&quot;:333,&quot;readConcern&quot;:{&quot;afterClusterTime&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1586824476,&quot;i&quot;:48}},&quot;provenance&quot;:&quot;clientSupplied&quot;},&quot;protocol&quot;:&quot;op_msg&quot;,&quot;durationMillis&quot;:26}}&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 the goal of that query is to cause the secondaries to refresh, then explicitly specifying a &quot;local&quot; read concern by using the find command would do the trick.&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;diff --git a/jstests/sharding/union_with_read_preference.js b/jstests/sharding/union_with_read_preference.js&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;index d13266e133..b0d78302a3 100644&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: #2B91AF; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;--- a/jstests/sharding/union_with_read_preference.js&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: #2B91AF; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;+++ b/jstests/sharding/union_with_read_preference.js&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;@@ -108,7 +108,11 @@ const secondTargetColl = mongosDB.second_union_target;&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: gray; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; st.shardColl(secondTargetColl, {_id: 1}, {_id: 0}, {_id: -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: gray; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; assert.commandWorked(&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: gray; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;     secondTargetColl.insert([{_id: -1, coll: 2}, {_id: 1, coll: 2}], {writeConcern: {w: &quot;majority&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: red; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;-assert.eq(secondTargetColl.find().readPref(&quot;secondary&quot;).itcount(), 2);&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: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;+assert.eq(new DBCommandCursor(mongosDB, assert.commandWorked(mongosDB.runCommand({&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: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;+              query: {find: secondTargetColl.getName(), readConcern: {level: &quot;local&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: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;+              $readPreference: {mode: &quot;secondary&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: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;+          }))).itcount(),&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: blue; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;+          2);&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: gray; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; unionWithComment = &apos;complex union against secondary&apos;;&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: gray; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; let runAgg = () =&amp;gt; mongosColl&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: gray; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;                        .aggregate(&lt;/span&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;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="2987862" author="charlie.swanson" created="Thu, 19 Mar 2020 17:34:08 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ted.tuckman&quot; class=&quot;user-hover&quot; rel=&quot;ted.tuckman&quot;&gt;ted.tuckman&lt;/a&gt; I&apos;m going to have to beg you for help on this one. I haven&apos;t had much time to dig in and it seems like something fishy is going on. I&apos;m tentatively throwing it in next sprint but we should discuss.&lt;/p&gt;</comment>
                            <comment id="2946571" author="charlie.swanson" created="Thu, 5 Mar 2020 19:58:10 +0000"  >&lt;p&gt;I&apos;ve been trying to write a test for this for a while now and I&apos;ve been hitting some really strange behavior. Here&apos;s a list of the weird things I&apos;ve seen.&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;In the linked test  &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/251107/251107_union_with_read_preference.js&quot; title=&quot;union_with_read_preference.js attached to SERVER-46612&quot;&gt;union_with_read_preference.js&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;, it looks like I can consistently reproduce a case where the innermost $unionWith (against &apos;secondTargetColl&apos; AKA &apos;second_union_target&apos;) does not find the document {&lt;tt&gt;_id: -1&lt;/tt&gt;}.&#160;Looking at the logs, it seems the shard versioning protocol is breaking down. Here we can see that the innermost pipeline was sent with an &quot;UNSHARDED&quot; shard version (which is incorrect), but completed successfully and returned 1 document (the one with {&lt;tt&gt;_id: 1&lt;/tt&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;[js_test:union_with_read_preference] 2020-03-05T10:24:06.208-0500 d30024| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-05T10:24:06.208-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;-&quot;,       &quot;id&quot;:51803,&quot;ctx&quot;:&quot;conn37&quot;,&quot;msg&quot;:&quot;slow query&quot;,&quot;attr&quot;:{&quot;type&quot;:&quot;command&quot;,&quot;ns&quot;:&quot;union_with_read_preference.second_union_target&quot;,&quot;appName&quot;:&quot;MongoDB Shell&quot;,&quot;command&quot;:{&quot;aggregate&quot;:&quot;second_union_target&quot;,&quot;pipeline&quot;:[],&quot;fromMongos&quot;:false,&quot;collation&quot;:{&quot;locale&quot;:&quot;simple&quot;},&quot;cursor&quot;:{&quot;batchSize&quot;:101},&quot;runtimeConstants&quot;:{&quot;localNow&quot;:{&quot;$date&quot;:&quot;2020-03-05T10:24:06.098-0500&quot;},&quot;clusterTime&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1583421846,&quot;i&quot;:30}}},&quot;readConcern&quot;:{&quot;level&quot;:&quot;majority&quot;,&quot;afterClusterTime&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1583421846,&quot;i&quot;:30}},&quot;provenance&quot;:&quot;clientSupplied&quot;},&quot;writeConcern&quot;:{&quot;w&quot;:1,&quot;wtimeout&quot;:0,&quot;provenance&quot;:&quot;implicitDefault&quot;},&quot;shardVersion&quot;:[{&quot;$timestamp&quot;:{&quot;t&quot;:0,&quot;i&quot;:0}},{&quot;$oid&quot;:&quot;000000000000000000000000&quot;}],&quot;databaseVersion&quot;:{&quot;uuid&quot;:{&quot;$uuid&quot;:&quot;5ab2b608-53a2-49ca-8bb8-483931638606&quot;},&quot;lastMod&quot;:1},&quot;comment&quot;:&quot;complex union against secondary&quot;,&quot;lsid&quot;:{&quot;id&quot;:{&quot;$uuid&quot;:&quot;c5bc416c-764c-40fd-99b8-96387f35c9b8&quot;},&quot;uid&quot;:{&quot;$binary&quot;:{&quot;base64&quot;:&quot;47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=&quot;,&quot;subType&quot;:&quot;0&quot;}}},&quot;$readPreference&quot;:{&quot;mode&quot;:&quot;secondary&quot;},&quot;$clusterTime&quot;:{&quot;clusterTime&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1583421846,&quot;i&quot;:31}},&quot;signature&quot;:{&quot;hash&quot;:{&quot;$binary&quot;:{&quot;base64&quot;:&quot;r9fkUy4pkQnK8w98NcWj4Sw9LOI=&quot;,&quot;subType&quot;:&quot;0&quot;}},&quot;keyId&quot;:6800745014277177366}},&quot;$client&quot;:{&quot;application&quot;:{&quot;name&quot;:&quot;MongoDB Shell&quot;},&quot;driver&quot;:{&quot;name&quot;:&quot;MongoDB Internal Client&quot;,&quot;version&quot;:&quot;4.3.4&quot;},&quot;os&quot;:{&quot;type&quot;:&quot;Linux&quot;,&quot;name&quot;:&quot;Ubuntu&quot;,&quot;architecture&quot;:&quot;x86_64&quot;,&quot;version&quot;:&quot;18.04&quot;},&quot;mongos&quot;:{&quot;host&quot;:&quot;franklinia:30028&quot;,&quot;client&quot;:&quot;127.0.0.1:32946&quot;,&quot;version&quot;:&quot;4.3.4&quot;}},&quot;$configServerState&quot;:{&quot;opTime&quot;:{&quot;ts&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1583421846,&quot;i&quot;:22}},&quot;t&quot;:1}},&quot;$db&quot;:&quot;union_with_read_preference&quot;},&quot;planSummary&quot;:&quot;COLLSCAN&quot;,&quot;keysExamined&quot;:0,&quot;docsExamined&quot;:1,&quot;cursorExhausted&quot;:true,&quot;numYields&quot;:0,&quot;nreturned&quot;:1,&quot;reslen&quot;:431,&quot;locks&quot;:{&quot;ReplicationStateTransition&quot;:{&quot;acquireCount&quot;:{&quot;w&quot;:1}},&quot;Global&quot;:{&quot;acquireCount&quot;:{&quot;r&quot;:1}},&quot;Database&quot;:{&quot;acquireCount&quot;:{&quot;r&quot;:1}},&quot;Collection&quot;:{&quot;acquireCount&quot;:{&quot;r&quot;:1}},&quot;Mutex&quot;:{&quot;acquireCount&quot;:{&quot;r&quot;:2}}},&quot;readConcern&quot;:{&quot;level&quot;:&quot;majority&quot;,&quot;afterClusterTime&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:1583421846,&quot;i&quot;:30}},&quot;provenance&quot;:&quot;clientSupplied&quot;},&quot;writeConcern&quot;:{&quot;w&quot;:1,&quot;wtimeout&quot;:0,&quot;provenance&quot;:&quot;implicitDefault&quot;},&quot;storage&quot;:{},&quot;protocol&quot;:&quot;op_msg&quot;,&quot;durationMillis&quot;:0}}&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;Adding some logging in &apos;CollectionShardingRuntime::_getMetadataWithVersionCheckAt&apos;, I can see that the recipient node does not have any knowledge of this collection:&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;[js_test:union_with_read_preference] 2020-03-05T10:24:06.208-0500 d30024| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-05T10:24:06.207-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;SHARDING&quot;,&quot;id&quot;:4661200,&quot;ctx&quot;:&quot;conn37&quot;,&quot;msg&quot;:&quot;Received shard version {version}&quot;,&quot;attr&quot;:{&quot;version&quot;:{&quot;0&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:0,&quot;i&quot;:0}},&quot;1&quot;:{&quot;$oid&quot;:&quot;000000000000000000000000&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;[js_test:union_with_read_preference] 2020-03-05T10:24:06.208-0500 d30024| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-05T10:24:06.207-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;SHARDING&quot;,&quot;id&quot;:4661201,&quot;ctx&quot;:&quot;conn37&quot;,&quot;msg&quot;:&quot;Do I have a wanted shard version? {yes_or_no}&quot;,&quot;attr&quot;:{&quot;yes_or_no&quot;:false}}&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 means the two shards actually agree that the collection is unsharded (even though it is not). This would all make sense if the secondary just has not yet replicated the information about the sharding catalog, but it received the writes which came after the shardCollection command - and the command also had a readConcern with an afterClusterTime due to the causally consistent session, so I don&apos;t think that should be happening here.&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;When I try to reproduce this issue with just a stale mongos (in  &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/251106/251106_read_preference_stale_mongos.js&quot; title=&quot;read_preference_stale_mongos.js attached to SERVER-46612&quot;&gt;read_preference_stale_mongos.js&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; ), everything seems to work fine - I cannot observe a similar problem. In those logs I can see a replica set monitor may be helping somehow? In this log snapshot, s30029 is the second mongos which did not shard the collection, and d30023 is a secondary node. We can see here the secondary learns/knows the collection is sharded this time.
&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.996-0500 [jsTest] ----&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.996-0500 [jsTest] CHARLIE shardCollection done&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.996-0500 [jsTest] ----&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.996-0500&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.997-0500 s30029| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-04T17:46:28.997-0500&quot;},&quot;s&quot;:&quot;D1&quot;,&quot;c&quot;:&quot;NETWORK&quot;, &quot;id&quot;:4333211,&quot;ctx&quot;:&quot;conn10&quot;,&quot;msg&quot;:&quot;RSM {setName} getHosts: {readPref} -&amp;gt; {result}&quot;,&quot;attr&quot;:{&quot;readPref&quot;:&quot;{ mode: \&quot;primary\&quot; }&quot;,&quot;setName&quot;:&quot;read_pref_stale_mongos-rs1&quot;,&quot;result&quot;:&quot;franklinia:30023; &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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.998-0500 d30023| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-04T17:46:28.997-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;NETWORK&quot;, &quot;id&quot;:22943,&quot;ctx&quot;:&quot;listener&quot;,&quot;msg&quot;:&quot;connection accepted from {session_remote} #{session_id} ({connectionCount}{word} now open)&quot;,&quot;attr&quot;:{&quot;session_remote&quot;:&quot;127.0.0.1:45860&quot;,&quot;session_id&quot;:48,&quot;connectionCount&quot;:20,&quot;word&quot;:&quot; connections&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.998-0500 d30023| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-04T17:46:28.998-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;NETWORK&quot;, &quot;id&quot;:51800,&quot;ctx&quot;:&quot;conn48&quot;,&quot;msg&quot;:&quot;received client metadata from {remote} {client}: {doc}&quot;,&quot;attr&quot;:{&quot;remote&quot;:&quot;127.0.0.1:45860&quot;,&quot;client&quot;:&quot;conn48&quot;,&quot;doc&quot;:{&quot;driver&quot;:{&quot;name&quot;:&quot;NetworkInterfaceTL&quot;,&quot;version&quot;:&quot;4.3.4&quot;},&quot;os&quot;:{&quot;type&quot;:&quot;Linux&quot;,&quot;name&quot;:&quot;Ubuntu&quot;,&quot;architecture&quot;:&quot;x86_64&quot;,&quot;version&quot;:&quot;18.04&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.998-0500 d30023| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-04T17:46:28.998-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;-&quot;,       &quot;id&quot;:51803,&quot;ctx&quot;:&quot;conn48&quot;,&quot;msg&quot;:&quot;slow query&quot;,&quot;attr&quot;:{&quot;type&quot;:&quot;command&quot;,&quot;ns&quot;:&quot;admin.$cmd&quot;,&quot;command&quot;:{&quot;isMaster&quot;:1,&quot;client&quot;:{&quot;driver&quot;:{&quot;name&quot;:&quot;NetworkInterfaceTL&quot;,&quot;version&quot;:&quot;4.3.4&quot;},&quot;os&quot;:{&quot;type&quot;:&quot;Linux&quot;,&quot;name&quot;:&quot;Ubuntu&quot;,&quot;architecture&quot;:&quot;x86_64&quot;,&quot;version&quot;:&quot;18.04&quot;}},&quot;hostInfo&quot;:&quot;franklinia:30029&quot;,&quot;compression&quot;:[&quot;snappy&quot;,&quot;zstd&quot;,&quot;zlib&quot;],&quot;internalClient&quot;:{&quot;minWireVersion&quot;:9,&quot;maxWireVersion&quot;:9},&quot;hangUpOnStepDown&quot;:false,&quot;saslSupportedMechs&quot;:&quot;local.__system&quot;,&quot;$db&quot;:&quot;admin&quot;},&quot;numYields&quot;:0,&quot;reslen&quot;:1028,&quot;locks&quot;:{},&quot;protocol&quot;:&quot;op_query&quot;,&quot;durationMillis&quot;: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;   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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.998-0500 d30023| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-04T17:46:28.998-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;SHARDING&quot;,&quot;id&quot;:4661200,&quot;ctx&quot;:&quot;conn48&quot;,&quot;msg&quot;:&quot;Received shard version {version}&quot;,&quot;attr&quot;:{&quot;version&quot;:{&quot;0&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:0,&quot;i&quot;:0}},&quot;1&quot;:{&quot;$oid&quot;:&quot;000000000000000000000000&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.998-0500 d30023| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-04T17:46:28.998-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;SHARDING&quot;,&quot;id&quot;:4661201,&quot;ctx&quot;:&quot;conn48&quot;,&quot;msg&quot;:&quot;Do I have a wanted shard version? {yes_or_no}&quot;,&quot;attr&quot;:{&quot;yes_or_no&quot;:true}}&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;[js_test:read_preference_stale_mongos] 2020-03-04T17:46:28.998-0500 d30023| {&quot;t&quot;:{&quot;$date&quot;:&quot;2020-03-04T17:46:28.998-0500&quot;},&quot;s&quot;:&quot;I&quot;, &quot;c&quot;:&quot;SHARDING&quot;,&quot;id&quot;:4661202,&quot;ctx&quot;:&quot;conn48&quot;,&quot;msg&quot;:&quot;Wanted shard version? {wanted}&quot;,&quot;attr&quot;:{&quot;wanted&quot;:{&quot;0&quot;:{&quot;$timestamp&quot;:{&quot;t&quot;:3,&quot;i&quot;:1}},&quot;1&quot;:{&quot;$oid&quot;:&quot;5e602fc47e032f943bc14cec&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;/li&gt;
&lt;/ol&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                                                <inwardlinks description="split from">
                                        <issuelink>
            <issuekey id="1170108">SERVER-46309</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="255639" name="debugging.patch" size="15512" author="ted.tuckman@mongodb.com" created="Thu, 9 Apr 2020 19:37:31 +0000"/>
                            <attachment id="255642" name="failing.resmoke.out" size="4180384" author="ted.tuckman@mongodb.com" created="Thu, 9 Apr 2020 19:38:45 +0000"/>
                            <attachment id="255643" name="passing.resmoke.out" size="3886864" author="ted.tuckman@mongodb.com" created="Thu, 9 Apr 2020 19:38:57 +0000"/>
                            <attachment id="251106" name="read_preference_stale_mongos.js" size="2958" author="charlie.swanson@mongodb.com" created="Thu, 5 Mar 2020 15:18:02 +0000"/>
                            <attachment id="251107" name="union_with_read_preference.js" size="6934" author="charlie.swanson@mongodb.com" created="Thu, 5 Mar 2020 15:18:02 +0000"/>
                            <attachment id="255640" name="union_with_read_preference_v2.js" size="7485" author="ted.tuckman@mongodb.com" created="Thu, 9 Apr 2020 19:37:58 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></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>Thu, 9 Apr 2020 19:39:11 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 42 weeks, 2 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1157</customfieldvalue>
                        </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>
                            3 years, 42 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>ted.tuckman@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hx05af:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hwvzv3:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="3494">Query 2020-03-09</customfieldvalue>
    <customfieldvalue id="3497">Query 2020-04-06</customfieldvalue>
    <customfieldvalue id="3498">Query 2020-04-20</customfieldvalue>
    <customfieldvalue id="3499">Query 2020-05-04</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|hwzrjr:</customfieldvalue>

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