Ericsson / ered

An Erlang client library for Valkey/Redis Cluster
MIT License
16 stars 8 forks source link

Update slotmap immediately when a connection is lost #35

Closed zuiderkwast closed 1 year ago

zuiderkwast commented 1 year ago

The purpose is to detect the scenario that a failover has happened and the connection to the old master (now replica or no longer part of the cluster) doesn't necessarily mean that we have lost the connection to a master.

Thus we postpone signaling cluster_not_ok until the node down timeout has fired. This also means that reconnect failures don't immediately trigger cluster_not_ok.

A few test cases are affected by this change. Additionally some refactoring of test code is done to be able to reuse parts of it.