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

Incorrect usage of fassertFailedNoTrace in OplogCapMaintainerThread

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: Storage
    • Fully Compatible
    • ALL
    • Execution Team 2022-07-11

      This line:

      fassertFailedNoTrace(!"unknown error in OplogCapMaintainerThread");
      

      is not how fassertFailedNoTrace is supposed to be used - it takes a unique error code. This code takes the address of the string literal (which will be non-zero), logically negates that (to get 0), and then passes that to fassertFailedNoTrace which will log the message:

      Fatal assertion 0 at src/mongo/db/storage/oplog_cap_maintainer_thread.cpp 90
      

      This is almost certainly not what was intended. I suspect it should be more like:

      LOGV2_FATAL_NOTRACE(5184100, "unknown error in OplogCapMaintainerThread");
      

            Assignee:
            leonardo.menti@mongodb.com Leonardo Menti (Inactive)
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: