KeyDB icon indicating copy to clipboard operation
KeyDB copied to clipboard

[BUG] Multi-Master Lost one Replication Node, Will Pending Client Connect Keydb Server

Open j13tw opened this issue 3 years ago • 0 comments

Describe the bug Close one of Master Node (Maybe Network Issue or Service Shutdown) for the Replication wait PING/PONG timeout (like repl-ping-replica-period 10) the others Node will show Unable to connect to MASTER: Resource temporarily unavailable for the issue, keydb server will check replica node, and the client will pending on connect server (about pending 10s) after reloading check replica node success, keydb can connect and access of standard performance but a few sewcond (about 5s), keydb server will reload check replica node again.

To reproduce

Build on kubernetes cluster, keydb with 3 replicas master server use the helm chart (0.32.1) to created, keydb image version is 6.2.1 Create the Multi-Master Replication (I also enable RDB) Replication Master connect with 3 Servers (include self)

  1. use redis-cli write to keydb with k8s service, within the while loop bash.
while true; do sleep 0.1 && redis-cli -h <your-ip> --user default --pass <passwd> --no-auth-warning set $(date +"%Y%m%d_%H%M%S.%3N") $(date +"%Y%m%d_%H%M%S.%3N") && echo $(date +"%Y%m%d_%T.%3N"); done
  1. scale the k8s statefulset replica: 3 -> 2 (keydb server will close one)
  2. log another keydb pod, will got Unable to connect to MASTER: Resource temporarily unavailable
  3. pod will got keydb interval loading check the losed replication node, and pending before Connecting to MASTER acm-keydb-2.acm-keydb-headless:6379,
  4. after the Connecting to MASTER acm-keydb-2.acm-keydb-headless:6379 throw, the client can access keydb a few second.
  5. the redis-cli write bash will pending for connection, and wait about 10s, it will can write, and looping the write / pending state.

Expected behavior

  1. I thing the keydb can lose some replica node, and also can working scable, or
  2. So, I want to know the all of replica node needed alive ?, or keydb have minmium alive node for replication setting (perhaps i not setting down), can tuning the minimium count of node.
  3. Face on this issue, I got the parameter min-replicas-to-write 3 in keydb.conf, but it seems like not working to slove this issue

Additional information

Kubernetes: v1.21.0 Keydb: 6.2.2 redis-cli: 6.2.6

j13tw avatar Jul 25 '22 05:07 j13tw