<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:31:41 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-53723] The getMore command should not take a nested AutoGetCollectionForReadCommand instance for agg cursors when waitAfterPinningCursorBeforeGetMoreBatch is enabled</title>
                <link>https://jira.mongodb.org/browse/SERVER-53723</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/69ff284997164b653421175dd0d76de8e5e1f310/src/mongo/db/pipeline/process_interface/common_mongod_process_interface.cpp#L159&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CommonMongodProcessInterface::getIndexStats() instantiates an AutoGetCollectionForReadCommand instance&lt;/a&gt;. That code can be called by the &lt;tt&gt;getMore&lt;/tt&gt; command per this stack trace in the linked BF.&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;.........&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA593352F9C&quot;,&quot;b&quot;:&quot;7FA593347000&quot;,&quot;o&quot;:&quot;BF9C&quot;,&quot;s&quot;:&quot;_ZN5mongo24AutoGetCollectionForReadC2EPNS_16OperationContextERKNS_21NamespaceStringOrUUIDENS_25AutoGetCollectionViewModeENS_6Date_tE&quot;,&quot;s+&quot;:&quot;3C&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.264+0000 d20521| 2021-01-08T14:59:41.262+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA593357962&quot;,&quot;b&quot;:&quot;7FA593347000&quot;,&quot;o&quot;:&quot;10962&quot;,&quot;s&quot;:&quot;_ZN5mongo35AutoGetCollectionForReadCommandBaseINS_24AutoGetCollectionForReadEEC2EPNS_16OperationContextERKNS_21NamespaceStringOrUUIDENS_25AutoGetCollectionViewModeENS_6Date_tENS_16AutoStatsTracker7LogModeE&quot;,&quot;s+&quot;:&quot;32&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.265+0000 d20521| 2021-01-08T14:59:41.262+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA595B5FA0E&quot;,&quot;b&quot;:&quot;7FA595B41000&quot;,&quot;o&quot;:&quot;1EA0E&quot;,&quot;s&quot;:&quot;_ZN5mongo28CommonMongodProcessInterface13getIndexStatsEPNS_16OperationContextERKNS_15NamespaceStringENS_10StringDataEb&quot;,&quot;s+&quot;:&quot;15E&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.265+0000 d20521| 2021-01-08T14:59:41.262+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA592F52B7D&quot;,&quot;b&quot;:&quot;7FA592E2B000&quot;,&quot;o&quot;:&quot;127B7D&quot;,&quot;s&quot;:&quot;_ZN5mongo24DocumentSourceIndexStats9doGetNextEv&quot;,&quot;s+&quot;:&quot;ED&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.265+0000 d20521| 2021-01-08T14:59:41.262+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA592F011E4&quot;,&quot;b&quot;:&quot;7FA592E2B000&quot;,&quot;o&quot;:&quot;D61E4&quot;,&quot;s&quot;:&quot;_ZN5mongo14DocumentSource7getNextEv&quot;,&quot;s+&quot;:&quot;44&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.265+0000 d20521| 2021-01-08T14:59:41.262+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA592F4BE03&quot;,&quot;b&quot;:&quot;7FA592E2B000&quot;,&quot;o&quot;:&quot;120E03&quot;,&quot;s&quot;:&quot;_ZN5mongo19DocumentSourceGroup10initializeEv&quot;,&quot;s+&quot;:&quot;63&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.265+0000 d20521| 2021-01-08T14:59:41.262+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA592F4D0A9&quot;,&quot;b&quot;:&quot;7FA592E2B000&quot;,&quot;o&quot;:&quot;1220A9&quot;,&quot;s&quot;:&quot;_ZN5mongo19DocumentSourceGroup9doGetNextEv&quot;,&quot;s+&quot;:&quot;A9&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.265+0000 d20521| 2021-01-08T14:59:41.265+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA592F011E4&quot;,&quot;b&quot;:&quot;7FA592E2B000&quot;,&quot;o&quot;:&quot;D61E4&quot;,&quot;s&quot;:&quot;_ZN5mongo14DocumentSource7getNextEv&quot;,&quot;s+&quot;:&quot;44&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.265+0000 d20521| 2021-01-08T14:59:41.265+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA592FBDDEC&quot;,&quot;b&quot;:&quot;7FA592E2B000&quot;,&quot;o&quot;:&quot;192DEC&quot;,&quot;s&quot;:&quot;_ZN5mongo8Pipeline7getNextEv&quot;,&quot;s+&quot;:&quot;3C&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.266+0000 d20521| 2021-01-08T14:59:41.265+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA59416CCBB&quot;,&quot;b&quot;:&quot;7FA594013000&quot;,&quot;o&quot;:&quot;159CBB&quot;,&quot;s&quot;:&quot;_ZN5mongo20PlanExecutorPipeline8_getNextEv&quot;,&quot;s+&quot;:&quot;2B&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.266+0000 d20521| 2021-01-08T14:59:41.266+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA59416CD8F&quot;,&quot;b&quot;:&quot;7FA594013000&quot;,&quot;o&quot;:&quot;159D8F&quot;,&quot;s&quot;:&quot;_ZN5mongo20PlanExecutorPipeline15getNextDocumentEPNS_8DocumentEPNS_8RecordIdE&quot;,&quot;s+&quot;:&quot;4F&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.266+0000 d20521| 2021-01-08T14:59:41.266+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA59416CF0E&quot;,&quot;b&quot;:&quot;7FA594013000&quot;,&quot;o&quot;:&quot;159F0E&quot;,&quot;s&quot;:&quot;_ZN5mongo20PlanExecutorPipeline7getNextEPNS_7BSONObjEPNS_8RecordIdE&quot;,&quot;s+&quot;:&quot;EE&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.266+0000 d20521| 2021-01-08T14:59:41.266+00:00 I  CONTROL  31445   [conn53] &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;&quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA58E1EF66B&quot;,&quot;b&quot;:&quot;7FA58E139000&quot;,&quot;o&quot;:&quot;B666B&quot;,&quot;s&quot;:&quot;_ZN5mongo12_GLOBAL__N_110GetMoreCmd10Invocation28acquireLocksAndIterateCursorEPNS_16OperationContextEPNS_3rpc21ReplyBuilderInterfaceEPNS_13CursorManagerERNS_15ClientCursorPinEPNS_5CurOpE.isra.1022&quot;,&quot;s+&quot;:&quot;105B&quot;}}[js_test:kill_pinned_cursor] 2021-01-08T14:59:41.273+0000 d20521| 2021-01-08T14:59:41.273+00:00 I  CONTROL  31445   [conn53] &quot;Frame&quot;,&quot;attr&quot;:{&quot;frame&quot;:{&quot;a&quot;:&quot;7FA58E1F153A&quot;,&quot;b&quot;:&quot;7FA58E139000&quot;,&quot;o&quot;:&quot;B853A&quot;,&quot;s&quot;:&quot;_ZN5mongo12_GLOBAL__N_110GetMoreCmd10Invocation3runEPNS_16OperationContextEPNS_3rpc21ReplyBuilderInterfaceE&quot;,&quot;s+&quot;:&quot;19A&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;.........&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;The invariant problem showing this stack trace has been fixed by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53701&quot; title=&quot;GetMore cmd&amp;#39;s CommonMongodProcessInterface::getIndexStats() must use a LFR lock helper&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53701&quot;&gt;&lt;del&gt;SERVER-53701&lt;/del&gt;&lt;/a&gt;. However, the invariant was only possible to hit if the &lt;tt&gt;AutoGetCollectionForReadCommand&lt;/tt&gt; instance was nested under a higher level lock helper instance. &lt;tt&gt;AutoGetCollectionForReadCommand&lt;/tt&gt; contains an AutoStatsTracker and handles CurrentOp and Top entry updates: there&apos;s already a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/69ff284997164b653421175dd0d76de8e5e1f310/src/mongo/db/commands/getmore_cmd.cpp#L391&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;higher level AutoStatsTracker&lt;/a&gt; for the code path in question.&lt;/p&gt;

