MySQL Operator / MySQL InnoDB Cluster - Node lagging behind - election process

36 Views Asked by At

After deploying InnoDB Cluster with MySQL version 8.0.33 via MySQL Operator i was trying to understand if a node that is lagging could be elected as Primary.

{
    "clusterName": "mysql",
    "defaultReplicaSet": {
        "name": "default",
        "primary": "mysql-2.mysql-instances.mysql.svc.cluster.local:3306",
        "ssl": "REQUIRED",
        "status": "OK",
        "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
        "topology": {
            "mysql-0.mysql-instances.mysql.svc.cluster.local:3306": {
                "address": "mysql-0.mysql-instances.mysql.svc.cluster.local:3306",
                "memberRole": "SECONDARY",
                "mode": "R/O",
                "readReplicas": {},
                "replicationLag": "00:05:34.192010",
                "role": "HA",
                "status": "ONLINE",
                "version": "8.0.33"
            },
            "mysql-1.mysql-instances.mysql.svc.cluster.local:3306": {
                "address": "mysql-1.mysql-instances.mysql.svc.cluster.local:3306",
                "memberRole": "SECONDARY",
                "mode": "R/O",
                "readReplicas": {},
                "replicationLag": "applier_queue_applied",
                "role": "HA",
                "status": "ONLINE",
                "version": "8.0.33"
            },
            "mysql-2.mysql-instances.mysql.svc.cluster.local:3306": {
                "address": "mysql-2.mysql-instances.mysql.svc.cluster.local:3306",
                "memberRole": "PRIMARY",
                "mode": "R/W",
                "readReplicas": {},
                "replicationLag": "applier_queue_applied",
                "role": "HA",
                "status": "ONLINE",
                "version": "8.0.33"
            }
        },
        "topologyMode": "Single-Primary"
    },
    "groupInformationSourceMember": "mysql-2.mysql-instances.mysql.svc.cluster.local:3306"
}

The documentation i found, don't state that lagging behind will prevent a node to be used as primary, something that can be critical in many use cases, can you please confirm if my understanding is correct?

For me makes since to at least be able to configure the behaviour of a lagging node if should be consider in Primary election or not, basically a threshold after which the node would not be participating in Primary election, but not sure if such thing is possible.

Thanks

I tried to delete the pods to see if mysql-0 would be elected to primary, but wasn't able to see logs or evidences that mysql-0 was not the chosen by chance or intentionally

0

There are 0 best solutions below