<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:23:11 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-10447] dropDatabase() doesn&apos;t know about symlinks</title>
                <link>https://jira.mongodb.org/browse/SERVER-10447</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;First of all, thanks for developing MongoDB, and releasing it as open source software!&lt;/p&gt;

&lt;p&gt;We have been using MongoDB with the --directoryperdb option, and it&apos;s been running great. As the data in the system has expanded, we added some additional hard drives to the server, to reduce spindle contention and increase the amount o&lt;br/&gt;
f disk space available. To accomplish this, we used a simple method of creating symlinks from the Mongo data directory out to per-database directories on separate drives. Others online have done similar things before us (Google: mongodb directoryperdb symlink).&lt;/p&gt;

&lt;p&gt;Recently, we discovered that if you drop such a database from the Mongo shell, Mongo will simply remove the symlink, without dereferencing it. The end result is that the symlink goes away, and the data on the additional drive becomes orphaned. Worse, if you later recreate or otherwise try to access the same database again, Mongo has no memory of the symlink or the other drive, and creates the database anew.&lt;/p&gt;

&lt;p&gt;The end result is that under this configuration, if you drop and then re-add such a database, the new data will be written to the original drive.&lt;/p&gt;

&lt;p&gt;I have attached a patch to MongoDB 2.4.5 that changes this behavior. In normal circumstances, it should work just as it did before. However, in the situation described above, MongoDB will instead follow the symlink, and remove the contents of the target directory instead.&lt;/p&gt;

&lt;p&gt;The theory is that since the symlink was placed there by a system administrator, it will be left alone. This makes creating and deleting a database a symmetrical operation from the Mongo shell. Creating and deleting the symlink and provisioning additional hard drives is also a symmetrical operation for the system administrator.&lt;/p&gt;</description>
                <environment></environment>
        <key id="84940">SERVER-10447</key>
            <summary>dropDatabase() doesn&apos;t know about symlinks</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="nrosenqu">Nathan Rosenquist</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Aug 2013 01:52:28 +0000</created>
                <updated>Sat, 9 Jul 2016 21:09:33 +0000</updated>
                            <resolved>Sun, 2 Mar 2014 21:13:38 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="507788" author="dan@10gen.com" created="Sun, 2 Mar 2014 21:13:38 +0000"  >&lt;p&gt;I&apos;m marking this a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1379&quot; title=&quot;dropdb with directoryperdb should remove contents, not delete directory (mmapV1)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1379&quot;&gt;&lt;del&gt;SERVER-1379&lt;/del&gt;&lt;/a&gt;.  Thanks for your patch Nathan &amp;#8211; I&apos;ll make sure it&apos;s referenced in the open ticket.&lt;/p&gt;</comment>
                            <comment id="398081" author="nrosenqu" created="Wed, 7 Aug 2013 19:00:05 +0000"  >&lt;p&gt;Thanks for the detailed reply Stephen.&lt;/p&gt;

&lt;p&gt;I&apos;ll have to revisit this later when I&apos;m not on a deadline.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
-Nathan&lt;/p&gt;</comment>
                            <comment id="397501" author="stennie" created="Wed, 7 Aug 2013 02:28:40 +0000"  >&lt;p&gt;Hi Nathan,&lt;/p&gt;

&lt;p&gt;Thank you for raising this issue and including a code contribution.  Have you read our guide to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/CONTRIBUTING.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Contributing to the MongoDB project&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;There are a few extra steps that will help this request be ready for review by our kernel team:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;add a reference to this Jira ticket in the commit comment&lt;/li&gt;
	&lt;li&gt;add test cases&lt;/li&gt;
	&lt;li&gt;adhere to the &lt;a href=&quot;http://www.mongodb.org/about/contributors/kernel-code-style/#kernel-code-style&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Kernel Code Style&lt;/a&gt;; in particular, there are some long lines added (should be limited to 100 columns)&lt;/li&gt;
	&lt;li&gt;sign the &lt;a href=&quot;http://www.10gen.com/contributor&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;contributor agreement&lt;/a&gt; if you haven&apos;t already&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Rather than providing a patch file, contributions are normally done via a pull request on Github:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;fork the &lt;a href=&quot;https://github.com/mongodb/mongo&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb repo on Github&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;create a new feature branch for your changes&lt;/li&gt;
	&lt;li&gt;squash your commits once you have finished making changes&lt;/li&gt;
	&lt;li&gt;submit a pull request (as above, be sure to reference this SERVER issue in the commit message)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Regards,&lt;br/&gt;
Stephen&lt;/p&gt;</comment>
                            <comment id="397485" author="nrosenqu" created="Wed, 7 Aug 2013 02:02:30 +0000"  >&lt;p&gt;FYI, It seems this issue is somewhat related to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1379&quot; title=&quot;dropdb with directoryperdb should remove contents, not delete directory (mmapV1)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1379&quot;&gt;&lt;del&gt;SERVER-1379&lt;/del&gt;&lt;/a&gt; as well.&lt;/p&gt;

&lt;p&gt;Thanks again!&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="29627" name="mongodb-src-r2.4.5-preserve-directoryperdb-symlinks.patch" size="2642" author="nrosenqu" created="Wed, 7 Aug 2013 01:52:28 +0000"/>
                    </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_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>Wed, 7 Aug 2013 02:28:40 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 50 weeks, 3 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 50 weeks, 3 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>dan@mongodb.com</customfieldvalue>
            <customfieldvalue>nrosenqu</customfieldvalue>
            <customfieldvalue>stephen.steneker@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrmkcv:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>77701</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;p&gt;Here is an example of the current behavior in action, using MongoDB 2.4.5:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /var/mongo/data/&lt;br/&gt;
drwxr-xr-x 2 mongo mongo   4.0K May  9 14:17 mydb01 -&amp;gt; /u0/mydb01&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     34 May  9 14:17 mydb02 -&amp;gt; /u1/mydb02&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     32 May  9 14:17 mydb03 -&amp;gt; /u2/mydb03&lt;br/&gt;
drwxr-xr-x 2 mongo mongo   4.0K Aug  6 16:56 journal&lt;br/&gt;
-rwxr-xr-x 1 mongo mongo      6 Jul 18 13:27 mongod.lock&lt;br/&gt;
drwxr-xr-x 3 mongo mongo   4.0K Aug  6 16:56 _tmp&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /u0/mydb01/ &lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo  64M Aug  6 17:42 mydb01.0&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 128M Aug  6 14:05 mydb01.1&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 2.0G Aug  2 10:27 mydb01.10&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 2.0G Aug  6 02:10 mydb01.100&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;&amp;gt; use mydb01&lt;br/&gt;
switched to db mydb01&lt;br/&gt;
&amp;gt; db.dropDatabase()&lt;/p&gt;
{ &quot;dropped&quot; : &quot;mydb01&quot;, &quot;ok&quot; : 1 }
&lt;p&gt;&amp;gt; db.mydb01.insert(&lt;/p&gt;
{&quot;a&quot;:&quot;b&quot;}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /var/mongo/data/&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     34 May  9 14:17 mydb02 -&amp;gt; /u1/mydb02&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     32 May  9 14:17 mydb03 -&amp;gt; /u2/mydb03&lt;br/&gt;
drwxr-xr-x 2 mongo mongo   4.0K Aug  6 16:56 journal&lt;br/&gt;
-rwxr-xr-x 1 mongo mongo      6 Jul 18 13:27 mongod.lock&lt;br/&gt;
drwxr-xr-x 3 mongo mongo   4.0K Aug  6 16:56 _tmp&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /u0/mydb01/ &lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo  64M Aug  6 17:42 mydb01.0&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 128M Aug  6 14:05 mydb01.1&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 2.0G Aug  2 10:27 mydb01.10&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 2.0G Aug  6 02:10 mydb01.100&lt;br/&gt;
...&lt;/p&gt;


&lt;p&gt;----------&lt;/p&gt;


&lt;p&gt;Here is an example of this behavior in action, using MongoDB 2.4.5, patched to preserve&lt;br/&gt;
symlinks:&lt;/p&gt;


&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /var/mongo/data/&lt;br/&gt;
drwxr-xr-x 2 mongo mongo   4.0K May  9 14:17 mydb01 -&amp;gt; /u0/mydb01&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     34 May  9 14:17 mydb02 -&amp;gt; /u1/mydb02&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     32 May  9 14:17 mydb03 -&amp;gt; /u2/mydb03&lt;br/&gt;
drwxr-xr-x 2 mongo mongo   4.0K Aug  6 16:56 journal&lt;br/&gt;
-rwxr-xr-x 1 mongo mongo      6 Jul 18 13:27 mongod.lock&lt;br/&gt;
drwxr-xr-x 3 mongo mongo   4.0K Aug  6 16:56 _tmp&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /u0/mydb01/&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo  64M Aug  6 17:42 mydb01.0&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 128M Aug  6 14:05 mydb01.1&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 2.0G Aug  2 10:27 mydb01.10&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 2.0G Aug  6 02:10 mydb01.100&lt;br/&gt;
...&lt;/p&gt;

&lt;p&gt;&amp;gt; use mydb01&lt;br/&gt;
switched to db mydb01&lt;br/&gt;
&amp;gt; db.dropDatabase()&lt;/p&gt;
{ &quot;dropped&quot; : &quot;mydb01&quot;, &quot;ok&quot; : 1 }
&lt;p&gt;&amp;gt; db.mydb01.insert(&lt;/p&gt;
{&quot;a&quot;:&quot;b&quot;}
&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /var/mongo/data/&lt;br/&gt;
drwxr-xr-x 2 mongo mongo   4.0K May  9 14:17 mydb01 -&amp;gt; /u0/mydb01&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     34 May  9 14:17 mydb02 -&amp;gt; /u1/mydb02&lt;br/&gt;
lrwxrwxrwx 1 mongo mongo     32 May  9 14:17 mydb03 -&amp;gt; /u2/mydb03&lt;br/&gt;
drwxr-xr-x 2 mongo mongo   4.0K Aug  6 16:56 journal&lt;br/&gt;
-rwxr-xr-x 1 mongo mongo      6 Jul 18 13:27 mongod.lock&lt;br/&gt;
drwxr-xr-x 3 mongo mongo   4.0K Aug  6 16:56 _tmp&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;user@mongo ~&amp;#93;&lt;/span&gt;$ ls -lh /u0/mydb01/&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo  64M Aug  6 18:42 mydb01.0&lt;br/&gt;
&lt;del&gt;rw&lt;/del&gt;------ 1 mongo mongo 128M Aug  6 18:42 mydb01.1&lt;br/&gt;
drwxr-xr-x 3 mongo mongo 4.0K Aug  6 16:56 _tmp&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|hspdd3:</customfieldvalue>

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