<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:13 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-2439] Cluster time should not be gossipped to a standalone</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2439</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;In SPEC-1015, I discussed a scenario whereby I witnessed libmongoc append &lt;tt&gt;$clusterTime&lt;/tt&gt; to an outgoing command to a 3.6 standalone server:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;While implementing the eleventh &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/causal-consistency/causal-consistency.rst#test-plan&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;causal consistency spec test&lt;/a&gt; for PHPC, I found an odd behavior in libmongoc. The test plan states:&lt;/p&gt;

&lt;p&gt;11. When connected to a deployment that does not support cluster times messages sent to the server should not include $clusterTime&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;skip this test when connected to a deployment that does support cluster times&lt;/li&gt;
	&lt;li&gt;document = collection.findOne({})&lt;/li&gt;
	&lt;li&gt;capture the command sent to the server&lt;/li&gt;
	&lt;li&gt;assert that the command does not include a $clusterTime field&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;As-is, this test uses an implicit client session. If we connect to a standalone (any version) or a replica set or shard cluster (pre-3.6), we will not see the driver add &lt;tt&gt;$clusterTime&lt;/tt&gt; to an outgoing command document. This is because the client session itself has no cluster time, nor does the driver&apos;s client object (&lt;tt&gt;isMaster&lt;/tt&gt; would not have reported a cluster time).&lt;/p&gt;

&lt;p&gt;After implementing the test as-is, I then modified it to use an explicit client session. I then manually advanced the cluster time of that client session. When running the modified test against a 3.6 standalone, I witnessed libmongoc append &lt;tt&gt;$clusterTime&lt;/tt&gt; to the outgoing command document. The 3.6 standalone seemed to happily ignore the extra field.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I believe this was due to libmongoc only &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0/src/mongoc/mongoc-cmd.c#L662&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;checking if cluster time is non-NULL and OP_MSG is being used in &lt;tt&gt;mongoc_cmd_parts_assemble()&lt;/tt&gt;&lt;/a&gt;. Depending on the outcome of SPEC-1015, I think it would be correct to also examine the server type.&lt;/p&gt;</description>
                <environment></environment>
        <key id="475340">CDRIVER-2439</key>
            <summary>Cluster time should not be gossipped to a standalone</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="jmikola@mongodb.com">Jeremy Mikola</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Dec 2017 18:16:50 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:13 +0000</updated>
                            <resolved>Mon, 30 Apr 2018 18:50:59 +0000</resolved>
                                                    <fixVersion>1.10.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1877994" author="xgen-internal-githook" created="Mon, 30 Apr 2018 16:08:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;, &apos;name&apos;: &apos;Jeremy Mikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2439&quot; title=&quot;Cluster time should not be gossipped to a standalone&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2439&quot;&gt;&lt;del&gt;CDRIVER-2439&lt;/del&gt;&lt;/a&gt; fix rs isMaster response for _test_dollar_query()&lt;/p&gt;

&lt;p&gt;These tests attempted to simulate a primary or secondary, but the isMaster&lt;br/&gt;
response indicated a standalone due to the lack of &quot;setName&quot;, &quot;ismaster&quot;,&lt;br/&gt;
and &quot;secondary&quot; fields.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/e1f042e76cb7a0a605acdecd0fef536b09e739da&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/e1f042e76cb7a0a605acdecd0fef536b09e739da&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1877993" author="xgen-internal-githook" created="Mon, 30 Apr 2018 16:08:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jmikola@gmail.com&apos;, &apos;username&apos;: &apos;jmikola&apos;, &apos;name&apos;: &apos;Jeremy Mikola&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2439&quot; title=&quot;Cluster time should not be gossipped to a standalone&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2439&quot;&gt;&lt;del&gt;CDRIVER-2439&lt;/del&gt;&lt;/a&gt; don&apos;t gossip cluster time to standalones&lt;/p&gt;

&lt;p&gt;This addresses an edge case where an explicit session&apos;s cluster time may&lt;br/&gt;
have been manually advanced. Under normal usage, sessions used with a&lt;br/&gt;
standalone will always have an empty cluster time.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/2f8fc08e42820a4286617e16fd708dcdf6404129&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/2f8fc08e42820a4286617e16fd708dcdf6404129&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1875544" author="jmikola@gmail.com" created="Thu, 26 Apr 2018 20:41:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/pull/494&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/pull/494&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1875541" author="jmikola@gmail.com" created="Thu, 26 Apr 2018 20:36:16 +0000"  >&lt;p&gt;I do think the three bullets in SPEC-1015 that &quot;advocate against sending $clusterTime to a standalone&quot; justify addressing this.&lt;/p&gt;

&lt;p&gt;I&apos;d argue in favor of adding &lt;tt&gt;&amp;amp;&amp;amp; server_type != MONGOC_SERVER_STANDALONE&lt;/tt&gt; to &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0/src/mongoc/mongoc-cmd.c#L662&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this line&lt;/a&gt; and calling it a day.&lt;/p&gt;
</comment>
                            <comment id="1875502" author="jesse" created="Thu, 26 Apr 2018 20:00:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmikola&quot; class=&quot;user-hover&quot; rel=&quot;jmikola&quot;&gt;jmikola&lt;/a&gt;, on SPEC-1015 Bernie wrote, &quot;This situation seems so unlikely I don&apos;t think we should spend time changing all drivers to disallow it.&quot; Shall we make this C Driver change or ignore it?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </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-2498</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hteb8f:</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>