<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:02:23 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-3205] Dropping sharded database leads to errors with dbnames which are prefixes of dropped name</title>
                <link>https://jira.mongodb.org/browse/SERVER-3205</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Hi,&lt;/p&gt;


&lt;p&gt;There is a issue which is causing mongos to crash. Following is the description:&lt;/p&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;2 shards configured with one router and one config server.&lt;/li&gt;
	&lt;li&gt;Using mongo shell to configure shards. Configured sharding on 2 databases named &quot;tutorial1&quot; and &quot;tutorial10&quot;&lt;/li&gt;
	&lt;li&gt;Insert a document in &quot;tutorial1&quot;&lt;/li&gt;
	&lt;li&gt;Drop database &quot;tutorial1&quot;&lt;/li&gt;
	&lt;li&gt;Insert a document in &quot;tutorial10&quot;&lt;br/&gt;
mongos will crash and an exception is received at mongo shell&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;Following are the set of commands to configure above setup and replicate crash.&lt;/p&gt;


&lt;p&gt;Run mongo instances&lt;br/&gt;
./mongod  --bind_ip 192.168.50.68 --port 20000  --shardsvr --dbpath /sata1/master &lt;br/&gt;
./mongod  --bind_ip 192.168.50.68 --port 25000  --shardsvr --dbpath /sata2/master&lt;br/&gt;
./mongod  --bind_ip 192.168.50.68 --port 30000  --configsvr --dbpath /sata1/configdb&lt;br/&gt;
./mongos  --bind_ip 192.168.50.68 --port 35000 --configdb 192.168.50.68:30000&lt;/p&gt;


&lt;p&gt;Configure using mongo shell&lt;br/&gt;
use admin&lt;br/&gt;
db.admin.runCommand(&lt;/p&gt;
{&quot;addshard&quot; : &quot;192.168.50.68:20000&quot;}
&lt;p&gt;);&lt;br/&gt;
db.admin.runCommand(&lt;/p&gt;
{&quot;addshard&quot; : &quot;192.168.50.68:25000&quot;}
&lt;p&gt;);&lt;/p&gt;


&lt;p&gt;db.runCommand( &lt;/p&gt;
{ enablesharding : &quot;tutorial1&quot; }
&lt;p&gt; )&lt;br/&gt;
db.runCommand( { shardcollection : &quot;tutorial1.testsh&quot;, key : {_sk : 1} } )&lt;/p&gt;


&lt;p&gt;db.runCommand( &lt;/p&gt;
{ enablesharding : &quot;tutorial10&quot; }
&lt;p&gt; )&lt;br/&gt;
db.runCommand( { shardcollection : &quot;tutorial10.testsh&quot;, key : {_sk : 1} } )&lt;/p&gt;


&lt;p&gt;Crash Replication commands&lt;br/&gt;
use tutorial1&lt;br/&gt;
db.testsh.save({_id:&quot;id_1&quot;,_sk:&quot;1&quot;})&lt;br/&gt;
db.dropDatabase()&lt;/p&gt;


&lt;p&gt;use tutorial10&lt;br/&gt;
db.testsh.save({_id:&quot;id_1&quot;,_sk:&quot;1&quot;})  //This will Cause Crash&lt;/p&gt;


&lt;p&gt;Error message visible on mongo shell&lt;br/&gt;
Thu Mar 11 06:51:39 MessagingPort recv() errno:104 Connection reset by peer 192.168.50.68:35000&lt;br/&gt;
Thu Mar 11 06:51:39 SocketException: remote:  error: 9001 socket exception &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;&lt;br/&gt;
Thu Mar 11 06:51:39 DBClientCursor::init call() failed&lt;br/&gt;
Thu Mar 11 06:51:39 query failed : tutorial10.$cmd &lt;/p&gt;
{ getlasterror: 1.0, w: 1.0 }
&lt;p&gt; to: 192.168.50.68:35000&lt;br/&gt;
Thu Mar 11 06:51:39 Error: error doing query: failed shell/collection.js:150&lt;br/&gt;
Thu Mar 11 06:51:39 trying reconnect to 192.168.50.68:35000&lt;br/&gt;
Thu Mar 11 06:51:39 reconnect 192.168.50.68:35000 failed couldn&apos;t connect to server 192.168.50.68:35000&lt;/p&gt;


&lt;p&gt;Crash Log found at mongos&lt;br/&gt;
mongos: /opt/extra/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr&amp;lt; &amp;lt;template-parameter-1-1&amp;gt; &amp;gt;::operator-&amp;gt;() const &lt;span class=&quot;error&quot;&gt;&amp;#91;with T = mongo::ChunkManager&amp;#93;&lt;/span&gt;: Assertion `px != 0&apos; failed.&lt;br/&gt;
Received signal 6&lt;br/&gt;
Backtrace: 0x52e235 0x3e19e302d0 0x3e19e30265 0x3e19e31d10 0x3e19e296e6 0x69b2dd 0x69acf2 0x576ba6 0x5774b6 0x575630 0x575b31 0x62dcdd 0x63913d 0x63a1e3 0x664202 0x6761c7 0x57ea3c 0x69ec30 0x3e1aa0673d 0x3e19ed3d1d&lt;br/&gt;
./mongos(_ZN5mongo17printStackAndExitEi+0x75)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x52e235&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e302d0&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(gsignal+0x35)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e30265&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(abort+0x110)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e31d10&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(__assert_fail+0xf6)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e296e6&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos&lt;span class=&quot;error&quot;&gt;&amp;#91;0x69b2dd&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos&lt;span class=&quot;error&quot;&gt;&amp;#91;0x69acf2&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5boost6detail8function17function_invoker4IPFbRN5mongo12DBClientBaseERKSsbiEbS5_S7_biE6invokeERNS1_15function_bufferES5_S7_bi+0x16)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x576ba6&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo17ClientConnections13checkVersionsERKSs+0x1c6)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x5774b6&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo15ShardConnection5_initEv+0x2d0)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x575630&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo15ShardConnectionC1ERKNS_5ShardERKSs+0xa1)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x575b31&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo8Strategy7doWriteEiRNS_7RequestERKNS_5ShardEb+0x4d)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x62dcdd&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo13ShardStrategy7_updateERNS_7RequestERNS_9DbMessageEN5boost10shared_ptrINS_12ChunkManagerEEE+0xd8d)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x63913d&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo13ShardStrategy7writeOpEiRNS_7RequestE+0x2b3)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x63a1e3&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo7Request7processEi+0x172)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x664202&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo21ShardedMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0x77)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x6761c7&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x34c)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x57ea3c&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(thread_proxy+0x80)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x69ec30&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libpthread.so.0&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e1aa0673d&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(clone+0x6d)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19ed3d1d&amp;#93;&lt;/span&gt;&lt;br/&gt;
===&lt;br/&gt;
Received signal 11&lt;br/&gt;
Backtrace: 0x52e235 0x3e19e302d0 0x3e19e7c126 0x3e2c49c200 0x3e2c49c8ff 0x532ed0 0x577ffc 0x5789dc 0x69f3c1 0x573b22 0x3e19e333a5 0x52e29b 0x3e19e302d0 0x3e19e30265 0x3e19e31d10 0x3e19e296e6 0x69b2dd 0x69acf2 0x576ba6 0x5774b6&lt;br/&gt;
./mongos(_ZN5mongo17printStackAndExitEi+0x75)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x52e235&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e302d0&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(memcpy+0x286)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e7c126&amp;#93;&lt;/span&gt;&lt;br/&gt;
/usr/lib64/libstdc++.so.6(_ZNSs4_Rep8_M_cloneERKSaIcEm+0x50)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e2c49c200&amp;#93;&lt;/span&gt;&lt;br/&gt;
/usr/lib64/libstdc++.so.6(_ZNSsC1ERKSs+0x4f)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e2c49c8ff&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(&lt;em&gt;ZNK5mongo16DBConnectionPool17serverNameCompareclERKSsS3&lt;/em&gt;+0x170)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x532ed0&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo17ClientConnections7releaseERKSsPNS_12DBClientBaseE+0x25c)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x577ffc&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5boost19thread_specific_ptrIN5mongo17ClientConnectionsEE11delete_dataclEPv+0xac)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x5789dc&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb+0x151)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x69f3c1&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos&lt;span class=&quot;error&quot;&gt;&amp;#91;0x573b22&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(exit+0xe5)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e333a5&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos&lt;span class=&quot;error&quot;&gt;&amp;#91;0x52e29b&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e302d0&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(gsignal+0x35)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e30265&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(abort+0x110)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e31d10&amp;#93;&lt;/span&gt;&lt;br/&gt;
/lib64/libc.so.6(__assert_fail+0xf6)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x3e19e296e6&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos&lt;span class=&quot;error&quot;&gt;&amp;#91;0x69b2dd&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos&lt;span class=&quot;error&quot;&gt;&amp;#91;0x69acf2&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5boost6detail8function17function_invoker4IPFbRN5mongo12DBClientBaseERKSsbiEbS5_S7_biE6invokeERNS1_15function_bufferES5_S7_bi+0x16)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x576ba6&amp;#93;&lt;/span&gt;&lt;br/&gt;
./mongos(_ZN5mongo17ClientConnections13checkVersionsERKSs+0x1c6)&lt;span class=&quot;error&quot;&gt;&amp;#91;0x5774b6&amp;#93;&lt;/span&gt;&lt;br/&gt;
===&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;root@localhost mongobin_1.8.1&amp;#93;&lt;/span&gt;#&lt;/p&gt;


&lt;p&gt;Note:&lt;br/&gt;
After more digging, it has been observed that since &quot;tutorial1&quot; database name is a sub-string of another database &quot;tutorial10&quot;. And &quot;tutorial1&quot; is dropped, then any operation on &quot;tutorial10&quot; (or any database name starting with tutorial1) will cause crash of mongos.&lt;/p&gt;


&lt;p&gt;Please suggest. Thanks!&lt;/p&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Nikhil&lt;/p&gt;</description>
                <environment></environment>
        <key id="17949">SERVER-3205</key>
            <summary>Dropping sharded database leads to errors with dbnames which are prefixes of dropped name</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="greg_10gen">Greg Studer</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Jun 2011 14:08:38 +0000</created>
                <updated>Tue, 29 May 2012 14:53:35 +0000</updated>
                            <resolved>Mon, 29 Aug 2011 21:51:30 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="36331" author="greg_10gen" created="Mon, 6 Jun 2011 14:10:23 +0000"  >&lt;p&gt;The boost error is fixed in 1.9, but the prefix error should be looked into.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="20079">SERVER-3471</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="14015">SERVER-2253</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 37 weeks, 2 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>
                            12 years, 37 weeks, 2 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="10026"><![CDATA[ALL]]></customfieldvalue>

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

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

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

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