Avoid using assert.commandWorked() to wait for writeConcern in an assert.soon() loop

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Repl 2021-03-22
    • 37
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It seems in _assertCommandWorked, which we call from assert.commandWorked, we handle writeConcern errors differently from other errors. If assert.commandWorked catches a writeConcern error, it will immediately run the hang analyzer and fail.

      As a result, we should not use assert.commandWorked while waiting for a writeConcern inside an assert.soon(), if our intention is to keep retrying the write with the specified writeConcern.

      This ticket will specifically fix this bug in user_defined_roles_on_secondaries.js, there may be other places where we try to do this.

            Assignee:
            Xuerui Fa
            Reporter:
            Xuerui Fa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: