[SERVER-48712] Race in write_concern_after_stepdown.js Created: 11/Jun/20  Updated: 29/Oct/23  Resolved: 11/Jun/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.2.9, 4.4.1, 4.7.0

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-48250 Wait for hang in majority write befor... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2
Participants:
Linked BF Score: 32

 Description   

We expect the parallel shell to begin a w: majority write on Node 0, while Node 0 is primary and replication is blocked. Then Node 0 steps down and the parallel shell expects to receive PrimarySteppedDown.

In fact, the parallel shell took a long time to begin. It finally connected after Node 0 had already stepped down. When it began its w: majority write it received

w:majority write replied: {
  "ok" : 0,
  "errmsg" : "not master",
  "code" : 10107,
  "codeName" : "NotMaster"
}

This is not a "write error" but a generic command failure, so when the shell calls assert.writeErrorWithCode it logs unhelpfully:

assert: found code(s) [ ] does not match any of the expecte d codes [ 189, 11602 ]



 Comments   
Comment by Githook User [ 04/Aug/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48712 Race in write_concern_after_stepdown.js

(cherry picked from commit 351ec9947164cd78c8f003e972ba5d71f6438b53)
Branch: v4.4
https://github.com/mongodb/mongo/commit/cd8324afbe50240fe47db8b19d916ab8fdcbab23

Comment by Githook User [ 24/Jun/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48712 Race in write_concern_after_stepdown.js

(cherry picked from commit 351ec9947164cd78c8f003e972ba5d71f6438b53)
Branch: v4.2
https://github.com/mongodb/mongo/commit/f8e35f0b44a14051eae4abb61115b106f7cc3e2a

Comment by A. Jesse Jiryu Davis [ 11/Jun/20 ]

Requesting backports to 4.4 and 4.2, because that's what we did for the very similar SERVER-48250 .

Comment by Githook User [ 11/Jun/20 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-48712 Race in write_concern_after_stepdown.js
Branch: master
https://github.com/mongodb/mongo/commit/351ec9947164cd78c8f003e972ba5d71f6438b53

Comment by A. Jesse Jiryu Davis [ 11/Jun/20 ]

Same bug, different test: SERVER-48250.

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