Invalid use of MS_ASYNC in msync() call

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • 3.3.2
    • Affects Version/s: None
    • Component/s: MMAPv1, Storage
    • None
    • Fully Compatible
    • ALL
    • Integration F (02/01/16), Integration 10 (02/22/16)
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I was taking a look through some old code momentarily today, and noticed an invalid use of msync(). I'm not sure how many people are using the old V1 storage implementation these days, but worth knowing about nonetheless.

      mongo/src/mongo/db/storage/mmap_v1/mmap_posix.cpp:271 calls msync() with an option to use MS_ASYNC or MS_SYNC based on the "bool sync" parameter.

      Unfortunately for everyone involved, MS_ASYNC is a no-op since the late 2.6 Linux days (as background sync is always enabled). So this doesn't expedite the process of flushing. Instead, the best option (if flushing is really that necessary under the async case) is probably to spawn a thread and perform the msync(MS_SYNC) there.

      Cheers!

      – Christian Hergert

              Assignee:
              Kyle Suarez (Inactive)
              Reporter:
              Christian Hergert
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: