<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:04:12 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>[JAVA-5288] Sessions do not work with deployments with hidden members</title>
                <link>https://jira.mongodb.org/browse/JAVA-5288</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;I&apos;m unable to unable to start session on a deployment that contains hidden member.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Pleaseprovidetheversionofthedriver.Ifapplicable%2CpleaseprovidetheMongoDBserverversionandtopology%28standalone%2Creplicaset%2Corshardedcluster%29.&quot;&gt;&lt;/a&gt;Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).&lt;/h4&gt;

&lt;p&gt;Driver version is 3.12.11. I believe all versions are affected. See the next section for a topology compose file.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;

&lt;p&gt;See &lt;a href=&quot;https://github.com/lbrdnk/mongo-java-driver-repro&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this github repository&lt;/a&gt; containing reproduction. Run the compose file and test.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Why I think this is a bug.&lt;/em&gt; &lt;a href=&quot;https://www.mongodb.com/docs/manual/reference/server-sessions/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Server sessions documentation&lt;/a&gt; contains no mention of sessions not being available for hidden members. Same holds for &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sessions specification&lt;/a&gt;. Also &lt;a href=&quot;https://www.mongodb.com/docs/manual/core/replica-set-hidden-member/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;docs on hidden members&lt;/a&gt; contain no information on that and present hidden member as a secondary.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Driver code.&lt;/em&gt; I&apos;ve checked the driver code as information why this should not work was not available elsewhere. While session is started (&lt;tt&gt;MongoClientDelegate.createClientSession&lt;/tt&gt;), &lt;tt&gt;ClusterDescription.getLogicalSessionTimeoutMinutes&lt;/tt&gt; is used to determine whether sessions are supported by a cluster &#8211; as advised by sessions specification. That method filters&#160;&lt;tt&gt;ServerDescriptions&lt;/tt&gt; picking only&#160;&lt;tt&gt;primary&lt;/tt&gt; and&#160;&lt;tt&gt;secondary&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;With this deployment and way&#160; of connecting, there is only one server description &#8211; hidden member which has a type &lt;tt&gt;REPLICA_SET_OTHER }}hence will be filtered out. But the hidden member docs advertise it as a {{{}secondary&lt;/tt&gt;. And also this hidden member has value of &lt;tt&gt;logicalSessionTimeoutMinutes&lt;/tt&gt; set, so I presume it should be capable of handling sessions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Possible solution.&lt;/em&gt; Would it make sense to consider hidden member secondary?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Why do I need this?&lt;/em&gt; Hidden member docs advise to use this feature for non-standard workloads as eg. analytics. That exactly is my use case. I need to use sessions here to be able to kill running operations.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Aside on standalone deployments.&lt;/em&gt; General docs I&apos;ve linked say, that sessions are only available for replica sets and sharded clusters. But we are able to run sessions also on standalone deployments. It seems like inconsistency.&lt;/p&gt;

