<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:51: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-39323] Don&apos;t consider in-progress indexes when deciding whether or not to build an index under an intent lock</title>
                <link>https://jira.mongodb.org/browse/SERVER-39323</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I started seeing two Pymongo test failures on 4.2-latest that I think are related to the hybrid index build project. Both tests pass on 4.1.7 but fail on v4.1.7-176-gd807556. They are listed in &lt;a href=&quot;https://jira.mongodb.org/browse/PYTHON-1734&quot; title=&quot;Test failure - test_legacy_api.TestLegacy.test_ensure_index_threaded/test_ensure_unique_index_threaded&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PYTHON-1734&quot;&gt;PYTHON-1734&lt;/a&gt; but I will put them here too along with how to run each case individually:&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;$ python3.7 setup.py test -s test.test_legacy_api.TestLegacy.test_ensure_index_threaded&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;running test&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;test_ensure_index_threaded (test.test_legacy_api.TestLegacy) ... FAIL&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;======================================================================&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;FAIL: test_ensure_index_threaded (test.test_legacy_api.TestLegacy)&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;Traceback (most recent call last):&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;  File &quot;/Users/shane/git/mongo-python-driver/test/test_legacy_api.py&quot;, line 1296, in test_ensure_index_threaded&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;    self.assertEqual(index_doc, first)&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;AssertionError: {&apos;_id[250 chars]ion&apos;}, &apos;foo2_1&apos;: {&apos;v&apos;: 2, &apos;key&apos;: [(&apos;foo2&apos;, 1)][43 chars]on&apos;}} != {&apos;_id[250 chars]ion&apos;}}&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;  {&apos;_id_&apos;: {&apos;key&apos;: [(&apos;_id&apos;, 1)],&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;            &apos;ns&apos;: &apos;pymongo_test.threaded_index_creation&apos;,&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;            &apos;v&apos;: 2},&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;   &apos;foo0_1&apos;: {&apos;key&apos;: [(&apos;foo0&apos;, 1)],&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;              &apos;ns&apos;: &apos;pymongo_test.threaded_index_creation&apos;,&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;              &apos;v&apos;: 2},&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;   &apos;foo1_1&apos;: {&apos;key&apos;: [(&apos;foo1&apos;, 1)],&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;              &apos;ns&apos;: &apos;pymongo_test.threaded_index_creation&apos;,&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;-             &apos;v&apos;: 2},&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;-  &apos;foo2_1&apos;: {&apos;key&apos;: [(&apos;foo2&apos;, 1)],&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;-             &apos;ns&apos;: &apos;pymongo_test.threaded_index_creation&apos;,&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;              &apos;v&apos;: 2}}&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;----------------------------------------------------------------------&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;Ran 1 test in 0.334s&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;   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;FAILED (failures=1)&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 source for this test is here: &lt;a href=&quot;https://github.com/mongodb/mongo-python-driver/blob/3.7.2/test/test_legacy_api.py#L1266-L1293&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-python-driver/blob/3.7.2/test/test_legacy_api.py#L1266-L1293&lt;/a&gt;&lt;br/&gt;
From the output, it looks like the test expects that an index created with createIndex should show up immediately in the listIndexes output.&lt;/p&gt;

&lt;p&gt;And the second failing test:&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;python3.7 setup.py test -s test.test_legacy_api.TestLegacy.test_ensure_unique_index_threaded&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;running test&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;test_ensure_unique_index_threaded (test.test_legacy_api.TestLegacy) ... FAIL&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;======================================================================&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;FAIL: test_ensure_unique_index_threaded (test.test_legacy_api.TestLegacy)&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;Traceback (most recent call last):&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;  File &quot;/Users/shane/git/mongo-python-driver/test/test_legacy_api.py&quot;, line 1355, in test_ensure_unique_index_threaded&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;    self.assertEqual(10001, coll.count())&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;AssertionError: 10001 != 10018&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;----------------------------------------------------------------------&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;Ran 1 test in 0.493s&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;   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;FAILED (failures=1)&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 source for this test is here: &lt;a href=&quot;https://github.com/mongodb/mongo-python-driver/blob/3.7.2/test/test_legacy_api.py#L1328-L1354&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-python-driver/blob/3.7.2/test/test_legacy_api.py#L1328-L1354&lt;/a&gt;&lt;br/&gt;
This test creates the same unique index in multiple threads and then every thread attempts to insert a document with the same value for the unique field (and only one insert should succeed). It looks even though the createIndex succeeds (in some threads) the index is never actually created.&lt;/p&gt;

&lt;p&gt;These failures are reproducible on standalones, replica sets, and sharded clusters. &lt;/p&gt;</description>
                <environment></environment>
        <key id="681369">SERVER-39323</key>
            <summary>Don&apos;t consider in-progress indexes when deciding whether or not to build an index under an intent lock</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="dianna.hohensee@mongodb.com">Dianna Hohensee</assignee>
                                    <reporter username="shane.harvey@mongodb.com">Shane Harvey</reporter>
                        <labels>
                    </labels>
                <created>Thu, 31 Jan 2019 23:16:50 +0000</created>
                <updated>Sun, 29 Oct 2023 22:24:31 +0000</updated>
                            <resolved>Mon, 13 May 2019 21:19:22 +0000</resolved>
                                    <version>4.1.8</version>
                                    <fixVersion>4.1.12</fixVersion>
                                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="2245168" author="dianna.hohensee" created="Mon, 13 May 2019 21:19:23 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40926&quot; title=&quot;createIndexes should return IndexBuildAlreadyInProgress errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40926&quot;&gt;&lt;del&gt;SERVER-40926&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40927&quot; title=&quot;createIndexes should wait for indexes found to already be being built to finish&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40927&quot;&gt;&lt;del&gt;SERVER-40927&lt;/del&gt;&lt;/a&gt; have been completed. A createIndexes request for an index that is already in the process of being built will now wait for that index build to finish.&lt;/p&gt;</comment>
                            <comment id="2230437" author="dianna.hohensee" created="Wed, 1 May 2019 13:45:33 +0000"  >&lt;p&gt;I&apos;ve created &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40926&quot; title=&quot;createIndexes should return IndexBuildAlreadyInProgress errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40926&quot;&gt;&lt;del&gt;SERVER-40926&lt;/del&gt;&lt;/a&gt; to return the error, which I think is v4.2 required; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40927&quot; title=&quot;createIndexes should wait for indexes found to already be being built to finish&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40927&quot;&gt;&lt;del&gt;SERVER-40927&lt;/del&gt;&lt;/a&gt; to add the waiting functionality as v4.2 desired. We&apos;ll try to get the latter in, but it might be after our code complete date and then squeaked in as a bug fix &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="2230033" author="shane.harvey" created="Tue, 30 Apr 2019 23:07:45 +0000"  >&lt;p&gt;Mongomirror would need to write a retry loop as you say. If we decided to do the same in gridfs (to maintain backward compatibility) all drivers would need to implement the retry loop too. I still think returning IndexBuildAlreadyInProgress would be better than returning OK because at least the error is explicit. Even better would be to implement this retry/join/wait logic in the server and have no downstream changes at all.&lt;/p&gt;</comment>
                            <comment id="2229878" author="dianna.hohensee" created="Tue, 30 Apr 2019 20:28:46 +0000"  >&lt;p&gt;Thanks for the additional info. It does sound like we&apos;ll need to do something about it.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt;, if we were to return an error IndexBuildAlreadyInProgress instead of OK, would that require a lot of downstream work to handle the error correctly? I&apos;d be concerned about callers hammering the server retrying the createIndexes cmd in a simple loop. Callers would have to periodically re-run the cmd if the index build takes a significant amount of time. Index builds say on empty collections should be really quick and retrying the cmd in such a small window should be okay.&lt;/p&gt;</comment>
                            <comment id="2221076" author="dianna.hohensee" created="Mon, 22 Apr 2019 20:19:32 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt;, what does MongoMirror use the createIndexes cmd for? I thought MongoMirror used applyOps to apply createIndexes oplog entries from one replica set to a new one: I believe that path still uses foreground index builds.&lt;/p&gt;</comment>
                            <comment id="2220986" author="shane.harvey" created="Mon, 22 Apr 2019 19:25:11 +0000"  >&lt;p&gt;I still think it is a bug to reply with ok:1 before the index is actually built, should I file a new ticket?&lt;/p&gt;

&lt;p&gt;Ideally, the server would join the second createIndexes thread with the in progress build. There are real world scenario where the same index may be created by multiple threads.&lt;/p&gt;

&lt;p&gt;For example, I believe mongomirror could be impacted by this bug. Currently it retries createIndexes commands when they fail with network (or other transient) errors. With the buggy behavior in 4.1, a retried createIndexes may &quot;succeed&quot; immediately even though the indexes are not built. This is a problem for two reasons:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;the indexes may eventually fail and thus will never be created.&lt;/li&gt;
	&lt;li&gt;the index builds could still be running when the application cuts over to Atlas which will have adverse performance impacts.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Another practical situation where multiple threads may attempt to build the same index is in GridFS. &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst#before-write-operations&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Before the first write operation&lt;/a&gt; gridfs will attempt to build two indexes if they do not already exist. GridFS depends on a unique index on &lt;tt&gt;files_id&lt;/tt&gt; to enforce uniqueness.  The buggy behavior in 4.1 can cause some threads to violate the unique index on chunks and cause the actual index build to fail with a DuplicateKey error.&lt;/p&gt;</comment>
                            <comment id="2220940" author="dianna.hohensee" created="Mon, 22 Apr 2019 18:54:11 +0000"  >&lt;p&gt;I&apos;m closing this without changing behavior &amp;#8211; I should have filed a separate ticket for the refactor, on reflection, sorry about that. &lt;/p&gt;

&lt;p&gt;We concluded that there was no good story for what the user would do with an IndexBuildAlreadyInProgress error instead of an OK response. They would not be able to retry the command until successful because that would simply overload the server with requests. Also, we did not think it was a reasonable scenario for a user to be running an index build on one thread, then start up another thread to run the same index build in parallel.&lt;/p&gt;</comment>
                            <comment id="2220930" author="xgen-internal-githook" created="Mon, 22 Apr 2019 18:46:50 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Dianna&apos;, &apos;username&apos;: &apos;DiannaHohensee&apos;, &apos;email&apos;: &apos;dianna.hohensee@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39323&quot; title=&quot;Don&amp;#39;t consider in-progress indexes when deciding whether or not to build an index under an intent lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39323&quot;&gt;&lt;del&gt;SERVER-39323&lt;/del&gt;&lt;/a&gt; refactor index spec validation code to make it more modularized and flexible.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Remove a &quot;$freelist&quot; collection reference, which was removed with MMAPv1&lt;/li&gt;
	&lt;li&gt;Modularize a 
{buildIndexes:false}
&lt;p&gt; check that causes a IndexAlreadyExists error to be returned&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;Split IndexCatalog::removeExistingIndexes into removeExistingIndexes and removeExistingIndexesNoChecks,&lt;br/&gt;
  to be more explicit about the internal behavior.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/75f5f054406ae2a9805960872d5bae49561d4d82&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/75f5f054406ae2a9805960872d5bae49561d4d82&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="2203343" author="dianna.hohensee" created="Fri, 5 Apr 2019 14:40:55 +0000"  >&lt;p&gt;Eventually for the simul project&apos;s join functionality in v4.4:&lt;br/&gt;
1) need a way to only filter out ready indexes &amp;#8211; so having a check to only filter the ready indexes will be needed anyway&lt;br/&gt;
2) then we would need checks to find out whether the remaining indexes match any existing builds or conflict with any existing builds. The IndexBuildsCoordinator will have a registry of in-progress builds. I think it would still be easiest to use the IndexCatalog to check whether the remaining indexes conflict or are already being built, then go to the IndexBuildsCoordinator&apos;s registry to join any in-progress builds if the requirements are met &amp;#8211; like a request can only match to a single in-progress build, not multiple. So I think the simul project would also benefit from code we write for v4.2, but we should definitely keep the IndexBuildsCoordinator in mind when writing the v4.2 code, so it&apos;s easy later: for example, making it easy to distinguish indexes that conflict with existing/being built indexes and indexes that match and are already being built.&lt;/p&gt;</comment>
                            <comment id="2203236" author="dianna.hohensee" created="Fri, 5 Apr 2019 13:55:43 +0000"  >&lt;p&gt;The proposal for v4.2:&lt;br/&gt;
1) The createIndexes cmd will only silently remove already existing (ready) indexes from user requests. If none remain to be built, then the cmd returns OK &lt;br/&gt;
2) We will add a second check for remaining indexes after step 1) to discover whether any are already being built. If any are being built already, we will return a IndexBuildAlreadyInProgress error with a msg about which indexes are already being built.&lt;br/&gt;
3) The MultiIndexBlock::init code will also have to differentiate between already built and being built indexes in order to return IndexAlreadyExists and IndexBuildAlreadyInProgress, respectively and appropriately.&lt;/p&gt;</comment>
                            <comment id="2203195" author="dianna.hohensee" created="Fri, 5 Apr 2019 13:34:46 +0000"  >&lt;p&gt;v4.0 behavior:&lt;br/&gt;
