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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.5
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: