atomix / copycat

A novel implementation of the Raft consensus algorithm

Home Page:http://atomix.io/copycat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Race at client connection can lead to invalid client vs cluster state

thiagoss opened this issue · comments

A client can try to reconnect to the cluster after a disconnection/timeout and it might lead to an inconsistent state:

  1. Client tries to connect to Server A and times out
  2. Client tries to connect to Server B and succeeds
  3. It is published that Client is connected to Server B
  4. The first attempt at 1 finishes its process and it is published that Client is connected to Server A

In the end, the Client will be connected to Server B but the cluster thinks it is connected to Server A. So no information about the events or replies to queries will ever be sent to the Client because Server B that is responsible for it has no connection. I have logs in case it is needed to confirm the issue.