EventStore icon indicating copy to clipboard operation
EventStore copied to clipboard

A new node in a cluster can return 401 while it is catching up

Open thefringeninja opened this issue 4 years ago • 2 comments

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:

  1. Start a Cluster
  2. Remove a Node
  3. Add a Fresh Node (e.g. with a mem db)
  4. 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

thefringeninja avatar Aug 14 '20 12:08 thefringeninja

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.

ahjohannessen avatar Aug 14 '20 12:08 ahjohannessen

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.

hayley-jean avatar Dec 06 '22 11:12 hayley-jean