Skip to content

SentinelConnect - Primary check not working when user isn't allowed to execute ROLE #3064

@scorchedSun

Description

@scorchedSun

Hi,

I'm trying to use StackExchange.Redis to connect to a Valkey instance via Sentinel. Our organization doesn't allow the user to run the ROLE command, leading to the following line to result in an exception:

if (connection.GetServer(newPrimaryEndPoint)?.Role()?.Value == RedisLiterals.master)

There was an issue in 2023 where a change for this was suggested by @NickCraver: #2461

if (connection.GetServer(newPrimaryEndPoint)?.IsReplica == false)

I tested this change with my configuration and it worked pretty well.

Is there any chance in adding this change after all this time? I would have opened a PR but don't want to take credit for something I didn't come up with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions