Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12395

Add unique value to MongoFile for uniqueness check for msync()

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL

      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.

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: