Yes, but somehow my actual use-case is now working lol. I just do not know the drawback in this.
Here is my rs.status
{
set: 'repset',
date: ISODate("2023-04-26T08:03:44.377Z"),
myState: 2,
term: Long("6"),
syncSourceHost: '10.1.0.7:27017',
syncSourceId: 0,
heartbeatIntervalMillis: Long("2000"),
majorityVoteCount: 2,
writeMajorityCount: 2,
votingMembersCount: 2,
writableVotingMembersCount: 2,
optimes: {
lastCommittedOpTime: { ts: Timestamp({ t: 1682496214, i: 1 }), t: Long("6") },
lastCommittedWallTime: ISODate("2023-04-26T08:03:34.364Z"),
readConcernMajorityOpTime: { ts: Timestamp({ t: 1682496214, i: 1 }), t: Long("6") },
appliedOpTime: { ts: Timestamp({ t: 1682496224, i: 1 }), t: Long("6") },
durableOpTime: { ts: Timestamp({ t: 1682496224, i: 1 }), t: Long("6") },
lastAppliedWallTime: ISODate("2023-04-26T08:03:44.364Z"),
lastDurableWallTime: ISODate("2023-04-26T08:03:44.364Z")
},
lastStableRecoveryTimestamp: Timestamp({ t: 1682496184, i: 1 }),
electionParticipantMetrics: {
votedForCandidate: true,
electionTerm: Long("6"),
lastVoteDate: ISODate("2023-04-26T06:02:50.797Z"),
electionCandidateMemberId: 0,
voteReason: '',
lastAppliedOpTimeAtElection: { ts: Timestamp({ t: 1682488970, i: 1 }), t: Long("5") },
maxAppliedOpTimeInSet: { ts: Timestamp({ t: 1682488970, i: 1 }), t: Long("5") },
priorityAtElection: 1,
newTermStartDate: ISODate("2023-04-26T06:02:54.146Z"),
newTermAppliedDate: ISODate("2023-04-26T06:02:54.769Z")
},
members: [
{
_id: 0,
name: '10.1.0.7:27017',
health: 1,
state: 1,
stateStr: 'PRIMARY',
uptime: 19964,
optime: { ts: Timestamp({ t: 1682496214, i: 1 }), t: Long("6") },
optimeDurable: { ts: Timestamp({ t: 1682496214, i: 1 }), t: Long("6") },
optimeDate: ISODate("2023-04-26T08:03:34.000Z"),
optimeDurableDate: ISODate("2023-04-26T08:03:34.000Z"),
lastAppliedWallTime: ISODate("2023-04-26T08:03:34.364Z"),
lastDurableWallTime: ISODate("2023-04-26T08:03:34.364Z"),
lastHeartbeat: ISODate("2023-04-26T08:03:43.485Z"),
lastHeartbeatRecv: ISODate("2023-04-26T08:03:44.069Z"),
pingMs: Long("0"),
lastHeartbeatMessage: '',
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
electionTime: Timestamp({ t: 1682488970, i: 2 }),
electionDate: ISODate("2023-04-26T06:02:50.000Z"),
configVersion: 12,
configTerm: 6
},
{
_id: 1,
name: '10.1.0.8:27017',
health: 1,
state: 2,
stateStr: 'SECONDARY',
uptime: 20032,
optime: { ts: Timestamp({ t: 1682496224, i: 1 }), t: Long("6") },
optimeDate: ISODate("2023-04-26T08:03:44.000Z"),
lastAppliedWallTime: ISODate("2023-04-26T08:03:44.364Z"),
lastDurableWallTime: ISODate("2023-04-26T08:03:44.364Z"),
syncSourceHost: '10.1.0.7:27017',
syncSourceId: 0,
infoMessage: '',
configVersion: 12,
configTerm: 6,
self: true,
lastHeartbeatMessage: ''
},
{
_id: 2,
name: 'mongodb-1.com:27017',
health: 0,
state: 8,
stateStr: '(not reachable/healthy)',
uptime: 0,
optime: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDurable: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDate: ISODate("1970-01-01T00:00:00.000Z"),
optimeDurableDate: ISODate("1970-01-01T00:00:00.000Z"),
lastAppliedWallTime: ISODate("1970-01-01T00:00:00.000Z"),
lastDurableWallTime: ISODate("1970-01-01T00:00:00.000Z"),
lastHeartbeat: ISODate("2023-04-26T08:03:32.851Z"),
lastHeartbeatRecv: ISODate("1970-01-01T00:00:00.000Z"),
pingMs: Long("0"),
lastHeartbeatMessage: "Couldn't get a connection within the time limit",
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
configVersion: -1,
configTerm: -1
},
{
_id: 3,
name: 'mongodb-2.com:27017',
health: 0,
state: 8,
stateStr: '(not reachable/healthy)',
uptime: 0,
optime: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDurable: { ts: Timestamp({ t: 0, i: 0 }), t: Long("-1") },
optimeDate: ISODate("1970-01-01T00:00:00.000Z"),
optimeDurableDate: ISODate("1970-01-01T00:00:00.000Z"),
lastAppliedWallTime: ISODate("1970-01-01T00:00:00.000Z"),
lastDurableWallTime: ISODate("1970-01-01T00:00:00.000Z"),
lastHeartbeat: ISODate("2023-04-26T08:03:40.158Z"),
lastHeartbeatRecv: ISODate("1970-01-01T00:00:00.000Z"),
pingMs: Long("0"),
lastHeartbeatMessage: "Couldn't get a connection within the time limit",
syncSourceHost: '',
syncSourceId: -1,
infoMessage: '',
configVersion: -1,
configTerm: -1
}
],
ok: 1,
'$clusterTime': {
clusterTime: Timestamp({ t: 1682496224, i: 1 }),
signature: {
hash: Binary(Buffer.from("ccd6e271e288862a6e4176fdcfa5d1055cf169c2", "hex"), 0),
keyId: Long("7216257184332513282")
}
},
operationTime: Timestamp({ t: 1682496224, i: 1 })
}