Skip to content

admin: methods to select replicas for log stream #393

@ijsong

Description

@ijsong

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:

Metadata

Metadata

Assignees

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