<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:21:19 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-29599] Balancer never relinquishes lock</title>
                <link>https://jira.mongodb.org/browse/SERVER-29599</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;After upgrading our main mongo cluster from 3.2.12 to 3.4.4, we&apos;ve noticed a weird behavior where the balancer never relinquishes it&apos;s lock.  I can run sh.isBalancerRunning() and sh.getBalancerState(), both of which return false, but the balancer lock still shows a state of &quot;2&quot;.&lt;br/&gt;
Found using:&lt;/p&gt;

&lt;p&gt;db.getSiblingDB(&quot;config&quot;).locks.findOne({_id: &quot;balancer&quot;}).state&lt;/p&gt;

&lt;p&gt;I&apos;ve checked the changelog collection and haven&apos;t found any evidence there that the balancer is still actually running.&lt;/p&gt;

&lt;p&gt;We also have had a problem for a while with moving chunks in this cluster due to mismatching index definitions on the various shards, which we are blocked from repairing due to another bug with dropping indexes which I&apos;ll log elsewhere and link to this.&lt;/p&gt;

&lt;p&gt;We turn off the balancer every night to do some system maintenance, and for now we&apos;ve been having to manually free the balancer lock otherwise this maintenance gets stuck waiting for the balancer to finish it&apos;s migration.&lt;/p&gt;

&lt;p&gt;On a possibly related note, I&apos;ve had to fix this balancer lock a few times in the past few days, so either some process on our end keeps re-enabling the balancer, or the lock keeps getting re-established on its own.&lt;/p&gt;</description>
                <environment>3.4.4 sharded cluster with 18 shards, each consisting of 1 replica, 1 primary, and 1 hidden replica.  3 config servers (CSRS) and 5 mongoS</environment>
        <key id="393374">SERVER-29599</key>
            <summary>Balancer never relinquishes lock</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13202">Works as Designed</resolution>
                                        <assignee username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</assignee>
                                    <reporter username="glajchs">Scott Glajch</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Jun 2017 15:32:48 +0000</created>
                <updated>Fri, 27 Oct 2023 13:54:24 +0000</updated>
                            <resolved>Tue, 13 Jun 2017 15:49:28 +0000</resolved>
                                    <version>3.4.4</version>
                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1595827" author="glajchs" created="Tue, 13 Jun 2017 18:03:08 +0000"  >&lt;p&gt;You&apos;re right, after looking into it, we had written direct code on our end to check for the lock state.  I&apos;ve updated our code and everything is fine now.  Thank you for the quick response!&lt;/p&gt;</comment>
                            <comment id="1595820" author="kaloian.manassiev" created="Tue, 13 Jun 2017 18:00:21 +0000"  >&lt;p&gt;I don&apos;t think the MongoDB Java driver has any means for controlling the balancer, only the shell helpers do.&lt;/p&gt;</comment>
                            <comment id="1595761" author="glajchs" created="Tue, 13 Jun 2017 17:08:08 +0000"  >&lt;p&gt;Ok thanks! I think perhaps the java mongo driver we&apos;re using to determine if the balancer is still running might just need an upgrade.  Hopefully that fixes our issue.  I&apos;ll get back to you shortly on that.&lt;/p&gt;</comment>
                            <comment id="1595662" author="kaloian.manassiev" created="Tue, 13 Jun 2017 15:49:17 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=glajchs&quot; class=&quot;user-hover&quot; rel=&quot;glajchs&quot;&gt;glajchs&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Starting in MongoDB version 3.4 we moved the balancer to run on the primary of the config server. As of this change, the balancer lock is intentionally not released, in order to prevent any accidentally left 3.2 or earlier mongos nodes from taking it. This is documented &lt;a href=&quot;https://docs.mongodb.com/manual/core/sharding-balancer-administration/#cluster-balancer&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This indeed means that some of the older mongo shell utilities are not compatible with 3.4, so we recommend using the 3.4 shell. The implementation of &lt;tt&gt;sh.isBalancerRunning&lt;/tt&gt; now uses a new command called &lt;a href=&quot;https://docs.mongodb.com/manual/reference/command/balancerStatus/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;balancerStatus&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br/&gt;
-Kal.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 13 Jun 2017 15:49:17 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 35 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 35 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>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>glajchs</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht93hb:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;ol&gt;
	&lt;li&gt;Stop the balancer&lt;/li&gt;
	&lt;li&gt;Wait for the balancer to finish it&apos;s migration and stop&lt;/li&gt;
	&lt;li&gt;Check locks collection for the balancer lock&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Let me know if you need more information to help reproduce.  I&apos;m not sure what you need now but I&apos;m sure you&apos;ll need something.&lt;/p&gt;</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|ht8pjr:</customfieldvalue>

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