[SERVER-10516] mongod crashes when re-mapping above user address space of 8TB on Windows Created: 14/Aug/13  Updated: 11/Jul/16  Resolved: 08/May/14

Status: Closed
Project: Core Server
Component/s: Stability
Affects Version/s: None
Fix Version/s: 2.7.1

Type: Bug Priority: Critical - P2
Reporter: Sridhar Nanjundeswaran Assignee: Mark Benvenuto
Resolution: Done Votes: 2
Labels: cap-ticket-needed
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB x64 on Windows 7


Issue Links:
Depends
Duplicate
is duplicated by SERVER-6954 FlushViewOfFile with error 487 when t... Closed
Related
related to SERVER-14840 FAssert on windows after long running... Closed
is related to SERVER-2942 MapViewOfFileEx failed during large i... Closed
Tested
Operating System: Windows
Steps To Reproduce:

on a new mongod instance, create a capped collection of 2GB.

> use test
> db.createCollection("foo", {capped:true,size:2*1024*1024*1024})

Now in a loop unmap and remap the database

> for (i=0;i<1000;i++) {
... db.adminCommand("closeAllDatabases");
... db.foo.findOne()
... }

Sprint: Server 2.7.1
Participants:

 Description   

When memory mapping on Windows mongod keeps track of the address to start the mapping at (adjusting by file size on every map). Since this is an always incrementing number mongod crashes with the above error when it hits the upper bound of user address space of 8TB (http://blogs.technet.com/b/markrussinovich/archive/2008/11/17/3155406.aspx). Modifying the code to print the virtual address we are trying to map to, we get

Wed Aug 14 14:27:55.390 [conn1] MapViewOfFileEx for c:\data\db\test.0 failed with errno:487 Attempt to access invalid address. (file size is 2146435072) in MemoryMappedFile::map (for address 000007FED7000000)



 Comments   
Comment by Githook User [ 08/May/14 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-10516: Mitigate invalid address errors for MapViewOfFileEx
Branch: master
https://github.com/mongodb/mongo/commit/0205239ecb579e20b05cee3a0df394eb11ba14ce

Comment by Miron Jakubowski [ 29/Apr/14 ]

@dwight our mongo db process is running on Windows Server 2012 Datacenter, so it gives us 8TB virtual memory. When process is restarted it is working till first query is being executed.

Comment by Dwight Merriman [ 28/Apr/14 ]

this page suggests one might be able to go up to 128TB virtual with Windows Server 2012 R2:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778(v=vs.85).aspx

but divide that # in two, the way the storage engine works with journaling, and then also factor in the issue mentioned above in this ticket. But you might get farther with 2012R2 than anything else.

Comment by Dwight Merriman [ 28/Apr/14 ]

@miron does it work for a while and then start crashing? if so restarting the mongod process periodically might help. linux would presumably resolve it. there is a bug here to be fixed but it looks like based on the link that some versions of windows server the actual virtual limit is somewhat small. what version of windows are you using?

Comment by Miron Jakubowski [ 29/Mar/14 ]

hi, is there is any workaround to this isssue? or just move mongo do linux? we have 2,3TB database and on windows mongo is crashing when invoking any query

Comment by Dwight Merriman [ 16/Aug/13 ]

i'll take a look.

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