Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-4

Recipe for pre-allocation of oplog produces inefficiency

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      The manual page titled "Halted Replication" gives directions to manually pre-allocate the oplog files using a shell script. In my experience, following these directions produces 2GB of wasted space.

      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.

      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't match the recommended procedure in the docs.

      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.

            Assignee:
            kristina Kristina Chodorow (Inactive)
            Reporter:
            jason.coombs@yougov.com Jason R. Coombs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              12 years, 13 weeks, 6 days ago