<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:00:35 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-22502] Replication Protocol 1 rollbacks are more likely during priority takeover</title>
                <link>https://jira.mongodb.org/browse/SERVER-22502</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;General note: I know that the title is too general, but this is the 3rd bug I&apos;m opening this week. We have another one coming for 3.2.1 related to sharding which we will soon publish. We are thinking of moving out of mongodb, the reliability of 3.2 is horrible!&lt;/p&gt;

&lt;p&gt;2 bugs in this ticket:&lt;/p&gt;

&lt;p&gt;1. We removed a member using rs.remove(). After that - the removed member (of which the log is attached) - started a versioning mess and killed itself.&lt;br/&gt;
filename = crash.&lt;/p&gt;

&lt;p&gt;2. 2nd time we got the following behavior: a member selects itself, although it doesn&apos;t need to, and causes a rollback of the other member.&lt;br/&gt;
Our setup: primary, secondary and arbiter.&lt;br/&gt;
Primary: rs.stepDown() for maintenance. &lt;br/&gt;
Secondary takes over.&lt;br/&gt;
When primary is back, it starts syncing, as you can see from the logs - during this time it receives 2 &quot;no&quot; votes since it is still stale, but then - it receives only 1 &quot;yes&quot; vote (for some reason, the arbiter is quiet) - and is elected before its time. This causes a rollback on the other node.&lt;br/&gt;
All 3 nodes&apos; logs are attached (primary, secondary, are). Please note the following lines:&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;2016-02-07T09:38:14.612+0000 I REPL     [ReplicationExecutor] VoteRequester: Got no vote from in.db2m2.mydomain.com:27017 because: candidate&apos;s data is staler than mine, resp:{ term: 3, voteGranted: false, reason: &quot;candidate&apos;s data is staler than mine&quot;, ok: 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;   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;2016-02-07T09:38:14.612+0000 I REPL     [ReplicationExecutor] VoteRequester: Got no vote from in.db2arb.mydomain.com:27017 because: candidate&apos;s data is staler than mine, resp:{ term: 3, voteGranted: false, reason: &quot;candidate&apos;s data is staler than mine&quot;, ok: 1.0 }&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;and after 9 seconds, suddenly:&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;2016-02-07T09:38:25.613+0000 I REPL     [ReplicationExecutor] VoteRequester: Got no vote from in.db2m2.mydomain.com:27017 because: candidate&apos;s data is staler than mine, resp:{ term: 3, voteGranted: false, reason: &quot;candidate&apos;s data is staler than mine&quot;, ok: 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;2016-02-07T09:38:25.613+0000 I REPL     [ReplicationExecutor] dry election run succeeded, running for election&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;2016-02-07T09:38:25.614+0000 I REPL     [ReplicationExecutor] election succeeded, assuming primary role in term 4&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;2016-02-07T09:38:25.614+0000 I REPL     [ReplicationExecutor] transition to PRIMARY&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;All members in protocol version 1. They were 0 but upgraded according to your docs ~a week ago.&lt;/p&gt;</description>
                <environment></environment>
        <key id="263682">SERVER-22502</key>
            <summary>Replication Protocol 1 rollbacks are more likely during priority takeover</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="3">Duplicate</resolution>
                                        <assignee username="milkie@mongodb.com">Eric Milkie</assignee>
                                    <reporter username="yonido">Yoni Douek</reporter>
                        <labels>
                            <label>RF</label>
                    </labels>
                <created>Sun, 7 Feb 2016 10:26:40 +0000</created>
                <updated>Wed, 21 Sep 2016 21:25:10 +0000</updated>
                            <resolved>Wed, 21 Sep 2016 21:25:09 +0000</resolved>
                                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>22</watches>
                                                                                                                <comments>
                            <comment id="1233662" author="schwerin" created="Tue, 12 Apr 2016 18:29:58 +0000"  >&lt;p&gt;Re-opening to mark as duplicate of feature request &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-18453&quot; title=&quot;Avoiding Rollbacks in new Raft based election protocol&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-18453&quot;&gt;&lt;del&gt;SERVER-18453&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1177897" author="milkie" created="Thu, 18 Feb 2016 20:33:10 +0000"  >&lt;p&gt;I am closing this out due to lack of activity, but it can be immediately reopened if there are further questions.&lt;br/&gt;
Issue summary: &lt;br/&gt;
Rollbacks are more likely during priority takeover elections when using protocol version 1 as compared with using protocol version 0.  While this is unfortunate, the real solution to avoid reading and writing data that won&apos;t roll back is to use a write concern that guarantees that data will not roll back.  Using a write concern that ignores the progress of secondaries will get you super fast performance at the expense of losing written data due to rollbacks from the result of changes in replica set leadership.&lt;/p&gt;</comment>
                            <comment id="1169237" author="milkie" created="Wed, 10 Feb 2016 15:25:32 +0000"  >&lt;p&gt;If you&apos;re not using w:majority write concern for your writes, it is possible to lose such writes even when they appear to be successful, regardless of MongoDB version or replication protocol version.&lt;br/&gt;
If you want the priority takeover behavior that was present in 3.0, it is fine to run with protocol version 0 in version 3.2; it is not deprecated.&lt;/p&gt;</comment>
                            <comment id="1167978" author="yonido" created="Tue, 9 Feb 2016 16:27:12 +0000"  >&lt;p&gt;Writes to majority is irrelevant in our case (primary, secondary and arbiter), and we don&apos;t want to impact our write speeds so that&apos;s not an option. Bottom line, we&apos;re getting rollbacks and in the previous versions we didn&apos;t. We had rollbacks of 7ms, but also of 11sec and even &amp;gt;50sec, are we bound to suffer from data loss just because we upgraded the protocolVersion?&lt;/p&gt;</comment>
                            <comment id="1166950" author="milkie" created="Mon, 8 Feb 2016 19:58:19 +0000"  >&lt;p&gt;Hi Yoni.&lt;br/&gt;
We filed a separate ticket to fix the crash you experienced in the removed member: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22504&quot; title=&quot;Do not blindly add self to heartbeat member data array in the TopologyCoordinator&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22504&quot;&gt;&lt;del&gt;SERVER-22504&lt;/del&gt;&lt;/a&gt;.  The cause is unrelated to code that was added for version 3.2 and has been present as a bug since version 3.0.  &lt;/p&gt;

&lt;p&gt;Regarding the behavior of a 3-node replica set with one arbiter, I do not see anything in your description that is unexpected for that configuration.  There was one update issued to the lower priority primary at about the same moment that the higher priority secondary achieved a successful election for priority takeover; this update was rolled back after the election.  This behavior can happen in both protocol versions 0 and 1.  However, it may be more likely to happen in protocol version 1 due to the new way that priorities are enforced.  At no time, however, are any committed writes rolled back.  Writes that are written to a majority of nodes are considered committed and will never roll back; you can issue reads to a view of the data that only contains committed writes by using read concern level majority.&lt;br/&gt;
&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-11086&quot; title=&quot;Election handoff to new primary, during stepdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-11086&quot;&gt;&lt;del&gt;SERVER-11086&lt;/del&gt;&lt;/a&gt; is scheduled to be implemented soon, which will avoid rollbacks when doing a controlled handoff of primaryship from one functioning node to another, as done during a replSetStepDown command or a priority takeover.&lt;/p&gt;</comment>
                            <comment id="1165923" author="yonido" created="Sun, 7 Feb 2016 10:28:56 +0000"  >&lt;p&gt;Correction - &quot;but then - it receives only 1 &quot;no&quot; * vote&quot;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="279177">SERVER-23663</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="203830">SERVER-18453</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="263732">SERVER-22504</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="93307">SERVER-11086</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="108069" name="arb" size="3204" author="yonido" created="Sun, 7 Feb 2016 10:26:40 +0000"/>
                            <attachment id="108072" name="crash" size="19562" author="yonido" created="Sun, 7 Feb 2016 10:26:40 +0000"/>
                            <attachment id="108071" name="primary" size="25700" author="yonido" created="Sun, 7 Feb 2016 10:26:40 +0000"/>
                            <attachment id="108070" name="secondary" size="54306" author="yonido" created="Sun, 7 Feb 2016 10:26:40 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.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>Sun, 7 Feb 2016 13:55:39 +0000</customfieldvalue>

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


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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 44 weeks, 1 day 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>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>yonido</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrki3b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrfyzz:</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_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|hsf9bb:</customfieldvalue>

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