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

Check if object is empty instead of comparing to an empty object

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • ALL
    • Repl 2024-10-28

      In replsettest.js we compare `nodeOptions === {}` and `primaryOptions === {}`  with the intent to check if the variable is an empty object.
       
      Instead this compares references and will always return false.

      See: https://github.com/mongodb/mongo/blob/9427d2d01c6f1539bd48a83ec695752767859d08/jstests/libs/replsettest.js#L3485

      https://github.com/mongodb/mongo/blob/9427d2d01c6f1539bd48a83ec695752767859d08/jstests/libs/replsettest.js#L952

            Assignee:
            joy.wang@mongodb.com Joy Wang
            Reporter:
            adrian.gonzalez@mongodb.com Adrian Gonzalez Montemayor
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: