<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:57:59 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-1770] Replica set fails to add member</title>
                <link>https://jira.mongodb.org/browse/SERVER-1770</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Hi, I&apos;m trying to use Ruby to configure MongoDB replica set and seems that there is a bug while trying to eval rs.add.&lt;/p&gt;

&lt;p&gt;When trying to use db.eval to run rs.add() from Ruby script I&apos;m getting following error:&lt;br/&gt;
{&quot;retval&quot;=&amp;gt;&lt;/p&gt;
{&quot;assertion&quot;=&amp;gt;&quot;need most members up to reconfigure, not ok : ip108&quot;, &quot;assertionCode&quot;=&amp;gt;13144, &quot;errmsg&quot;=&amp;gt;&quot;db assertion failure&quot;, &quot;ok&quot;=&amp;gt;0.0}
&lt;p&gt;, &quot;ok&quot;=&amp;gt;1.0}&lt;/p&gt;

&lt;p&gt;Log file (primary) shows following error (full connection log is attached as &quot;log_rsadd_using_ruby.txt&quot;&lt;br/&gt;
Fri Sep 10 16:47:31 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn71&amp;#93;&lt;/span&gt;  admin Assertion failure !dbMutex.isWriteLocked() db/repl/heartbeat.cpp 115&lt;br/&gt;
Fri Sep 10 16:47:31 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn71&amp;#93;&lt;/span&gt; replSet cmufcc requestHeartbeat ip096:27017 : 0 assertion db/repl/heartbeat.cpp:115&lt;br/&gt;
Fri Sep 10 16:47:31 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn71&amp;#93;&lt;/span&gt;  admin Assertion failure !dbMutex.isWriteLocked() db/repl/heartbeat.cpp 115&lt;br/&gt;
Fri Sep 10 16:47:31 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn71&amp;#93;&lt;/span&gt; replSet cmufcc requestHeartbeat ip108 : 0 assertion db/repl/heartbeat.cpp:115&lt;br/&gt;
Fri Sep 10 16:47:31 &lt;span class=&quot;error&quot;&gt;&amp;#91;conn71&amp;#93;&lt;/span&gt; replSet replSetReconfig exception: need most members up to reconfigure, not ok : ip108&lt;/p&gt;

&lt;p&gt;It worked when I tried to add member using mongo shell using the same rs.add(), so I&apos;m sure all members were up.&lt;/p&gt;</description>
                <environment>a) 4 replica-set nodes running according to rs.status() are all healthy&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(ip096=172.29.1.96, ip108=172.29.1.108, ip119=172.29.1.119, ip120=172.29.1.120)&lt;br/&gt;
b) primary is ip096 (attached log is taken from primary)&lt;br/&gt;
c) adding 5th node (ip121=172.29.1.121)&lt;br/&gt;
d) all using standard ports (27017)&lt;br/&gt;
e) ruby 1.9.2&lt;br/&gt;
f) mongo driver</environment>
        <key id="13062">SERVER-1770</key>
            <summary>Replica set fails to add member</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="9">Done</resolution>
                                        <assignee username="kbanker">Kyle Banker</assignee>
                                    <reporter username="jozef">Jozef Sovcik</reporter>
                        <labels>
                    </labels>
                <created>Fri, 10 Sep 2010 15:33:11 +0000</created>
                <updated>Fri, 30 Mar 2012 14:26:58 +0000</updated>
                            <resolved>Fri, 10 Sep 2010 19:29:46 +0000</resolved>
                                    <version>1.6.2</version>
                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="18030" author="jozef" created="Fri, 10 Sep 2010 19:35:49 +0000"  >&lt;p&gt;Great!&lt;/p&gt;</comment>
                            <comment id="18029" author="kbanker" created="Fri, 10 Sep 2010 19:29:09 +0000"  >&lt;p&gt;Added.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.mongodb.org/display/DOCS/Server-side+Code+Execution#Server-sideCodeExecution-Limitationsof%7B%7Beval%7D%7D&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.mongodb.org/display/DOCS/Server-side+Code+Execution#Server-sideCodeExecution-Limitationsof%7B%7Beval%7D%7D&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="18028" author="jozef" created="Fri, 10 Sep 2010 19:01:32 +0000"  >&lt;p&gt;I would anyway recommend either &lt;br/&gt;
a) to mention this at your wiki page&lt;br/&gt;
b) or fix the issue&lt;/p&gt;

&lt;p&gt;So others will not waste time trying to find why rs.add does not work...&lt;br/&gt;
Maybe it would be good to mention with &apos;eval&apos; or &apos;command&apos; method, that some js functions may fail because of locking some objects.&lt;/p&gt;</comment>
                            <comment id="18027" author="jozef" created="Fri, 10 Sep 2010 18:57:33 +0000"  >&lt;p&gt;one more correction &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;

&lt;p&gt;config = connection&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;local&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;system.replset&amp;#39;&amp;#93;&lt;/span&gt;.find_one&lt;/p&gt;

&lt;p&gt;Anyway, it works. Thanks a lot!&lt;br/&gt;
My compliments to your great support!&lt;/p&gt;

&lt;p&gt;Based on this experience I wrote a method for Mongo::Connection class &apos;add_rs_member&apos;.&lt;br/&gt;
You can find it here &lt;a href=&quot;http://gist.github.com/574143&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://gist.github.com/574143&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="18021" author="kbanker" created="Fri, 10 Sep 2010 18:06:42 +0000"  >&lt;p&gt;First like should read&lt;/p&gt;

&lt;p&gt;config = connection&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;local&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;system.replSet&amp;#39;&amp;#93;&lt;/span&gt;.find_one &lt;/p&gt;</comment>
                            <comment id="18017" author="kbanker" created="Fri, 10 Sep 2010 17:00:47 +0000"  >&lt;p&gt;I believe the problem is that eval takes and write lock and that this conflicts with the requirements of reinitiating a replica set. Much better to do this manually like so:&lt;/p&gt;

&lt;p&gt;config = connection&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;local&amp;#39;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;system.replSet&amp;#39;&amp;#93;&lt;/span&gt;.findOne&lt;br/&gt;
config&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;version&amp;#39;&amp;#93;&lt;/span&gt; += 1&lt;br/&gt;
config&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;members&amp;#39;&amp;#93;&lt;/span&gt; &amp;lt;&amp;lt; &lt;/p&gt;
{&quot;_id&quot;: 4, &quot;host&quot;: &quot;ipaddress&quot;}

&lt;p&gt;connection&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;admin&amp;#39;&amp;#93;&lt;/span&gt;.command({ :replSetReconfig =&amp;gt; config})&lt;/p&gt;

&lt;p&gt;Please report back if this works. Include the relevant Ruby file you&apos;ve written if it fails.&lt;/p&gt;</comment>
                            <comment id="18016" author="jozef" created="Fri, 10 Sep 2010 15:40:01 +0000"  >&lt;p&gt;I have it all right here in front of me, so for next couple of hours I&apos;m available to help.&lt;/p&gt;</comment>
                            <comment id="18015" author="jozef" created="Fri, 10 Sep 2010 15:37:29 +0000"  >&lt;p&gt;Forgot to mention: Linux distro: Debian Lenny 64bit&lt;/p&gt;</comment>
                            <comment id="18014" author="eliot" created="Fri, 10 Sep 2010 15:35:14 +0000"  >&lt;p&gt;Kyle can help figure what the root issue is here&lt;/p&gt;</comment>
                            <comment id="18013" author="jozef" created="Fri, 10 Sep 2010 15:34:16 +0000"  >&lt;p&gt;I have attached also ruby script I used for testing.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10439" name="add_rs_member.rb" size="369" author="jozef" created="Fri, 10 Sep 2010 15:33:11 +0000"/>
                            <attachment id="10437" name="log_rsadd_using_ruby.txt" size="2324" author="jozef" created="Fri, 10 Sep 2010 15:33:11 +0000"/>
                            <attachment id="10438" name="log_rsadd_using_shell.txt" size="1614" author="jozef" created="Fri, 10 Sep 2010 15:33:11 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>10.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 10 Sep 2010 15:35:14 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 23 weeks, 5 days 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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 23 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10020"><![CDATA[Linux]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>jozef</customfieldvalue>
            <customfieldvalue>kbanker</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpfdz:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21773</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_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|ht0cdb:</customfieldvalue>

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