removeUnneededJournalFiles assumes journal files exist, causing spurious warnings

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.5.4
    • Component/s: MMAPv1, Storage
    • Storage Execution
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      For files that are eligible, dur::Journal::removeUnneededJournalFiles() calls removeOldJournalFile to recycle/remove the journal file.

      However, in the meantime, another thread may have already done this, via dropDatabase or fsyncLock, both of which call

      • syncDataAndTruncateJournal
      • journalCleanup
      • Journal::cleanup
      • removeJournalFiles

      This causes removeOldJournalFile to spuriously complain about the missing journal file when it tries to rename/remove it, falsely suggesting that the journal file has been prematurely removed (either by mongod or by something else).

      A quick fix would be for removeOldJournalFile to simply check that the given path exists and short circuit return if not. That will still leave a brief TOCTTOU race, so it might be better to figure out a real/more appropriate fix.

              Assignee:
              [DO NOT USE] Backlog - Storage Execution Team
              Reporter:
              Kevin Pulo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: