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

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

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

      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@mongodb.com Xuerui Fa
            Reporter:
            xuerui.fa@mongodb.com Xuerui Fa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: