[SERVER-44503] Race in replsets/auth2.js Created: 08/Nov/19  Updated: 29/Oct/23  Resolved: 12/Nov/19

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.3.1, 4.2.3, 4.0.15

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
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Participants:
Linked BF Score: 20

 Description   

This test does:

1. start a 3-node set
2. configure key files on nodes 1 and 2 so node 0 gets auth errors in replSetHeartbeat
3. confirm node 0 goes into RECOVERING due to auth errs (SERVER-3715)
4. stop nodes 1 and 2
5. confirm node 0 goes into SECONDARY
6. restart nodes 1 and 2
7. stop node 0 <-- BF
8. more test operations....

Rarely, after nodes 1 and 2 are restarted in step 6, node 0 has time to heartbeat another node, get an auth error, and go from SECONDARY back to RECOVERING. As a result, when ReplSetTest tries to stop node 0 in step 7, it fails, because ReplSetTest's procedure for stopping a node includes validating collections, which does not work on a RECOVERING node.

If we stop node 0 before restarting nodes 1 and 2 that should fix the race.

I believe the test has had this bug since it was first written for MongoDB 2.2 and backported to 2.0.



 Comments   
Comment by Githook User [ 10/Jan/20 ]

Author:

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

Message: SERVER-44503 Fix race in replsets/auth2.js

(cherry picked from commit b526ac445bb0b39b53bd291ef6d23a73a38a1f11)
Branch: v4.2
https://github.com/mongodb/mongo/commit/205998b8e452cc18e27b9226d5b38f2fccaa02b8

Comment by Githook User [ 10/Jan/20 ]

Author:

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

Message: SERVER-44503 Fix race in replsets/auth2.js

(cherry picked from commit b526ac445bb0b39b53bd291ef6d23a73a38a1f11)
Branch: v4.0
https://github.com/mongodb/mongo/commit/4ae068133a41cec565e507006acd5f11a90564cf

Comment by A. Jesse Jiryu Davis [ 12/Nov/19 ]

I'm not requesting a backport since this failure seems remarkably rare and old branches have been reliable on Evergreen.

Comment by Githook User [ 12/Nov/19 ]

Author:

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

Message: SERVER-44503 Fix race in replsets/auth2.js
Branch: master
https://github.com/mongodb/mongo/commit/b526ac445bb0b39b53bd291ef6d23a73a38a1f11

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