[SERVER-55159] Avoid using assert.commandWorked() to wait for writeConcern in an assert.soon() loop Created: 11/Mar/21 Updated: 29/Oct/23 Resolved: 12/Mar/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.9.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Xuerui Fa | Assignee: | Xuerui Fa |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Repl 2021-03-22 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 37 | ||||||||||||
| Description |
|
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. |
| Comments |
| Comment by Githook User [ 12/Mar/21 ] |
|
Author: {'name': 'XueruiFa', 'email': 'xuerui.fa@mongodb.com', 'username': 'XueruiFa'}Message: |