[SERVER-4908] FileAllocator seems to take database lock. Is this needed? Created: 08/Feb/12  Updated: 29/Feb/12  Resolved: 09/Feb/12

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.0.2
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Hitoshi Asai Assignee: Unassigned
Resolution: Done Votes: 0
Labels: FileAllocator, lock
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

centos 5.6, 64bit, use 3 node replica, non sharding


Participants:

 Description   

When FileAllocator worked, the whole of database seems to be locked during allocating physical data file.
The following log was written.

[FileAllocator] done allocating datafile /data/mongo/data/hoge1.5, size: 2047MB, took 21.081 secs

On this time, read/write operation was queued and timed out.
To avoid request timeout, we tried pre-preallocation by the following procedure.

1. creating database and collection at mongo console.
2. creating ".n" files and filling with zero.
3. creating large collection and confirm that FileAllocator did not create files and no request timeout occurred.

That is worked fine.
If possible, make FileAllocator free from locking.



 Comments   
Comment by Hitoshi Asai [ 09/Feb/12 ]

our system uses ext3 and inserts data faster than pre-allocation finishes.
we will try to use ext4.
thanks a lot!

Comment by Eliot Horowitz (Inactive) [ 09/Feb/12 ]

background file allocation is done without any lock

if you are inserting data faster than pre-allocation can keep up, then there can be a pause if you need a new file to insert data.

if allocation is taking that long - you probably are not a new enough file system. try xfs or ext4.

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