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

Invariant incorrectly with message stringifies its argument

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.9, 3.7.1
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Sprint:
      Repl 2018-01-01

      Description

      When testing an invariant with message by actually failing it, I noticed that the invariant includes the source code for the message expression rather than its contents:

      2017-12-15T13:35:44.594-0500 F -        [conn1] Invariant failure catalogColl->uuid() != uuid uuid + "," + catalogColl->uuid src/mongo/db/catalog/uuid_catalog.cpp 68
      

      This negates the objective of SERVER-31830, which was to print the actual variable contents. Also, rather than accepting a string, we probably should just accept arguments and dumping them as strings. Otherwise code use to build strings would be inactive untested code.

      As this ticket shows, untested inactive code is likely to contain bugs.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              benety.goh Benety Goh
              Reporter:
              geert.bosch Geert Bosch
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: