Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-14864

Don't log "filling with zeroes" when using fallocate() or sparse files

    • Minor Change
    • Server 2.7.6

      Currently when a datafile is allocated, the following messages are output:

      [FileAllocator] allocating new datafile /data/db/foo.0, filling with zeroes...
      [FileAllocator] done allocating datafile /data/db/foo.0, size: 16MB,  took 0.002 secs
      

      However, the first message is misleading and confusing when posix_fallocate() or sparse files are used. The existence of this message may cause users to mistakenly think that fallocate() or sparse files are not being used, and that mongod is actually writing zeroes to the file. (This is despite the immediately following line indicating that the file allocation was excessively fast - users may either not see this line, or not have the necessary knowledge or context to be able to determine (from the speed) whether or not fallocate() or sparse files were actually used.)

      Although in all three cases (manual zeroing, fallocate() and sparse files) the result is the same (a file full of zeroes), the log should only say that we are "filling with zeroes" when we actually write zeroes to the file. Even better would be to replace this part of the message with an indication of whether fallocate() or sparse files have been used.

        1. file_allocator.cpp
          15 kB
          Ankit Maheshwari

            Assignee:
            kevin.pulo@mongodb.com Kevin Pulo
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: