Skip to content

PreferSlave seems not honored after cache failover #1077

@VicaryM

Description

@VicaryM

We set up a redis shard with 1 Primary and 2 ReadReplicas.
And we specified CommandFlags.PreferSlave to prefer read from ReadReplica.
So initially we had 001 (Primary - no reads), 002 (ReadReplica - getting half of the reads), 003 (ReadReplica - getting half of the reads). All as expected.
Then we did a failover of 001. After that:
001 (no reads), 002 (getting all the reads), 003 (no reads).
Base on aws log, 002 becomes primary.
Why 002 is getting all the reads after the failover? We expect the two ReadReplicas (001 and 003) should share the reads as we specified PreferSlave.

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