<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:12:22 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-6671] oplog is not strictly idempotent when unique index is present</title>
                <link>https://jira.mongodb.org/browse/SERVER-6671</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Given a replica set which has collection &apos;c&apos; with a unique index on &apos;a&apos;, consider the following sequence of events:&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;    db.c.update({ _id:0 }, { $set:{ a: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;    db.c.update({ _id:0 }, { $set:{ a: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;   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;    db.c.update({ _id:1 }, { $set:{ a: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;If a secondary node encounters an error during replication (e.g. by killing the getMore op or network disconnect), it may try to reapply the same operations.  In the above case, attempting to reapply the operations will fail on the secondary nodes due to {_id:1} already having a unique index value on &lt;/p&gt;
{a:1}
&lt;p&gt;.  &lt;/p&gt;

&lt;p&gt;On version 2.0.2, the issue is manifested by secondarys halting replication due to syncTail encountering E11000 on the secondary node(s).  On version master (~2.2.0-rc0, git hash 73b97070259a0e30d5ed35880b11b32078620e42), the following fassert() is hit:&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;Tue Jul 31 14:18:05 [repl writer worker 1] build index test.testUniqueReplication { _id: 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;Tue Jul 31 14:18:05 [repl writer worker 1] build index done.  scanned 0 total records. 0 secs&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;Tue Jul 31 14:18:05 [repl writer worker 1] info: creating collection test.testUniqueReplication on add index&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;Tue Jul 31 14:18:05 [repl writer worker 1] build index test.testUniqueReplication { a: 1.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;Tue Jul 31 14:18:05 [repl writer worker 1] build index done.  scanned 0 total records. 0 secs&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;Tue Jul 31 14:18:23 [conn2292] end connection 127.0.0.1:56268 (11 connections now open)&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;Tue Jul 31 14:18:23 [initandlisten] connection accepted from 127.0.0.1:56281 #2294 (12 connections now open)&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;Tue Jul 31 14:18:27 [conn2293] end connection 127.0.0.1:56269 (11 connections now open)&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;Tue Jul 31 14:18:27 [initandlisten] connection accepted from 127.0.0.1:56282 #2295 (12 connections now open)&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;Tue Jul 31 14:18:53 [conn2294] end connection 127.0.0.1:56281 (11 connections now open)&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;Tue Jul 31 14:18:53 [initandlisten] connection accepted from 127.0.0.1:56293 #2296 (12 connections now open)&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;Tue Jul 31 14:18:57 [conn2295] end connection 127.0.0.1:56282 (11 connections now open)&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;Tue Jul 31 14:18:57 [initandlisten] connection accepted from 127.0.0.1:56294 #2297 (12 connections now open)&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;Tue Jul 31 14:18:58 [repl writer worker 1] CMD: drop test.testUniqueReplication&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;Tue Jul 31 14:18:58 [repl writer worker 1] build index test.testUniqueReplication { _id: 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;Tue Jul 31 14:18:58 [repl writer worker 1] build index done.  scanned 0 total records. 0 secs&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;Tue Jul 31 14:18:58 [repl writer worker 1] info: creating collection test.testUniqueReplication on add index&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;Tue Jul 31 14:18:58 [repl writer worker 1] build index test.testUniqueReplication { a: 1.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;Tue Jul 31 14:18:58 [repl writer worker 1] build index done.  scanned 0 total records. 0 secs&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;Tue Jul 31 14:19:12 [repl writer worker 1] ERROR: writer worker caught exception: E11000 duplicate key error index: test.testUniqueReplication.$a_1  dup key: { : 1.0 } on: { ts: Timestamp 1343769552000|191, h: 7269005229324720756, op: &quot;u&quot;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   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;, ns: &quot;test.testUniqueReplication&quot;, o2: { _id: 0.0 }, o: { $set: { a: 1.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;Tue Jul 31 14:19:12 [repl writer worker 1]   Fatal Assertion 16360&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;0x9ccdd3 0x98211d 0x83b398 0x71e326 0x5bda6b 0x7f8c40d60e9a 0x7f8c4027e4bd &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; ./mongod(_ZN5mongo15printStackTraceERSo+0x23) [0x9ccdd3]&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; ./mongod(_ZN5mongo13fassertFailedEi+0x4d) [0x98211d]&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; ./mongod(_ZN5mongo7replset14multiSyncApplyERKSt6vectorINS_7BSONObjESaIS2_EEPNS0_8SyncTailE+0xf8) [0x83b398]&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; ./mongod(_ZN5mongo10threadpool6Worker4loopEv+0x4d6) [0x71e326]&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; ./mongod() [0x5bda6b]&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; /lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a) [0x7f8c40d60e9a]&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; /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f8c4027e4bd]&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;Tue Jul 31 14:19:12 [repl writer worker 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;&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;***aborting after fassert() failure&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</description>
                <environment>Any replicated environment</environment>
        <key id="45896">SERVER-6671</key>
            <summary>oplog is not strictly idempotent when unique index is present</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="milkie@mongodb.com">Eric Milkie</assignee>
                                    <reporter username="benjamin.becker">Ben Becker</reporter>
                        <labels>
                            <label>index</label>
                            <label>oplog</label>
                            <label>replication</label>
                            <label>unique</label>
                    </labels>
                <created>Tue, 31 Jul 2012 21:43:01 +0000</created>
                <updated>Mon, 11 Jul 2016 17:58:49 +0000</updated>
                            <resolved>Tue, 9 Oct 2012 19:03:58 +0000</resolved>
                                    <version>2.0.6</version>
                    <version>2.2.0-rc0</version>
                                    <fixVersion>2.2.1</fixVersion>
                    <fixVersion>2.3.0</fixVersion>
                                    <component>Replication</component>
                                        <votes>2</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="171843" author="auto" created="Fri, 5 Oct 2012 13:53:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-04T15:04:31-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; end batch early if oplog version change is detected&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/edd2fa6fea3f52e1e9ac06f26a7f60d5758adae9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/edd2fa6fea3f52e1e9ac06f26a7f60d5758adae9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="171633" author="auto" created="Thu, 4 Oct 2012 22:08:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-04T15:04:31-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; end batch early if oplog version change is detected&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f059e5ff3ca997032d59f63bbc9cae109a73d92f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f059e5ff3ca997032d59f63bbc9cae109a73d92f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="171591" author="auto" created="Thu, 4 Oct 2012 20:54:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-03T08:49:45-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; split lines for easier debugging&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/8e660532455d1165ff039068336c3dcb1cd5ad5f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/8e660532455d1165ff039068336c3dcb1cd5ad5f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="171590" author="auto" created="Thu, 4 Oct 2012 20:54:27 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-03T08:32:40-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; add a &apos;v&apos; version field to each oplog document&lt;/p&gt;

&lt;p&gt;The version field will allow us to detect the primary&apos;s version.&lt;br/&gt;
We need to know which version because only newer primary oplog streams&lt;br/&gt;
should prevent a secondary from enforcing unique index constraints&lt;br/&gt;
in initial sync or recovering states.  The version field will also be&lt;br/&gt;
useful in the future when we want to make schema changes in the oplog.&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ee081e1df9792e6435568b16d4710a9443ca3657&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ee081e1df9792e6435568b16d4710a9443ca3657&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="170972" author="auto" created="Wed, 3 Oct 2012 15:49:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-03T08:49:45-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; split lines for easier debugging&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f59fbbaeec03e453af1db1cb1cfdb00cb7780e48&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f59fbbaeec03e453af1db1cb1cfdb00cb7780e48&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="170964" author="auto" created="Wed, 3 Oct 2012 15:38:17 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-03T08:32:40-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; add a &apos;v&apos; version field to each oplog document&lt;/p&gt;

&lt;p&gt;The version field will allow us to detect the primary&apos;s version.&lt;br/&gt;
We need to know which version because only newer primary oplog streams&lt;br/&gt;
should prevent a secondary from enforcing unique index constraints&lt;br/&gt;
in initial sync or recovering states.  The version field will also be&lt;br/&gt;
useful in the future when we want to make schema changes in the oplog.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/206094501a570a75b2fae5a5eb515dc5b55182bb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/206094501a570a75b2fae5a5eb515dc5b55182bb&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="170864" author="pierrearmageddon" created="Wed, 3 Oct 2012 13:47:21 +0000"  >&lt;p&gt;Thanks Eric - have done: SERVER-7243&lt;/p&gt;</comment>
                            <comment id="170842" author="milkie" created="Wed, 3 Oct 2012 13:20:07 +0000"  >&lt;p&gt;Hi Pierre.&lt;br/&gt;
Please open a new JIRA ticket; I&apos;m not sure if these fixes will help your issue.&lt;/p&gt;</comment>
                            <comment id="170828" author="pierrearmageddon" created="Wed, 3 Oct 2012 12:33:27 +0000"  >&lt;p&gt;update : this is the windows2008+ build using latest c# driver. Let me know if I need to open a separate ticket please. Txs&lt;/p&gt;</comment>
                            <comment id="170823" author="pierrearmageddon" created="Wed, 3 Oct 2012 12:24:02 +0000"  >&lt;p&gt;We are seeing this error with no unique key (except _id) present: &lt;br/&gt;
Wed Oct 03 09:37:27 &lt;span class=&quot;error&quot;&gt;&amp;#91;repl writer worker 1&amp;#93;&lt;/span&gt; ERROR: writer worker caught exception: E11000 duplicate key error index: ad.ad.$&lt;em&gt;id&lt;/em&gt;  dup key: (can give full detail in pvt ticket if necessary) &lt;/p&gt;

&lt;p&gt;This happens when upgrading from 2.0.6 to 2.2 - simply stopping the server (primary or secondary) and trying to restart with the 2.2 binaries.&lt;/p&gt;

&lt;p&gt;Will the above fix solve our issue as well?&lt;/p&gt;


</comment>
                            <comment id="170602" author="auto" created="Tue, 2 Oct 2012 21:52:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-02T10:13:15-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; do not ignore special _id unique index&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d168d1a3ee648c4dd39de70babed7a9945f75259&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d168d1a3ee648c4dd39de70babed7a9945f75259&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="170601" author="auto" created="Tue, 2 Oct 2012 21:52:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-01T10:29:58-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; ignore dups for multikey index insertions during certain replication states&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d2d9f179a17f8b76b014b621bfc7a5bf67733633&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d2d9f179a17f8b76b014b621bfc7a5bf67733633&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="170600" author="auto" created="Tue, 2 Oct 2012 21:52:44 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-28T13:20:59-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; add ROLLBACK to the list of states where we suppress duplicate key enforcement&lt;/p&gt;

&lt;p&gt;During rollback, there is a stage where we apply all the docs we fetched to undo all the&lt;br/&gt;
rolled-back operations.  This stage may encounter duplicate key errors, since we are&lt;br/&gt;
fetching the docs from the future and not from the time when they were recorded in the oplog.&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/275f68924ab8cec65fafe35193be5cbd722b3bef&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/275f68924ab8cec65fafe35193be5cbd722b3bef&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="170599" author="auto" created="Tue, 2 Oct 2012 21:52:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-28T11:54:44-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; suppress unique index enforcement during STARTUP2 or RECOVERING secondary states&lt;/p&gt;

&lt;p&gt;Operations involving unique indexes may be repeated during a recovery or initial sync. We need to ignore unique key violations in this situation.  This is okay because by the time we reach the end of the oplog stream (and are finally caught up), all the violations should be resolved (as we should end up with an exact copy of the primary).&lt;br/&gt;
Branch: v2.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1e852c70e5ad7907ec97142d27278a21324ae544&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1e852c70e5ad7907ec97142d27278a21324ae544&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="170525" author="auto" created="Tue, 2 Oct 2012 19:42:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-02T10:13:15-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; do not ignore special _id unique index&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/670f32edd8451c00a3cf6237231a434c2f7976c4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/670f32edd8451c00a3cf6237231a434c2f7976c4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="169916" author="auto" created="Mon, 1 Oct 2012 17:30:17 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-10-01T10:29:58-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; ignore dups for multikey index insertions during certain replication states&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/20701eeb63a48c5a997b33f1b1f0bb7ce00515bc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/20701eeb63a48c5a997b33f1b1f0bb7ce00515bc&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="169367" author="auto" created="Fri, 28 Sep 2012 20:26:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-28T13:20:59-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; add ROLLBACK to the list of states where we suppress duplicate key enforcement&lt;/p&gt;

&lt;p&gt;During rollback, there is a stage where we apply all the docs we fetched to undo all the&lt;br/&gt;
rolled-back operations.  This stage may encounter duplicate key errors, since we are&lt;br/&gt;
fetching the docs from the future and not from the time when they were recorded in the oplog.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c51c807b7581a3f82c4d57b2b85be1193b2d81f3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c51c807b7581a3f82c4d57b2b85be1193b2d81f3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="169340" author="auto" created="Fri, 28 Sep 2012 19:00:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2012-09-28T11:54:44-07:00&apos;, u&apos;email&apos;: u&apos;milkie@10gen.com&apos;, u&apos;name&apos;: u&apos;Eric Milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-6671&quot; title=&quot;oplog is not strictly idempotent when unique index is present&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-6671&quot;&gt;&lt;del&gt;SERVER-6671&lt;/del&gt;&lt;/a&gt; suppress unique index enforcement during STARTUP2 or RECOVERING secondary states&lt;/p&gt;

&lt;p&gt;Operations involving unique indexes may be repeated during a recovery or initial sync. We need to ignore unique key violations in this situation.  This is okay because by the time we reach the end of the oplog stream (and are finally caught up), all the violations should be resolved (as we should end up with an exact copy of the primary).&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/559d8c713ec9f81bded92da3af3b7d849756aafb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/559d8c713ec9f81bded92da3af3b7d849756aafb&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="149203" author="benjamin.becker" created="Tue, 31 Jul 2012 21:51:04 +0000"  >&lt;p&gt;Just to note &amp;#8211; the attached test is a bit nondeterministic due to killOp()/syncTail timing.  Open to any advice/input on how to make it more deterministic.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="52047">SERVER-7229</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="69273">SERVER-9059</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="51688">SERVER-7186</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="18540" name="SERVER-6671.js" size="714" author="benjamin.becker" created="Tue, 31 Jul 2012 21:43:31 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>19.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sun, 5 Aug 2012 22:04:34 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        11 years, 19 weeks, 5 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-7229'>SERVER-7229</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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 19 weeks, 5 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>auto</customfieldvalue>
            <customfieldvalue>benjamin.becker</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>pierrearmageddon</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrnt1z:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10270</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_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10154"><![CDATA[Complete]]></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|ht02vr:</customfieldvalue>

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