&lt;p&gt;I suspect the getMore command has &lt;a href=&quot;https://github.com/mongodb/mongo/blob/69ff284997164b653421175dd0d76de8e5e1f310/src/mongo/db/commands/getmore_cmd.cpp#L390&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this AutoGetCollectionForRead&lt;/a&gt; instance instantiated when calling into CommonMongodProcessInterface::getIndexStats().&lt;/p&gt;</description>
                <environment></environment>
        <key id="1587716">SERVER-53723</key>
            <summary>The getMore command should not take a nested AutoGetCollectionForReadCommand instance for agg cursors when waitAfterPinningCursorBeforeGetMoreBatch is enabled</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="david.storch@mongodb.com">David Storch</assignee>
                                    <reporter username="dianna.hohensee@mongodb.com">Dianna Hohensee</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jan 2021 21:08:26 +0000</created>
                <updated>Sun, 29 Oct 2023 21:58:54 +0000</updated>
                            <resolved>Tue, 2 Feb 2021 17:07:38 +0000</resolved>
                                                    <fixVersion>4.9.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3595084" author="xgen-internal-githook" created="Tue, 2 Feb 2021 17:06:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;David Storch&apos;, &apos;email&apos;: &apos;david.storch@mongodb.com&apos;, &apos;username&apos;: &apos;dstorch&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53723&quot; title=&quot;The getMore command should not take a nested AutoGetCollectionForReadCommand instance for agg cursors when waitAfterPinningCursorBeforeGetMoreBatch is enabled&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53723&quot;&gt;&lt;del&gt;SERVER-53723&lt;/del&gt;&lt;/a&gt; Prevent failpoint from mistakenly acquiring db_raii helper during getMore on agg cursor&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e0602a389d6a9d842b73fd9b22c9046b046131d7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e0602a389d6a9d842b73fd9b22c9046b046131d7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3588767" author="david.storch" created="Fri, 29 Jan 2021 00:23:21 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dianna.hohensee&quot; class=&quot;user-hover&quot; rel=&quot;dianna.hohensee&quot;&gt;dianna.hohensee&lt;/a&gt;, thanks for bringing this to our attention! There is probably an argument to be made that &lt;tt&gt;getIndexStats()&lt;/tt&gt; should switch from &lt;tt&gt;AutoGetCollectionForReadCommandMaybeLockFree&lt;/tt&gt; to &lt;tt&gt;AutoGetCollectionForReadMaybeLockFree&lt;/tt&gt;. My understanding of the difference is that the former has an &lt;tt&gt;AutoStatsTracker&lt;/tt&gt; for setting up some state related to &lt;tt&gt;Top&lt;/tt&gt; and &lt;tt&gt;CurOp&lt;/tt&gt;, whereas the latter does not have an &lt;tt&gt;AutoStatsTracker&lt;/tt&gt;. However, I don&apos;t think that is quite the right fix here.&lt;/p&gt;

