[SERVER-12395] Add unique value to MongoFile for uniqueness check for msync() Created: 17/Jan/14  Updated: 11/Jul/16  Resolved: 17/Jan/14

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

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Eric Milkie
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

We msync() without the MongoFiles lock, so it's possible for things to be closed out from under us. When msync() fails, we go to check to see if our MongoFile is still valid and if not, we ignore the msync error.
The way we check if the file is still valid is by checking to see if the pointer value still exists in the std::set of MongoFiles. This check is flawed because it's possible to have a MongoFile be destroyed and then have a new one created with the same address.
To ensure MongoFile uniqueness, we can embed a unique value (by using an AtomicInt counter) that we can use to compare.



 Comments   
Comment by Githook User [ 17/Jan/14 ]

Author:

{u'username': u'milkie', u'name': u'Eric Milkie', u'email': u'milkie@10gen.com'}

Message: SERVER-12395 add unique id and check when msync fails
Branch: master
https://github.com/mongodb/mongo/commit/7af069e5ac40a7b7a5324124e66a82d16d30e9b5

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