<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:52:01 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-39424] Test that DDL operations can&apos;t succeed after prepared transactions are aborted during shutdown</title>
                <link>https://jira.mongodb.org/browse/SERVER-39424</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Once the UninterruptibleLockGuard work is completed and all &lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt; s that conflict with prepared transactions are removed, we should verify that DDL operations are successfully killed and they cannot succeed after prepared transactions have been aborted during shutdown. &lt;/p&gt;</description>
                <environment></environment>
        <key id="685557">SERVER-39424</key>
            <summary>Test that DDL operations can&apos;t succeed after prepared transactions are aborted during shutdown</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="dianna.hohensee@mongodb.com">Dianna Hohensee</assignee>
                                    <reporter username="samy.lanka@mongodb.com">Samyukta Lanka</reporter>
                        <labels>
                            <label>prepare_testing</label>
                            <label>txn_storage</label>
                    </labels>
                <created>Thu, 7 Feb 2019 20:23:07 +0000</created>
                <updated>Mon, 8 Jan 2024 15:23:13 +0000</updated>
                            <resolved>Tue, 30 Apr 2019 21:00:06 +0000</resolved>
                                                    <fixVersion>4.1.11</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="2230097" author="xgen-internal-githook" created="Wed, 1 May 2019 00:38:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;justin.seyster@mongodb.com&apos;, &apos;name&apos;: &apos;Justin Seyster&apos;, &apos;username&apos;: &apos;jseyster&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39424&quot; title=&quot;Test that DDL operations can&amp;#39;t succeed after prepared transactions are aborted during shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39424&quot;&gt;&lt;del&gt;SERVER-39424&lt;/del&gt;&lt;/a&gt; Lint fixup&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/55790d8e6b46a8d337dbc069d04fa12fda5e9583&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/55790d8e6b46a8d337dbc069d04fa12fda5e9583&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2229915" author="xgen-internal-githook" created="Tue, 30 Apr 2019 20:59:35 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;dianna.hohensee@10gen.com&apos;, &apos;name&apos;: &apos;Dianna&apos;, &apos;username&apos;: &apos;DiannaHohensee&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39424&quot; title=&quot;Test that DDL operations can&amp;#39;t succeed after prepared transactions are aborted during shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39424&quot;&gt;&lt;del&gt;SERVER-39424&lt;/del&gt;&lt;/a&gt; Test that a DDL op started after a prepared transaction fails during shutdown&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/11681d3507d05bf2c5b7873d96239b3bbfbca0dd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/11681d3507d05bf2c5b7873d96239b3bbfbca0dd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2224927" author="dianna.hohensee" created="Thu, 25 Apr 2019 17:05:33 +0000"  >&lt;p&gt;I&apos;ve verified my reasoning is correct by running the create collection command concurrently with shutdown, such that it&apos;s lock request is enqueued behind the RSTL lock. The cmd failed in the lock acquisition code, as anticipated&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;13.679-0400 d43061| 2019-04-25T12:57:13.678-0400 I  STORAGE  [conn2] sleeping before closing transportation layer&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;13.817-0400 d43061| 2019-04-25T12:57:13.817-0400 I  COMMAND  [conn1] create collection failpoint, sleeping&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;16.679-0400 d43061| 2019-04-25T12:57:16.679-0400 I  STORAGE  [conn2] done sleeping&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;16.679-0400 d43061| 2019-04-25T12:57:16.679-0400 I  NETWORK  [conn2] shutdown: going to close listening sockets...&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;16.680-0400 d43061| 2019-04-25T12:57:16.679-0400 I  NETWORK  [conn2] removing socket file: /tmp/mongodb-43061.sock&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;16.681-0400 d43061| 2019-04-25T12:57:16.680-0400 I  STORAGE  [conn2] enqueued RSTL lock, sleeping before killing ops&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;17.817-0400 d43061| 2019-04-25T12:57:17.817-0400 I  COMMAND  [conn1] done sleeping in create collection&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;17.817-0400 d43061| 2019-04-25T12:57:17.817-0400 I  COMMAND  [conn1] starting collection creation, after index creation?&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;17.817-0400 d43061| 2019-04-25T12:57:17.817-0400 I  -        [conn1] ~~~waiting for lock&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;18.318-0400 d43061| 2019-04-25T12:57:18.318-0400 I  -        [conn1] ~~~waiting for lock&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;18.818-0400 d43061| 2019-04-25T12:57:18.818-0400 I  -        [conn1] ~~~waiting for lock&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;19.319-0400 d43061| 2019-04-25T12:57:19.319-0400 I  -        [conn1] ~~~waiting for lock&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;19.820-0400 d43061| 2019-04-25T12:57:19.820-0400 I  -        [conn1] ~~~waiting for lock&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;20.321-0400 d43061| 2019-04-25T12:57:20.321-0400 I  -        [conn1] ~~~waiting for lock&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;20.822-0400 d43061| 2019-04-25T12:57:20.821-0400 I  -        [conn1] ~~~waiting for lock&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;21.323-0400 d43061| 2019-04-25T12:57:21.322-0400 I  -        [conn1] ~~~waiting for lock&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;21.681-0400 d43061| 2019-04-25T12:57:21.681-0400 I  STORAGE  [conn2] done sleeping again&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;21.682-0400 d43061| 2019-04-25T12:57:21.681-0400 I  -        [conn1] ~~~lock acquisition threw: InterruptedAtShutdown: interrupted at shutdown&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;21.682-0400 d43061| 2019-04-25T12:57:21.682-0400 I  STORAGE  [conn2] Hanging server in shutdown after clearing transactions due to failpoint&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;21.683-0400 d43061| 2019-04-25T12:57:21.683-0400 I  COMMAND  [conn1] done with createCollection, res: InterruptedAtShutdown: interrupted at shutdown&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;21.684-0400 d43061| 2019-04-25T12:57:21.683-0400 I  COMMAND  [conn1] Timed out obtaining lock while trying to gather storage statistics for a slow operation&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;21.684-0400 d43061| 2019-04-25T12:57:21.684-0400 I  COMMAND  [conn1] command admin.$cmd appName: &quot;MongoDB Shell&quot; command: create { create: &quot;baz&quot;, lsid: { id: UUID(&quot;67bf8e5e-3616-4fa5-8ede-166ea3e1813c&quot;) }, $db: &quot;admin&quot; } numYields:0 ok:0 errMsg:&quot;interrupted at shutdown&quot; errName:InterruptedAtShutdown errCode:11600 reslen:120 locks:{ Global: { acquireCount: { r: 1, w: 1 }, acquireWaitCount: { w: 1 }, timeAcquiringMicros: { w: 3505005 } } } flowControl:{ acquireCount: 1 } protocol:op_msg 7866ms&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;However, I did so with a combination of fail points and server code sleepmillis calls, which does not have sufficient reliability to be committed. The problem is that we close the transportation layer during shutdown before we do anything with locks or interrupting operations. Also, we do not have the infrastructure to handle server shutdown in a parallel shell: my test did not exit gracefully.&lt;/p&gt;</comment>
                            <comment id="2223819" author="dianna.hohensee" created="Wed, 24 Apr 2019 19:12:18 +0000"  >&lt;p&gt;Yes, seems reasonable, I&apos;ll create such a test.&lt;/p&gt;</comment>
                            <comment id="2223611" author="judah.schvimer" created="Wed, 24 Apr 2019 17:15:52 +0000"  >&lt;p&gt;I&apos;d like to at the very least add a test that the above reasoning holds for some DDL operation. Does that seem reasonable?&lt;/p&gt;</comment>
                            <comment id="2223542" author="dianna.hohensee" created="Wed, 24 Apr 2019 16:38:14 +0000"  >&lt;p&gt;From what I can see in our code, I think I&apos;m concluding that no work needs to be done for this ticket.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/18181d9825ddc62351a6ba94325a38353086248c/src/mongo/db/db.cpp#L932-L945&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;This is the shutdown code of interest to us&lt;/a&gt;&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;        ....&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;&amp;nbsp;&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;        // Acquire the RSTL in mode X. First we enqueue the lock request, then kill all operations,&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;        // destroy all stashed transaction resources in order to release locks, and finally wait&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;        // until the lock request is granted.&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;        repl::ReplicationStateTransitionLockGuard rstl(&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;            opCtx, MODE_X, repl::ReplicationStateTransitionLockGuard::EnqueueOnly());&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;&amp;nbsp;&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;        // Kill all operations. After this point, the opCtx will have been marked as killed and will&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;        // not be usable other than to kill all transactions directly below.&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;        serviceContext-&amp;gt;setKillAllOperations();&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;&amp;nbsp;&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;        // Destroy all stashed transaction resources, in order to release locks.&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;        killSessionsLocalShutdownAllTransactions(opCtx);&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;&amp;nbsp;&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;        rstl.waitForLockUntil(Date_t::max());&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;Once the RSTL lock is enqueued, further CRUD/DDL ops may queue up behind it. We then mark all ongoing ops as killed by calling &lt;tt&gt;setKillAllOperations()&lt;/tt&gt;, and any future new ops will also immediately be marked as killed. Then we wait to acquire the RSTL lock, ensuring that any ops with locks have finished. Now we only have to worry about lock requests enqueued behind/after the RSTL lock. It is not guaranteed that operations themselves will check for interrupt frequently enough to notice that they have been killed. However, the locking system does guarantee this, for &lt;a href=&quot;https://github.com/mongodb/mongo/blob/18181d9825ddc62351a6ba94325a38353086248c/src/mongo/db/concurrency/lock_state.cpp#L882-L886&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;lock requests that are not under UninterruptibleLockGuards&lt;/a&gt;.&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;LockerImpl::lockComplete&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;        ....&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;        if (opCtx &amp;amp;&amp;amp; _uninterruptibleLocksRequested == 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;            result = _notify.wait(opCtx, waitTime);                                 &amp;lt;-- what runs for interruptible lock acquisitions&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;        } else {&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;            result = _notify.wait(waitTime);                                             &amp;lt;-- what runs for UninterruptibleLockGuards&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;        ....&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;&lt;tt&gt;_notify&lt;/tt&gt; is a &lt;tt&gt;CondVarLockGrantNotification&lt;/tt&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/18181d9825ddc62351a6ba94325a38353086248c/src/mongo/db/concurrency/lock_state.cpp#L219-L232&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;CondVarLockGrantNotification::wait&lt;/tt&gt; will check for interrupt before returning a successful &lt;tt&gt;LockResult&lt;/tt&gt;&lt;/a&gt;&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;LockResult CondVarLockGrantNotification::wait(OperationContext* opCtx, Milliseconds timeout) {&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;    invariant(opCtx);&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;    stdx::unique_lock&amp;lt;stdx::mutex&amp;gt; lock(_mutex);&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;    if (opCtx-&amp;gt;waitForConditionOrInterruptFor(&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;            _cond, lock, timeout, [this] { return _result != LOCK_INVALID; })) {&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;        // Because waitForConditionOrInterruptFor evaluates the predicate before checking for&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;        // interrupt, it is possible that a killed operation can acquire a lock if the request is&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;        // granted quickly. For that reason, it is necessary to check if the operation has been&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;        // killed at least once before accepting the lock grant.&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;        opCtx-&amp;gt;checkForInterrupt();&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;        return _result;&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;    return LOCK_TIMEOUT;&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;So any ops with lock requests enqueued after the RSTL will not successfully acquire locks for CRUD/DDL ops.&lt;/p&gt;

&lt;p&gt;I do not think ReplicationCoordinator::canAcceptWritesFor* is an appropriate invariant to make during shutdown to ensure no further writes occur because 1) that check is only intended to stop external clients 2) it is in a high level replication concept and should not be used to control lower level activity 3) ReplicationCoordinator::stepDown called during shutdown seems too racy to depend upon forcing (waiting forever might actually be forever, though I have not looked in depth).&lt;/p&gt;

&lt;p&gt;CC: &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2223324" author="judah.schvimer" created="Wed, 24 Apr 2019 14:59:44 +0000"  >&lt;p&gt;It seems that it can only throw if it times out waiting for the lock or if another stepdown is in progress. Can we wait indefinitely for the lock (since we&apos;ll need it eventually to shutdown anyways) and continuously try to step down until it either succeeds or gets a &lt;tt&gt;NotMaster&lt;/tt&gt; error?&lt;/p&gt;

&lt;p&gt;Alternatively, we could &quot;do something to prevent writes from succeeding&quot; after we release prepared locks. sSepdown was that thing, but if that doesn&apos;t work we could try setting &lt;tt&gt;canAcceptWritesFor&lt;/tt&gt; directly, or add a shutdown check where we check &lt;tt&gt;canAcceptWritesFor&lt;/tt&gt; in the shutdown path.&lt;/p&gt;</comment>
                            <comment id="2223276" author="dianna.hohensee" created="Wed, 24 Apr 2019 14:34:35 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;, it appears that the ReplicationCoordinator::stepDown function can still throw errors if force=true is passed into it, so it can still fail. I don&apos;t see how we could safely invariant afterwards that canAcceptWritesFor is false, unless ReplicationCoordinator::stepDown can be changed, which is outside of my current expertise &amp;#8211; it would take me a long while to figure out the replication code.&lt;/p&gt;</comment>
                            <comment id="2222481" author="judah.schvimer" created="Tue, 23 Apr 2019 20:39:36 +0000"  >&lt;p&gt;Yes, the above comment as you described is what we discussed with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt; would be the work on this ticket. It&apos;s not directly testing it, but it gives us confidence with the invariant and the existing test coverage around shutting down secondaries.&lt;/p&gt;</comment>
                            <comment id="2222459" author="dianna.hohensee" created="Tue, 23 Apr 2019 20:25:06 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;, is what you delineate in the last comment the work you want done for this ticket? If I understand correctly, you&apos;d like&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;a forced stepdown call following a failed unforced stepdown call&lt;/li&gt;
	&lt;li&gt;an invariant that writes are no longer accepted after stepdown&lt;/li&gt;
	&lt;li&gt;and &quot;something&quot; to prevent reads on prepared documents during shutdown &amp;#8211; I&apos;m guessing that means that after the locks are dropped from interrupting/aborting prepared transactions we need to block regular readers across the board (not just on docs that were/are part of transactions).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This ticket is no longer about testing that DDL ops fail after prepared transactions are interrupted/aborted during shutdown?&lt;/p&gt;</comment>
                            <comment id="2203679" author="judah.schvimer" created="Fri, 5 Apr 2019 17:30:36 +0000"  >&lt;p&gt;Now that we step down before shutdown, this is now identical to stepdown. The work on this ticket should make the stepdown in &lt;tt&gt;shutdownTask&lt;/tt&gt; call force stepdown on failure &lt;a href=&quot;https://github.com/mongodb/mongo/blob/488e81877725f742b097a5342488542028a53ba2/src/mongo/db/db.cpp#L886&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We will then add an invariant that &lt;tt&gt;canAcceptWritesFor&lt;/tt&gt; is set to false &lt;a href=&quot;https://github.com/mongodb/mongo/blob/488e81877725f742b097a5342488542028a53ba2/src/mongo/db/db.cpp#L889&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; after the stepdown completes.&lt;/p&gt;

&lt;p&gt;We will also do something to prevent reads on prepared documents from succeeding after the prepared transactions are aborted in shutdown.&lt;/p&gt;</comment>
                            <comment id="2186257" author="judah.schvimer" created="Wed, 20 Mar 2019 15:51:33 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=siyuan.zhou&quot; class=&quot;user-hover&quot; rel=&quot;siyuan.zhou&quot;&gt;siyuan.zhou&lt;/a&gt;, good point. Using the stepdown procedure wouldn&apos;t completely protect us from improper uses of UninterruptibleLockGuards. If a DDL op with an UninterruptibleLockGuard queued behind the RSTL, then the RSTL could still be acquired by the shutdown. We would then yield prepared locks and after the shutdown released the RSTL, the DDL op could acquire a lock that should have conflicted with the prepared transaction and finish its operation erroneously. &lt;/p&gt;

&lt;p&gt;By this logic, improper UninterruptibleLockGuards would also be a problem during stepdown when we yield locks from prepared transactions after acquiring the RSTL. In that case though, we do change &quot;canAcceptWritesFor&quot; to false, so that will likely protect the DDL op from succeeding. &lt;/p&gt;</comment>
                            <comment id="2185404" author="siyuan.zhou@10gen.com" created="Tue, 19 Mar 2019 21:28:50 +0000"  >&lt;blockquote&gt;&lt;p&gt;If the DDL were not interruptible, then we would not be able to acquire the RSTL at all.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Do you mean the uninterruptible DDL are waiting for RSTL while the shutdown is running? We don&apos;t hold RSTL for the whole shutdown process though. After shutdown releases the RSTL, can these uninterruptible DDL ops continue?&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Are you saying that if they were uninterruptible then &quot;mark any new operations interrupted on their creation&quot; would not suffice for preventing new operations?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Speaking of new operations, according to &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=mira.carey%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;mira.carey@mongodb.com&quot;&gt;mira.carey@mongodb.com&lt;/a&gt;, ops that come in after setKillAllOperations are after we&apos;ve shutdown the transport layer, so there won&apos;t be any new user ops. Internal processes after setKillAllOperations are possible though.&lt;/p&gt;
