<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:02:49 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-65469] Don&apos;t invariant in PrimaryOnlyService::lookupInstance during a lock-free read</title>
                <link>https://jira.mongodb.org/browse/SERVER-65469</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;PrimaryOnlyService::lookupInstance() &lt;a href=&quot;https://github.com/10gen/mongo/blob/88ca6f5b2ebcad527056aab6d12cbc9137ace4cf/src/mongo/db/repl/primary_only_service.cpp#L544&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;invariants a list of various conditions&lt;/a&gt; in order to prevent a possible deadlock during the case described in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51650&quot; title=&quot;Primary-Only Service&amp;#39;s _rebuildCV should be notified even if stepdown happens quickly after stepup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51650&quot;&gt;&lt;del&gt;SERVER-51650&lt;/del&gt;&lt;/a&gt;. This invariant currently fails if lookupInstance() is called during a lock-free read which holds the &lt;a href=&quot;https://github.com/10gen/mongo/blob/ce04644c9b7376da93fa588c963c90406390e538/src/mongo/db/db_raii.cpp#L955&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;global lock in mode IS&lt;/a&gt; as seen in BF-24817. Since a lock-free read doesn&apos;t hold any locks which would prevent a step down, they should be &lt;a href=&quot;https://github.com/10gen/mongo/blob/ce04644c9b7376da93fa588c963c90406390e538/src/mongo/db/operation_context.h#L319&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;excepted&lt;/a&gt; from the invariant.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2022709">SERVER-65469</key>
            <summary>Don&apos;t invariant in PrimaryOnlyService::lookupInstance during a lock-free read</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="brett.nawrocki@mongodb.com">Brett Nawrocki</assignee>
                                    <reporter username="brett.nawrocki@mongodb.com">Brett Nawrocki</reporter>
                        <labels>
                            <label>sharding-nyc-subteam1</label>
                    </labels>
                <created>Mon, 11 Apr 2022 22:18:17 +0000</created>
                <updated>Tue, 12 Apr 2022 16:23:06 +0000</updated>
                            <resolved>Tue, 12 Apr 2022 16:23:06 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4476446" author="max.hirschhorn@10gen.com" created="Tue, 12 Apr 2022 12:00:23 +0000"  >&lt;blockquote&gt;
&lt;p&gt;What are the use cases under which we need to be acquiring a POS while holding a lock?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev@mongodb.com&quot;&gt;kaloian.manassiev@mongodb.com&lt;/a&gt;, I can&apos;t speak for all use cases where we&apos;re holding locks but the two we&apos;ve had come up in resharding are:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/r5.0.7/src/mongo/db/s/resharding/resharding_op_observer.cpp#L219-L238&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Updating the in&amp;#45;memory state of the corresponding ReshardingCoordinator instance&lt;/a&gt; on storage transaction commit when a participant shard writes to the config.reshardingOperations collection. (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61482&quot; title=&quot;Updates to config.reshardingOperations wait for PrimaryOnlyService to be rebuilt while holding oplog slot, stalling replication on config server indefinitely&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61482&quot;&gt;&lt;del&gt;SERVER-61482&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-49572&quot; title=&quot;Implement onReshardingParticipantTransition in the ReshardingCoordinatorObserver&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-49572&quot;&gt;&lt;del&gt;SERVER-49572&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/ecbaddb63705f5ac10f299a539a584d24fcfa20c/src/mongo/db/s/collection_sharding_runtime.cpp#L371-L407&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Updating the in&amp;#45;memory state of the corresponding DonorStateMachine instance&lt;/a&gt; to track when a read or write operation came in while the sharding critical section is held for the namespace. (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-64372&quot; title=&quot;Track and Report Parity Donor Fields in CurrentOp&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-64372&quot;&gt;&lt;del&gt;SERVER-64372&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Maybe for (2) it would be preferable to increment the counter &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e7544180078415f6dd6bce44b90033f2599abf52/src/mongo/db/service_entry_point_common.cpp#L1688-L1694&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;in service&amp;#95;entry&amp;#95;point&amp;#95;common.cpp&lt;/a&gt; after locks, storage engine snapshots, etc. have already been released.&lt;/p&gt;

&lt;p&gt;An alternative to (1) which I think Esha had proposed in the past would be to have a decided command for participant shards to run on the config server primary to update the config.reshardingOperations collection and then not as an OpObserver update the ReshardingCoordinator instance in&amp;#45;memory state. As part of the Global Index Coordinator we can see about doing away with some of the complex work which happens in an OpObserver.&lt;/p&gt;</comment>
                            <comment id="4475986" author="kaloian.manassiev" created="Tue, 12 Apr 2022 07:27:51 +0000"  >&lt;p&gt;What are the use cases under which we need to be acquiring a POS while holding a lock? The POS reads from disk, has thread management and so on. Therefore we should not be acquiring it while holding locks or while on the path of a CRUD operation. In addition to locks, LFR could also be holding storage engine snapshots (which is effectively locks just at some lower level), acquiring the POS does the same, therefore there are subtle circular dependencies that are not expressed in terms of the lock graph.&lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=max.hirschhorn%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;max.hirschhorn@mongodb.com&quot;&gt;max.hirschhorn@mongodb.com&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1515354">SERVER-51650</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1997989">SERVER-64372</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 12 Apr 2022 07:27:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 43 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>brett.nawrocki@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 43 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>135.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>brett.nawrocki@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0qsrj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i09rqs:</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="5733">Sharding NYC 2022-04-18</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</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|i0qewv:</customfieldvalue>

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