[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:
Depends
Related
is related to SERVER-47062 Trigger hang analyzer for writeConcer... Closed
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: SERVER-55159: Avoid using assert.commandWorked() to wait for writeConcern in an assert.soon() loop
Branch: master
https://github.com/mongodb/mongo/commit/e793b3553802d1186e8b6f78ea193e0bcf5d1627

Generated at Thu Feb 08 05:35:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.