</comment>
                            <comment id="2185322" author="judah.schvimer" created="Tue, 19 Mar 2019 20:32:54 +0000"  >&lt;p&gt;If the DDL were not interruptible, then we would not be able to acquire the RSTL at all. Are you saying that if they were uninterruptible then &quot;mark any new operations interrupted on their creation&quot; would not suffice for preventing new operations?&lt;/p&gt;</comment>
                            <comment id="2185300" author="siyuan.zhou@10gen.com" created="Tue, 19 Mar 2019 20:15:24 +0000"  >&lt;p&gt;I feel I&apos;m missing why RSTL is a barrier. If the DDL is not interruptible, can they continue after RSTL is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/65b8d0a273fd1f03567b297743e22650b2035dd2/src/mongo/db/db.cpp#L903-L932&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;released by shutdown&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="2184758" author="judah.schvimer" created="Tue, 19 Mar 2019 14:06:12 +0000"  >&lt;p&gt;I agree we don&apos;t need the loop or the reader/writer differentiation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt; If we want to separate the killing of unprepared and the yielding of prepared transactions and move the latter to under RSTL, we also need to extend the scope of RSTL on shutdown, but up to where is still a question. Up to where we acquire the global lock?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This is the main change I&apos;m proposing. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=siyuan.zhou&quot; class=&quot;user-hover&quot; rel=&quot;siyuan.zhou&quot;&gt;siyuan.zhou&lt;/a&gt;, why would we need to extend the scope of the RSTL? This would be using the RSTL as a barrier since we cannot acquire it while operations hold locks and new operations cannot acquire locks as you pointed out.&lt;/p&gt;</comment>
                            <comment id="2184428" author="siyuan.zhou@10gen.com" created="Mon, 18 Mar 2019 21:59:04 +0000"  >&lt;p&gt;I don&apos;t see why we need to kill ops in a loop or treat readers and writers differently. Killing operations on shutdown will also &lt;a href=&quot;https://github.com/mongodb/mongo/blob/3b699913831031091fbba8a2a91178ef7826cf8b/src/mongo/db/service_context.cpp#L295-L296&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mark any new operations interrupted on their creation&lt;/a&gt;. If we want to separate the killing of unprepared and the yielding of prepared transactions and move the latter to under RSTL, we also need to extend the scope of RSTL on shutdown, but up to where is still a question. Up to where we acquire the global lock?&lt;/p&gt;

&lt;p&gt;For testing, I think adding one test case for the above scenario is a good idea to verify the mechanism is right. Then the concurrency tests sound a good solution to cover this kind of bugs, given their past coverage on subtle concurrency bugs.&lt;/p&gt;</comment>
                            <comment id="2182171" author="judah.schvimer" created="Fri, 15 Mar 2019 20:07:15 +0000"  >&lt;p&gt;This may get done anyways by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38994&quot; title=&quot;Step down on SIGTERM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38994&quot;&gt;&lt;del&gt;SERVER-38994&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2182015" author="judah.schvimer" created="Fri, 15 Mar 2019 18:08:45 +0000"  >&lt;p&gt;Per conversation with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;, the race seems to come from the fact that we yield prepared transaction locks &lt;em&gt;before&lt;/em&gt; acquiring the RSTL. Stepdown, in contrast, aborts unprepared transactions and then acquires the RSTL, and then yields prepared transaction locks. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=suganthi.mani&quot; class=&quot;user-hover&quot; rel=&quot;suganthi.mani&quot;&gt;suganthi.mani&lt;/a&gt; points out that stepdown is a bit overly-complex for shutdown. It loops killing operations to avoid killing readers, but shutdown wants to kill readers and writers. If we kill &lt;em&gt;all&lt;/em&gt; operations on shutdown, then we don&apos;t need this looping behavior. I think we can do two things on this ticket.&lt;br/&gt;
1) We can create the test above. (Required)&lt;br/&gt;
2) We can change the shutdown code to use the same (or similar but simpler) mechanism as stepdown. (Optional, and we can split this out once we reach agreement)&lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=siyuan.zhou&quot; class=&quot;user-hover&quot; rel=&quot;siyuan.zhou&quot;&gt;siyuan.zhou&lt;/a&gt; for any other thoughts.&lt;/p&gt;</comment>
                            <comment id="2181960" author="milkie" created="Fri, 15 Mar 2019 17:20:45 +0000"  >&lt;p&gt;I&apos;m not sure the test would have value unless we included all possible operations that could be blocked by the prepare, to detect when a programmer might change any of their lock acquisitions to Uninterruptible.  Even if we could, the test would not age gracefully, as we could always add new operations in the future and forget to add them to the test.&lt;/p&gt;

&lt;p&gt;How about this:  Instead of trying to test for a situation that we hope never happens in the future, we could set the lock manager into a mode that would not allow any further lock requests to be granted after prepared transactions are aborted.  That is the specific situation that we are trying to avoid here.&lt;/p&gt;</comment>
                            <comment id="2181770" author="judah.schvimer" created="Fri, 15 Mar 2019 15:08:35 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;, do you think the following test adds value?&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Start a transaction that inserts a document in collection &lt;tt&gt;foo&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;Attempt to create an index on collection &lt;tt&gt;foo&lt;/tt&gt; that should block on the transaction&lt;/li&gt;
	&lt;li&gt;Prepare the transaction&lt;/li&gt;
	&lt;li&gt;Shut down the node&lt;/li&gt;
	&lt;li&gt;Restart the node and see if the index was created successfully&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;If index creation were uninterruptible, then it would succeed &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0a856820ba29e19dcba0979f71b11ae01f4be0f1/src/mongo/db/db.cpp#L915&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; after shutdown aborts prepared transactions. The index build would acquire the RSTL before shutdown and shutdown would be blocked on the index build to complete successfully.&lt;/p&gt;

