-
Notifications
You must be signed in to change notification settings - Fork 7
admin: methods to select replicas for log stream #393
Copy link
Copy link
Closed
Description
When the admin makes a log stream, it can select replicas automatically if a client does not send the log stream's topology. The admin provides the interface ReplicaSelector to support various methods of choosing replicas.
// ReplicaSelector selects storage nodes and volumes to store data for replicas of a new log stream.
// This method returns a slice of `varlogpb.ReplicaDescriptor`, and its length should be equal to the
// replication factor.
type ReplicaSelector interface {
Select(ctx context.Context) ([]*varlogpb.ReplicaDescriptor, error)
}Currently, the admin provides balancedReplicaSelector, which implements ReplicaSelector; however, it does not work well because it is unnecessarily too complex. Therefore we have to revisit it.
Goals:
- Pluggable replica selection algorithm
- Override mechanism to replace global algorithm with a topic-specific algorithm
- Call-specific algorithm
Implementation plan:
- Add a method
Nameto theReplicaSelectorinterface, which returns a unique name of each replica selector. The name can define the replica selector that the admin server uses. feat(admin): add a name to the replica selector #394 - Add a new replica selector,
random. When there are many storage nodes, replicas of a log stream can be chosen randomly. feat(admin): random replica selector #395 - Refactor or rework existing replica selector,
balancedReplicaSelector. It will deploy replicas across storage nodes to balance the number of replicas per storage node and the number of primary replicas per storage node. feat(admin): LFU replica selector #396 - Add a flag to specify the global default replica selector. feat(admin): add a new flag
replica-selectorto the varlogadm #402 - Add a property to the topic that specifies the default replica selector.
- Add a call option to the AddLogStream, which specifies a replica selector for the call.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels