[SERVER-14864] Don't log "filling with zeroes" when using fallocate() or sparse files Created: 12/Aug/14  Updated: 06/Dec/17  Resolved: 08/Jun/17

Status: Closed
Project: Core Server
Component/s: Logging, MMAPv1
Affects Version/s: None
Fix Version/s: 3.5.9

Type: Improvement Priority: Minor - P4
Reporter: Kevin Pulo Assignee: Kevin Pulo
Resolution: Done Votes: 2
Labels: community-team, mmapv1, polish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File file_allocator.cpp    
Backwards Compatibility: Minor Change
Sprint: Server 2.7.6
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 08/Jun/17 ]

Author:

{u'username': u'devkev', u'name': u'Kevin Pulo', u'email': u'kevin.pulo@mongodb.com'}

Message: SERVER-14864 refine mmapv1 file allocation logging
Branch: master
https://github.com/mongodb/mongo/commit/2179beff8f248ce78d2ce5e7952c8c74691c8afc

Comment by Ankit Maheshwari [ 10/Aug/15 ]

my bad, submitted https://github.com/mongodb/mongo/pull/1007 request for this bug.

Comment by Ankit Maheshwari [ 02/Aug/15 ]

I am not able to submit a pull request by:
git push -u origin SERVER-14864

How can I submit it ? I am also attaching the file I changed to fix the issue.

Thanks

Generated at Thu Feb 08 03:36:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.