<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 07:37:44 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>[DOCS-4] Recipe for pre-allocation of oplog produces inefficiency</title>
                <link>https://jira.mongodb.org/browse/DOCS-4</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;The manual page titled &quot;Halted Replication&quot; gives directions to manually pre-allocate the oplog files using a shell script. In my experience, following these directions produces 2GB of wasted space.&lt;/p&gt;

&lt;p&gt;I used the script to produce 13 2GB files, then started mongod using --oplogSize 26000, but then mongod created another 2GB file, consuming 28GB for a 26GB oplog.&lt;/p&gt;

&lt;p&gt;It would be nice if the recipe could be updated to correctly pre-generate the oplog files as mongodb would do if it generated them itself. Even better would be to add a feature to mongod to generate files for an empty oplog. e.g. mongod --generateOplogOnly --master --oplogSize 26000 --dbpath /data/prealloc would generate the files and then just exit. It may be possible to do this now (by leaving off generateOplogOnly), but my worry is that the generated files may have metadata in them (in particular the oplog.$main collection) which doesn&apos;t match the recommended procedure in the docs.&lt;/p&gt;

&lt;p&gt;Ultimately, the docs should reflect a procedure that allows for offline generation but ultimately produces the same outcome as if the server had been started with no oplog.&lt;/p&gt;</description>
                <environment></environment>
        <key id="16216">DOCS-4</key>
            <summary>Recipe for pre-allocation of oplog produces inefficiency</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="9">Done</resolution>
                                        <assignee username="kristina">Kristina Chodorow</assignee>
                                    <reporter username="jason.coombs@yougov.com">Jason R. Coombs</reporter>
                        <labels>
                    </labels>
                <created>Wed, 20 Apr 2011 17:39:19 +0000</created>
                <updated>Thu, 2 Feb 2012 16:56:08 +0000</updated>
                            <resolved>Thu, 2 Feb 2012 15:49:40 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="84618" author="kristina" created="Thu, 2 Feb 2012 16:56:07 +0000"  >&lt;p&gt;Sorry, missed that question.  &lt;/p&gt;

&lt;p&gt;The recipe will only generate local.ns.  I&apos;ve modified the page to add instructions to delete local.ns before moving the files.&lt;/p&gt;</comment>
                            <comment id="84604" author="jason.coombs@yougov.com" created="Thu, 2 Feb 2012 16:34:00 +0000"  >&lt;p&gt;My question remains. The recipe using mongodb to generate the oplogs will generate files in /tmp/local besides just local.*. I suspect if one tries to follow the steps, it will fail when it tries to move the *.ns files over the production *.ns files. Furthermore, if future versions of mongodb generate additional files in that directory, they will overwrite or fail. Probably the easiest fix is to update step 3 to read:&lt;/p&gt;

&lt;p&gt;{{{&lt;br/&gt;
Shut down the mongod master (kill -2) and then replace the oplog files:&lt;/p&gt;

&lt;p&gt;$ mv /data/db/local.* /safe/place&lt;br/&gt;
$ mv /tmp/local/local.* /data/db/&lt;br/&gt;
}}}&lt;/p&gt;
</comment>
                            <comment id="84573" author="samk" created="Thu, 2 Feb 2012 15:49:40 +0000"  >&lt;p&gt;It looks like this is resolved? &lt;/p&gt;

&lt;p&gt;Kristina, feel free to close, or assign back to me if more work is needed on this. &lt;/p&gt;</comment>
                            <comment id="50809" author="jason.coombs@yougov.com" created="Thu, 25 Aug 2011 22:37:45 +0000"  >&lt;p&gt;You&apos;re right. This appears to be resolved. I attempted to replicate my finding using MongoDB 1.8.1 and it behaves as expected (using the pre-allocated log files and not allocating additional).&lt;/p&gt;

&lt;p&gt;Thanks Kristina for making the change to the docs. One question, though: should the instructions instruct to delete the *.ns files before copying to the production directory? &lt;/p&gt;</comment>
                            <comment id="50790" author="kristina" created="Thu, 25 Aug 2011 21:28:28 +0000"  >&lt;p&gt;I can&apos;t reproduce, what version of the server is this on? &lt;/p&gt;

&lt;p&gt;I get:&lt;/p&gt;

&lt;p&gt;Thu Aug 25 17:23:43 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; ******&lt;br/&gt;
Thu Aug 25 17:23:43 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; creating replication oplog of size: 26000MB...&lt;br/&gt;
Thu Aug 25 17:23:43 &lt;span class=&quot;error&quot;&gt;&amp;#91;FileAllocator&amp;#93;&lt;/span&gt; allocating new datafile /dbpath/local.ns, filling with zeroes...&lt;br/&gt;
Thu Aug 25 17:23:43 &lt;span class=&quot;error&quot;&gt;&amp;#91;FileAllocator&amp;#93;&lt;/span&gt; done allocating datafile /dbpath/local.ns, size: 16MB,  took 0 secs&lt;br/&gt;
Thu Aug 25 17:23:43 &lt;span class=&quot;error&quot;&gt;&amp;#91;initandlisten&amp;#93;&lt;/span&gt; ******&lt;/p&gt;

&lt;p&gt;Doing an ls on the dbpath showed that it did not allocate any extra files.&lt;/p&gt;

&lt;p&gt;You can start with --oplogSize=whatever --dbpath=/tmppath --port=some-other-port to prealloc, I&apos;ll add that to the docs.&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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 25 Aug 2011 21:28:28 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 2 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>jason.coombs@yougov.com</customfieldvalue>
            <customfieldvalue>kristina</customfieldvalue>
            <customfieldvalue>sam.kleinman</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrsjxr:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>24161</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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrynif:</customfieldvalue>

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