&lt;p&gt;Thank you in advance for looking into this.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2538489">JAVA-5288</key>
            <summary>Sessions do not work with deployments with hidden members</summary>
                <type id="6" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14720&amp;avatarType=issuetype">Question</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="lbr.dnk@posteo.net">Libor Danek</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Jan 2024 20:19:27 +0000</created>
                <updated>Tue, 30 Jan 2024 17:54:08 +0000</updated>
                            <resolved>Tue, 30 Jan 2024 17:54:08 +0000</resolved>
                                                                    <component>Sessions</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="6015552" author="jeff.yemin" created="Tue, 16 Jan 2024 21:36:23 +0000"  >&lt;p&gt;Yes, that&apos;s right.  I think that&apos;s the only thing you can do with a session on a standalone.&lt;/p&gt;</comment>
                            <comment id="6015546" author="JIRAUSER1276759" created="Tue, 16 Jan 2024 21:34:38 +0000"  >&lt;p&gt;I&apos;m using sessions to kill running aggregations. Timeout is not an option for me, as the aggregation needs to be killed in a moment when eg. user decides it is taking too long. I&apos;m not sure if killing a session is what you&apos;ve meant &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-1109?focusedCommentId=1747448&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1747448&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;in this comment&lt;/a&gt;, but after reading it and reading the java api, I&apos;ve found that the most straightforward way of achieving what I needed.&lt;/p&gt;</comment>
                            <comment id="6015298" author="jeff.yemin" created="Tue, 16 Jan 2024 20:36:41 +0000"  >&lt;p&gt;There is some ambiguity here.  While it&apos;s true that standalones support sessions, the support they provide is very limited. In particular, they don&apos;t support&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;causal consistency (though all operations are trivially causally consistent on as standalone, they don&apos;t support the mechanism for it used by replica sets)&lt;/li&gt;
	&lt;li&gt;retryable writes (though you don&apos;t need a ClientSession for this, server sessions are used for them under the covers by the driver)&lt;/li&gt;
	&lt;li&gt;transactions (not supported at all on standalones)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So while it&apos;s technically true that you can start a ClientSession on a standalone, you can&apos;t do much with it.&lt;/p&gt;</comment>
                            <comment id="6013250" author="JIRAUSER1276759" created="Tue, 16 Jan 2024 11:02:30 +0000"  >&lt;p&gt;The library is called [monger|&lt;a href=&quot;https://github.com/michaelklishin/monger&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/michaelklishin/monger&lt;/a&gt;]. It is a clojure library. It uses 3.12.11 mongo java driver version. Interface for sessions is not provided there, so I had to use driver java driver code directly. As I&apos;m using only a small subset of what it provides, I&apos;ll attempt to wrap newer version of the java driver alone and see later if it would make sense to attempt merging my code that back into the library.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;With regards documentation change, I&apos;m able to start session eg. on standalone deployment, which is ruled out by the sentence &quot;...sessions are only available for replica sets and sharded clusters...&quot;. Link to the doc is in the ticket description. Moreover, eg. &lt;a href=&quot;https://github.com/mongodb/specifications/blob/2176bbac035263d9397b585c5e70ac1a97359757/source/sessions/tests/README.rst#testing-against-servers-that-do-not-support-sessions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sessions test spec&lt;/a&gt; mentions that: &quot;...all regular 3.6+ servers support sessions...&quot;. If the latter is true, I believe that should be mentioned in the docs instead. If not, I believe I should be able to find there a mention of standalone deployment compatibility.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks for the clarification in advance, if my interpretation is incorrect &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;.&lt;/p&gt;</comment>
                            <comment id="6012311" author="jeff.yemin" created="Mon, 15 Jan 2024 18:22:43 +0000"  >&lt;p&gt;&amp;gt; I&apos;m using the driver as part of another library, but I&apos;ll attempt the upgrade.&lt;/p&gt;

&lt;p&gt;Let us know which library please, and also whether the upgrade is successful.&lt;/p&gt;

&lt;p&gt;&amp;gt;  I believe that line is not correct. Should I open another ticket for that?&lt;/p&gt;

&lt;p&gt;I can do it on your behalf, but what would you like it to say instead?&lt;/p&gt;</comment>
                            <comment id="6012290" author="JIRAUSER1276759" created="Mon, 15 Jan 2024 18:03:28 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jeff.yemin%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;jeff.yemin@mongodb.com&quot;&gt;jeff.yemin@mongodb.com&lt;/a&gt;. Thank you for the prompt reply. Good to know that sessions work with hidden members from version 4.10.0. I&apos;m using the driver as part of another library, but I&apos;ll attempt the upgrade. I believe we can close this issue.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;With regards to &lt;a href=&quot;https://www.mongodb.com/docs/manual/reference/server-sessions/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;server sessions documentation&lt;/a&gt; mentioning that &quot;Server sessions are available for replica sets and sharded clusters only&quot;, I believe that line is not correct. Should I open another ticket for that?&lt;/p&gt;</comment>
                            <comment id="6011649" author="dbeng-pm-bot" created="Mon, 15 Jan 2024 13:10:26 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lbr.dnk%40posteo.net&quot; class=&quot;user-hover&quot; rel=&quot;lbr.dnk@posteo.net&quot;&gt;lbr.dnk@posteo.net&lt;/a&gt;! &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-5288&quot; title=&quot;Sessions do not work with deployments with hidden members&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-5288&quot;&gt;&lt;del&gt;JAVA-5288&lt;/del&gt;&lt;/a&gt; is awaiting your response. &lt;/p&gt;

&lt;p&gt;If this is still an issue for you, please open Jira to review the latest status and provide your feedback. Thanks!&lt;/p&gt;</comment>
                            <comment id="5990429" author="jeff.yemin" created="Fri, 5 Jan 2024 22:34:17 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lbr.dnk%40posteo.net&quot; class=&quot;user-hover&quot; rel=&quot;lbr.dnk@posteo.net&quot;&gt;lbr.dnk@posteo.net&lt;/a&gt; , I suspect this was an oversight in the original specification, or perhaps the Java driver&apos;s implementation, of client sessions.&#160; In scope of &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-4860&quot; title=&quot;Do not perform server selection to determine sessions support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-4860&quot;&gt;&lt;del&gt;JAVA-4860&lt;/del&gt;&lt;/a&gt;, the logic that is preventing it from working in earlier releases was removed, so as of 4.10.0 it will work as you expect.&lt;/p&gt;

&lt;p&gt;Given that you are the first to report this issue, I gather that the combination of hidden members and sessions is uncommon.&#160; Sorry this bit you and I hope you are able to upgrade the driver.&lt;/p&gt;</comment>
                            <comment id="5990018" author="dbeng-pm-bot" created="Fri, 5 Jan 2024 20:19:30 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lbr.dnk%40posteo.net&quot; class=&quot;user-hover&quot; rel=&quot;lbr.dnk@posteo.net&quot;&gt;lbr.dnk@posteo.net&lt;/a&gt;, thank you for reporting this issue! The team will look into it and get back to you soon. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2247313">JAVA-4860</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                        <customfield id="customfield_23812" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Assigned Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26447"><![CDATA[Java Drivers]]></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_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.  What would you like to communicate to the user about this feature?&lt;br/&gt;
2.  Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3.  Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

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