[SERVER-47348] Require configTerm in replSetHeartbeat request and response Created: 06/Apr/20  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Backlog - Replication Team
Resolution: Unresolved Votes: 0
Labels: former-quick-wins, safe-reconfig-related
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-47211 Remove 4.2 style reconfig behavior on... Closed
is related to SERVER-45082 Secondaries only learn configs with h... Closed
Assigned Teams:
Replication
Sprint: Repl 2020-05-04
Participants:

 Description   

"configTerm" was added to the replSetHeartbeat request and response in 4.4 (SERVER-45082), but for compatibility, ReplSetHeartbeatArgsV1::initialize and ReplSetHeartbeatResponse::initialize do not require it. In 4.6, we know the field must be present, so require it.



 Comments   
Comment by William Schultz (Inactive) [ 05/May/20 ]

As discussed, we can't fully require config term until 4.8, when we know we will never be missing a config term field on heartbeat requests or responses.

Comment by Siyuan Zhou [ 05/May/20 ]

Good point, william.schultz. I agreed. I think it makes sense to always attach configTerm in heartbeat responses in 4.6.

Comment by A. Jesse Jiryu Davis [ 04/May/20 ]

Oh, I think that sounds right to me, and it's certainly harmless to put this off for a version. Good catch.

Comment by William Schultz (Inactive) [ 04/May/20 ]

After looking at this some more, I actually don't think we can require 'configTerm' on heartbeat requests and responses yet in 4.6. In 4.4, FCV=4.4, there are still cases where we don't attach a configTerm to heartbeats. ReplSetHeartbeatResponse and ReplSetHeartbeatArgsV1 both omit a 'configTerm' field from their BSON objects if the term is uninitialized (-1). This is not gated by FCV, so it's possible that in a mixed version 4.4/4.6 replica set some heartbeat messages won't have a configTerm. If I recall correctly we avoided FCV gating this to support communication with arbiters.

In SERVER-47211, we already made it so that we always attach configTerm on heartbeat requests, and we could do the same for heartbeat responses in this ticket. That would mean we could officially require configTerm on heartbeats in version 4.8. jesse does this sound accurate to you?

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