&lt;p&gt;Any DDL op would work for this test. One problem is that this somewhat only tests that we kill all operations and the interruptibility of the specific DDL op we choose for the test. All of this will also be tested in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39994&quot; title=&quot;Add concurrency_simultaneous_sharding_with_stepdowns|terminates|kills.yml&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39994&quot;&gt;SERVER-39994&lt;/a&gt; for all DDL ops, but in a less targeted way.&lt;/p&gt;</comment>
                            <comment id="2181016" author="milkie" created="Thu, 14 Mar 2019 17:57:16 +0000"  >&lt;p&gt;I am having trouble imagining a test that would pass with today&apos;s code but fail if a DDL operation in the future hits an uninterruptible lock and would subsequently succeed at shutdown time, as per the ticket title.  In particular, writing a test for detecting that some situation &lt;b&gt;doesn&apos;t&lt;/b&gt; happen is tricky unless we have good traction on what the code logic would be when it does happen.  I don&apos;t think we can proceed with this ticket until more details are added to the description.&lt;/p&gt;</comment>
                            <comment id="2177059" author="samy.lanka" created="Mon, 11 Mar 2019 15:05:03 +0000"  >&lt;p&gt;I think tests like this might be useful to make sure that someone doesn&apos;t make one of these operations uninterruptible in the future without realizing they could conflict with prepared transactions. &lt;/p&gt;</comment>
                            <comment id="2177041" author="judah.schvimer" created="Mon, 11 Mar 2019 14:53:46 +0000"  >&lt;p&gt;If they are interruptible and we interrupt them, how would they sneak in? Like what are we looking for?&lt;/p&gt;</comment>
                            <comment id="2177036" author="samy.lanka" created="Mon, 11 Mar 2019 14:51:38 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt; we might want to go through all the places that had a conflicting &lt;tt&gt;UninterruptibleLockGuard&lt;/tt&gt; and make sure those cannot sneak in during shutdown, but I&apos;m not sure if you find that necessary.&lt;/p&gt;</comment>
                            <comment id="2177030" author="milkie" created="Mon, 11 Mar 2019 14:49:42 +0000"  >&lt;p&gt;The first thing shutdown does is go through the stepdown command codepath; therefore, your test proposal could be simplified as &quot;step down the node&quot; instead of &quot;shut down the node&quot;.  I&apos;m unconvinced that we need to write separate shutdown tests, but if we do, we should write the stepdown test first, and then simply substitute &quot;shutdown&quot; for &quot;stepdown&quot; at the appropriate point in the test.&lt;/p&gt;</comment>
                            <comment id="2177013" author="samy.lanka" created="Mon, 11 Mar 2019 14:44:19 +0000"  >&lt;p&gt;This came out of&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38162&quot; title=&quot;Acquire ReplicationStateTransitionLock on shutdown in mode X&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38162&quot;&gt;&lt;del&gt;SERVER-38162&lt;/del&gt;&lt;/a&gt;. What I had in mind was making sure something like a &lt;tt&gt;dropCollection&lt;/tt&gt; cannot succeed after a prepared transaction has been aborted during shutdown. For the test I imagined we could do something like the following: prepare a transaction, run a DDL operation like &lt;tt&gt;dropCollection&lt;/tt&gt; and make sure that it is waiting for a lock held by the prepared transaction, shutdown the node, hang shutdown right after the transaction has been aborted, and make sure that the DDL operation has been killed.&lt;/p&gt;</comment>
                            <comment id="2175851" author="judah.schvimer" created="Fri, 8 Mar 2019 16:13:38 +0000"  >&lt;p&gt;I think this came out of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35817&quot; title=&quot;Allow shutdowns while prepared transactions are in-flight&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35817&quot;&gt;&lt;del&gt;SERVER-35817&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="2175846" author="judah.schvimer" created="Fri, 8 Mar 2019 16:11:40 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=samy.lanka&quot; class=&quot;user-hover&quot; rel=&quot;samy.lanka&quot;&gt;samy.lanka&lt;/a&gt;, can you please clarify what prepare work this is intended to test since there is no shutdown related linked ticket and how you expect the test to be structured?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="672196">SERVER-38994</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="564367">SERVER-35817</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="606934">SERVER-37199</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="634734">SERVER-38162</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>29.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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, 8 Mar 2019 16:11:40 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 41 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/PM-1317'>PM-1317</a></s>]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1032</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>
                            4 years, 41 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>samy.lanka@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hulj53:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr7hgn:</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="2823">Repl 2019-03-25</customfieldvalue>
    <customfieldvalue id="2896">Repl 2019-04-08</customfieldvalue>
    <customfieldvalue id="2908">Storage NYC 2019-05-06</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|hul5ef:</customfieldvalue>

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