EventStore
EventStore copied to clipboard
A new node in a cluster can return 401 while it is catching up
Describe the bug When a node joins a cluster, it needs to chase the leader until it is caught up. It is possible that when a call is made to it, it does not have the user stream of the calling user.
To Reproduce Steps to reproduce the behavior:
- Start a Cluster
- Remove a Node
- Add a Fresh Node (e.g. with a mem db)
- Make a call that requires permissions (e.g. ReadAll)
Expected behavior 503 Service Unavailable
Actual behavior 401 Unauthorized
EventStore details
- EventStore server version: 20.6.x
I have experienced this when testing gossip in my scala client in a round robin manner when a node is about to start up - also mem db. Status code UNAVAILABLE
would be perfect as that is retriable.
Part of this should have been fixed by https://github.com/EventStore/EventStore/pull/3584 and https://github.com/EventStore/EventStore/pull/3609.
However, there could still be a problem getting 401s while catching up if the $users stream is updated on the Leader node (eg. a changed password), but that change hasn't yet been replicated to the Follower that you're reading from.