[SERVER-47119] Config term does not get initialized until replSetReconfig is run Created: 25/Mar/20  Updated: 29/Oct/23  Resolved: 14/Apr/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.4.0-rc2, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: William Schultz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
Related
related to SERVER-46571 Shard server replica set nodes should... Closed
related to SERVER-45081 Increment the config term via reconfi... Closed
related to SERVER-47189 Do a safe reconfig to add config term... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Steps To Reproduce:

The following test passes:

(function() {
"use strict";
var rst = new ReplSetTest({nodes: 1});
rst.startSet();
rst.initiate();
var node = rst.getPrimary();
assert(!node.adminCommand({replSetGetConfig: 1}).config.hasOwnProperty("term"));
assert.commandWorked(node.adminCommand({replSetStepDown: 1, force: true}));
sleep(2000);
assert.commandWorked(node.adminCommand({replSetStepUp: 1}));
assert(!node.adminCommand({replSetGetConfig: 1}).config.hasOwnProperty("term"));
rst.stopSet();
})();

Sprint: Repl 2020-04-06, Repl 2020-04-20
Participants:
Linked BF Score: 50

 Description   

After SERVER-46571, the initial replica set config term is -1. The replica set config term only gets incremented on stepup if the config term is initialized. Thus the config term does not get initialized until the user runs a replSetReconfig command.



 Comments   
Comment by Githook User [ 14/Apr/20 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-47119 Initialize replica set shard server nodes without a ReplSetConfig term
Branch: v4.4
https://github.com/mongodb/mongo/commit/07e26ee1cff128157da69a3b722bdd8ef1159383

Comment by Githook User [ 14/Apr/20 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-47119 Revert SERVER-46571

This reverts commit a2eeeedb3e358f9a71042a2ff752b67844d4dcf7.
Branch: v4.4
https://github.com/mongodb/mongo/commit/26dbfa6c56ce5a4b80e1f57c906213956f8a2eff

Comment by Githook User [ 07/Apr/20 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-47119 Revert SERVER-46571

Replica set configs are now initialized with a term of 0 instead of -1.
Branch: master
https://github.com/mongodb/mongo/commit/5b77c10fd6f2240b2af49a261ccafa240c1c8eec

Comment by William Schultz (Inactive) [ 01/Apr/20 ]

Note that on the master branch, a revert of SERVER-46571 should be sufficient, whereas on v4.4 we will need to revert SERVER-46571 and also make sure that shard server nodes starting up in a downgraded FCV are initiated without a config term.

Comment by William Schultz (Inactive) [ 30/Mar/20 ]

To address the original bug tracked in BF-16416, I am planning to (1) revert the changes from SERVER-46571 and (2) remove the config term during replSetInitiate for shard servers as a part of this ticket. I have filed SERVER-47189 to track the separate issue about adding config terms after an upgrade.

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