[SERVER-29946] Increase heartbeat rate when a secondary has no sync source Created: 30/Jun/17  Updated: 30/Oct/23  Resolved: 21/Nov/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.6.4, 3.7.1

Type: Bug Priority: Major - P3
Reporter: Siyuan Zhou Assignee: Siyuan Zhou
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
is duplicated by SERVER-21702 Ensure heartbeats are frequent enough... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6, v3.4
Sprint: Repl 2017-12-04
Participants:
Linked BF Score: 0

 Description   

SERVER-19898 tried to do the same thing, but it actually did the opposite. min(_rsConfig.getElectionTimeoutPeriod() / 2, _rsConfig.getHeartbeatInterval() / 4) could be a reasonable heartbeat rate - 500ms by default.

    // Arbiters also use half the election timeout period for their heartbeat frequency
    Milliseconds heartbeatInterval;
    if (_rsConfig.getProtocolVersion() == 1 &&
        (getMemberState().arbiter() || (getSyncSourceAddress().empty() && !_iAmPrimary()))) {
        heartbeatInterval = _rsConfig.getElectionTimeoutPeriod() / 2;   // 5 seconds by default.
    } else {
        heartbeatInterval = _rsConfig.getHeartbeatInterval();   // 2 seconds by default.
    }



 Comments   
Comment by Githook User [ 23/Feb/18 ]

Author:

{'email': 'siyuan.zhou@mongodb.com', 'name': 'Siyuan Zhou', 'username': 'visualzhou'}

Message: SERVER-29946 Increase heartbeat rate when a secondary has no sync source

(cherry picked from commit 630c282a2aecf4c1d2bf058e150e7fa0d3699699)
Branch: v3.6
https://github.com/mongodb/mongo/commit/6dea955e444528489180a730cd7dd40db420d228

Comment by Siyuan Zhou [ 21/Nov/17 ]

It would be nice to backport this ticket to 3.6 and 3.4 but not urgent.

Comment by Githook User [ 21/Nov/17 ]

Author:

{'name': 'Siyuan Zhou', 'username': 'visualzhou', 'email': 'siyuan.zhou@mongodb.com'}

Message: SERVER-29946 Increase heartbeat rate when a secondary has no sync source
Branch: master
https://github.com/mongodb/mongo/commit/630c282a2aecf4c1d2bf058e150e7fa0d3699699

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