Incorrect usage of fassertFailedNoTrace in OplogCapMaintainerThread

XMLWordPrintableJSON

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

      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 (Inactive)
            Reporter:
            Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: