Skip to content

Support select replica with rich meta data #193

@sunxiaoguang

Description

@sunxiaoguang

Is your feature request related to a problem? Please describe.
Current ReplicaSelector interface pass Metapb.Peer to implementation which contains limited information for users to pick the peers to use. We want to select peers with rich meta data, for example the label of a peer, version of the instance or maybe the listening address however.

Describe the solution you'd like
Change ReplicaSelector to accept some types that provides rich meta data that users would like to use.

Describe alternatives you've considered
Let users get whatever meta data by themself with peer id which is available with current interface.

Additional context
We are implementing follower read to read followers from peers with certain label set. With placement rules, we can have some servers that run followers only therefore are safe to read from them without jeopardising online transactions.

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