&lt;p&gt;The reason is that &lt;tt&gt;CommonMongodProcessInterface::getIndexStats()&lt;/tt&gt; is only called from aggregate cursors, not find cursors. When a &lt;tt&gt;getMore&lt;/tt&gt; is run against an aggregate cursor, it actually does not acquire &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0d6199bb52dcae5978551816c6ac4ad98bda165b/src/mongo/db/commands/getmore_cmd.cpp#L390&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the AutoGetCollectionForReadCommandMaybeLockFree here&lt;/a&gt;. (This is because &lt;tt&gt;PlanExecutors&lt;/tt&gt; for the aggregation subsystem have a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0d6199bb52dcae5978551816c6ac4ad98bda165b/src/mongo/db/commands/getmore_cmd.cpp#L393-L403&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;locks internally&quot; lock policy&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;So if this is the case, then how did the invariant you observed trip, indicating that two AutoGet* objects were held at the same time? I believe the reason is that the failing test, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0d6199bb52dcae5978551816c6ac4ad98bda165b/jstests/sharding/kill_pinned_cursor.js&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;kill_pinned_cursor.js&lt;/a&gt;, turns on the &quot;waitAfterPinningCursorBeforeGetMoreBatch&quot;. It looks like there is a mistake in the implementation of this failpoint. It &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0d6199bb52dcae5978551816c6ac4ad98bda165b/src/mongo/db/commands/getmore_cmd.cpp#L490-L495&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;tries to release and reacquire the AutoGet*&lt;/a&gt;, but this will have the unintended consequence of acquiring the AutoGet* if it is not held in the first place. The &lt;tt&gt;AutoGetCollectionForReadMaybeLockFree&lt;/tt&gt; should never be acquired here for a getMore against an agg cursor. I will propose a change that fixes the failpoint&apos;s implementation and send it to you for review.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1587964">SERVER-53732</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1586245">SERVER-53701</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_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>Fri, 29 Jan 2021 00:23:21 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 1 week, 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_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_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, 1 week, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>25.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>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyp48n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyauiv:</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="4461">Query 2021-02-08</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|hyoqhz:</customfieldvalue>

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