1) we still have foreground index builds&lt;br/&gt;
2) the createIndexes cmd will check for index already existing/being built under an intent lock &amp;#8211; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fc525e2d9b0e4bceff5c2201457e564362909765/src/mongo/db/commands/create_indexes.cpp#L299-L311&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this was backported or we originally committed it in v4.0&lt;/a&gt;. We return OK if the request&apos;s indexes are found to already exist or are in the process of being built.&lt;br/&gt;
3) if there were a race between createIndexes cmd requests during relocking after the intent lock check mentioned in 2), then the code will reach the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fc525e2d9b0e4bceff5c2201457e564362909765/src/mongo/db/catalog/index_create_impl.cpp#L258-L262&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MultiIndexBlock::init code and return an IndexAlreadyExists error&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2202433" author="milkie" created="Thu, 4 Apr 2019 19:23:09 +0000"  >&lt;p&gt;Ah, I got it now. When the description says that createIndex succeeds, it is referring to the second invocation of createIndex for the same index.  Subsequent to that, the first invocation eventually fails, leaving the index unbuilt forever. &lt;/p&gt;</comment>
                            <comment id="2202294" author="shane.harvey" created="Thu, 4 Apr 2019 18:09:08 +0000"  >&lt;p&gt;For the first test (&lt;tt&gt;test_ensure_index_threaded&lt;/tt&gt;) the indexes are created eventually. For the second test (&lt;a href=&quot;https://github.com/mongodb/mongo-python-driver/blob/3.7.2/test/test_legacy_api.py#L1328-L1354&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test_ensure_unique_index_threaded&lt;/a&gt;) the index &lt;b&gt;is never created&lt;/b&gt; because the createIndex that&apos;s actually waiting for the index build fails with a DuplicateKeyError. &lt;/p&gt;</comment>
                            <comment id="2201711" author="milkie" created="Thu, 4 Apr 2019 12:32:54 +0000"  >&lt;p&gt;Just to be clear, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt; in your description you say that the index is &quot;never actually created&quot;, but we now believe it is simply still building and would actually be created eventually, correct?&lt;/p&gt;</comment>
                            <comment id="2156939" author="milkie" created="Wed, 20 Feb 2019 14:18:02 +0000"  >&lt;p&gt;Marking this as 4.1 Required and we&apos;ll reconsider next steps after the dependent ticket is closed.&lt;/p&gt;</comment>
                            <comment id="2148082" author="louis.williams" created="Wed, 13 Feb 2019 23:37:47 +0000"  >&lt;p&gt;On second through, I don&apos;t know if this is as simple as updating &lt;a href=&quot;https://github.com/mongodb/mongo/blame/970e0c02de8c5922efcab74cfee258f447f94741/src/mongo/db/catalog/index_catalog_impl.cpp#L632&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;IndexCatalogImpl::_doesSpecConflictWithExisting()&lt;/a&gt; to pass &quot;false&quot; for &quot;includeUnfinishedIndexes&quot;. Indexes are only ever created with an exclusive collection lock. With this change, when we first check with an IX lock and skip in-progress indexes, we will queue up an X exclusive lock and wait. If the in-progress index yields and the waiting thread gets an X lock, it needs to see that there is an index build in-progress, otherwise it will start building the same index. &lt;/p&gt;

&lt;p&gt;If this second check sees the in-progress index, it will return early because an identical index exists, in-progress. This would also not solve this problem. I think for now, we should wait to see the outcome of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37644&quot; title=&quot;Make the createIndexes command join already in-progress index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37644&quot;&gt;&lt;del&gt;SERVER-37644&lt;/del&gt;&lt;/a&gt;. Otherwise we may need to wait for all other background index builds to finish, which would mean you can&apos;t build multiple background indexes simultaneously. &lt;/p&gt;</comment>
                            <comment id="2148057" author="louis.williams" created="Wed, 13 Feb 2019 23:14:01 +0000"  >&lt;p&gt;That makes sense to me. Thanks for reporting this. I&apos;ll update the description to match the desired behavior: Don&apos;t consider in-progress indexes when deciding whether or not to build an index under an intent lock.&#160;&lt;/p&gt;</comment>
                            <comment id="2146546" author="shane.harvey" created="Tue, 12 Feb 2019 21:08:35 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36961&quot; title=&quot;createIndexes command should check if index already exists with weak lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36961&quot;&gt;&lt;del&gt;SERVER-36961&lt;/del&gt;&lt;/a&gt;&#160;was backported to 4.0.3 and 3.6.9 but these pymongo tests pass on those server versions with both background and foreground indexes.&lt;/p&gt;

&lt;p&gt;I think it&apos;s a bug for createIndexes to return ok:1 when the index it refers to is still in progress. So far I&apos;m only seeing this bug on 4.1.7-latest.&lt;/p&gt;</comment>
                            <comment id="2145349" author="louis.williams" created="Mon, 11 Feb 2019 23:56:39 +0000"  >&lt;p&gt;What you noticed is because of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36961&quot; title=&quot;createIndexes command should check if index already exists with weak lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36961&quot;&gt;&lt;del&gt;SERVER-36961&lt;/del&gt;&lt;/a&gt;: we take a weak lock and return successfully if an &lt;b&gt;identical&lt;/b&gt; index exists, even if it is in-progress. And, like you said, the &quot;createIndexes&quot; command will block until the index build completes. So while the test does wait for all threads to exit, the issue is that not all threads complete with the same &lt;tt&gt;index_information&lt;/tt&gt;. Some threads finish early while other threads are still building the indexes.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37644&quot; title=&quot;Make the createIndexes command join already in-progress index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37644&quot;&gt;&lt;del&gt;SERVER-37644&lt;/del&gt;&lt;/a&gt; will likely be completed at some point before the 4.2 release, but I&apos;m not sure what the timeline is.&lt;/p&gt;

&lt;p&gt;The change in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36961&quot; title=&quot;createIndexes command should check if index already exists with weak lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36961&quot;&gt;&lt;del&gt;SERVER-36961&lt;/del&gt;&lt;/a&gt; was backported to 4.0 and 3.6, so this same behavior exists, but only for background index builds. &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37644&quot; title=&quot;Make the createIndexes command join already in-progress index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37644&quot;&gt;&lt;del&gt;SERVER-37644&lt;/del&gt;&lt;/a&gt; will definitely never be backported. If the &quot;joinable&quot; behavior is important, it should be possible to just exclude in-progress index builds when first checking whether or not an index exists with an intent lock. I believe that will restore the behavior that this test relied on. Is &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37644&quot; title=&quot;Make the createIndexes command join already in-progress index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37644&quot;&gt;&lt;del&gt;SERVER-37644&lt;/del&gt;&lt;/a&gt; sufficient or should this be backported to 4.0 and 3.6?&lt;/p&gt;</comment>
                            <comment id="2145232" author="shane.harvey" created="Mon, 11 Feb 2019 22:08:31 +0000"  >&lt;p&gt;Even if the index is built in the background I expect that the createIndex command should block until the index is created, right? From these test failures it looks like a concurrent index build on the same index returns &lt;tt&gt;ok:1&lt;/tt&gt; immediately even though the index build is still in progress. Will this go away once &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37644&quot; title=&quot;Make the createIndexes command join already in-progress index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37644&quot;&gt;&lt;del&gt;SERVER-37644&lt;/del&gt;&lt;/a&gt; is implemented? &lt;/p&gt;</comment>
                            <comment id="2145215" author="louis.williams" created="Mon, 11 Feb 2019 22:01:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt; I just noticed that there is a &lt;tt&gt;joinall&lt;/tt&gt; used before checking the indexes, so I&apos;ll see what might be going on there. The index build threads shouldn&apos;t return until they are completed.&lt;/p&gt;</comment>
                            <comment id="2145207" author="louis.williams" created="Mon, 11 Feb 2019 21:55:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=shane.harvey&quot; class=&quot;user-hover&quot; rel=&quot;shane.harvey&quot;&gt;shane.harvey&lt;/a&gt; as of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37270&quot; title=&quot;Remove foreground index build functionality&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37270&quot;&gt;&lt;del&gt;SERVER-37270&lt;/del&gt;&lt;/a&gt;, all index builds run in the background by default. By creating a foreground index, this test depended on the exclusive locking nature of foreground indexes. The reader thread would block until the index builds finished. Background index builds yield locks so non-conflicting requests can still be processed. This test is failing because multiple index builds are started in background threads, and the reader sees a state where these indexes are not ready.&lt;/p&gt;

&lt;p&gt;My suggestions would be either:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Rewrite the test with retries to assert that the index builds &quot;eventually&quot; complete.&lt;/li&gt;
	&lt;li&gt;Use the &lt;tt&gt;enableHybridIndexBuilds=false&lt;/tt&gt; setParameter to disable this non-blocking behavior. I would advise against doing this because of the reduced test coverage.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If there is any work we can do on our side, let me know, otherwise I will close this ticket.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="751546">SERVER-40926</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="751548">SERVER-40927</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10020">
                    <name>Gantt Dependency</name>
                                                                <inwardlinks description="has to be done after">
                                        <issuelink>
            <issuekey id="619180">SERVER-37644</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                        <issuelink>
            <issuekey id="681204">PYTHON-1734</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="747071">DRIVERS-644</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>22.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>Mon, 11 Feb 2019 21:55:49 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 39 weeks, 2 days 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/SERVER-40926'>SERVER-40926</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-40927'>SERVER-40927</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_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, 39 weeks, 2 days ago
                        </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>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>shane.harvey@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|huktgv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr78bb:</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="2829">Storage NYC 2019-04-08</customfieldvalue>
    <customfieldvalue id="2830">Storage NYC 2019-04-22</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|hukfq7:</customfieldvalue>

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