In order to confirm the Mongo prealloc functionality
we did go through some tests in our environment and we are in need to
clarify the results which differ from the expected one. We disabled the
prealloc by setting noprealloc=true in config file and restarted the
server instance. Then we built a typical mongo DB(named sgserver) of
size 330 MB which should extend probably 3 db files
sgserver.0,sgserver.1, sgserver.2 with sizes 64MB, 128MB, 256MB
respectively with the namespace file sgserver.ns.
Conversely there are four db files have been created
sgserver.0,sgserver.1, sgserver.2, sgserver.3 with sizes 64MB, 128MB,
256MB, 512 MB respectively. Why preallocation happens even when
noprealloc is set true. How we calculated the db usage size is below.
DB Data size = datasize + totalindexsize = 330 MB
330 MB should be within the range of 3rd db files where the sum is 448 MB(64+128+256).
Also
we believed the fourth file with size(512MB) is an unused one we tried
deleted it and try to query the db through application. There is no
issue with mongod restart whereas we faced below error in querying. We
got this by enabling the logging.
Wed Jan 15 23:52:13.242 [conn23] error: getFile() called in a read lock, yet file to return is not yet open
Wed Jan 15 23:52:13.242 [conn23] getFile(3) _files.size:3 /home/MongoDB/MongoDB/srv/db/mongodb/sgserver.3
Wed Jan 15 23:52:13.242 [conn23] context ns: sgserver.
How we can find the unused file and how we can eradicate the above issues after deletion of those files?
Please throw some light on this. Awaiting for your reply.
Thanks & Regards,
Ratheesh R.