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

removeUnneededJournalFiles assumes journal files exist, causing spurious warnings

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

      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:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: