Negative replicationLag?
Posted by:
Rui Mao
Date: August 15, 2023 06:59AM
The cluster.status() reported something like this.
{
"clusterName": "testCluster",
"defaultReplicaSet":
{
"name": "default",
"primary": "P1S2-DBC-01:3306",
"ssl": "REQUIRED",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology":
{
"P1S2-DBC-01:3306":
{
"address": "P1S2-DBC-01:3306",
"memberRole": "PRIMARY",
"mode": "R/W",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.0.33"
},
"P1S2-DBC-02:3306":
{
"address": "P1S2-DBC-02:3306",
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "applier_queue_applied",
"role": "HA",
"status": "ONLINE",
"version": "8.0.33"
},
"P1S2-DBC-03:3306":
{
"address": "P1S2-DBC-03:3306",
"memberRole": "SECONDARY",
"mode": "R/O",
"readReplicas": {},
"replicationLag": "-00:00:00.059837",
"role": "HA",
"status": "ONLINE",
"version": "8.0.33"
}
},
"topologyMode": "Single-Primary"
},
"groupInformationSourceMember": "P1S2-DBC-01:3306"
}
I don't understand why the lag could be a negative value? The replication slave finished the write operation before master?