8000 Changed the interface of placement objects to include subcluster information by RiyaTyagi · Pull Request #4355 · m3db/m3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Changed the interface of placement objects to include subcluster information #4355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RiyaTyagi
Copy link
Collaborator
@RiyaTyagi RiyaTyagi commented Jun 27, 2025

What this PR does / why we need it:

With this stack we are introducing the concept of sub-clusters within a cluster's placement. The instances in the placement will be divided into sub-clusters and each sub-cluster will have the ownership of some shards that are assigned to it.

The sub-clustered placement will have the property of instances per sub-cluster (multiple of replication factor), and all the replicas of the shard assigned to a sub-cluster will be distributed among the instances in the sub-cluster. This will reduce the probability of any two nodes going down in the cluster to causing a write outage.

This PR changes the proto file, placement interface, Instance interface, corresponding mocks and implementation. Fixes of unit test affected by new fields have also been changed.

Each Instance will now have one more field:

  • SubclusterID - This is the ID of the sub-cluster that the instance belongs to. How this ID will be assigned has been covered in further PRs. the default value of subclusterID will be 0 when the subclusters are not enabled in the placement.

The placement object will have two new fields:

  • HasSubclusters - A boolean value to which determines whether the placement is subclustered or not.
  • InstancesPerSubcluster - An integer value which represents the number of instances in a subcluster. This field will be a multiple of replication factor.

Similarly the Options interface will also have the same new methods/fields as placement to pass these values to the placement during Initial placement.


// BySubClusterIDInstanceID is a type that implements sort.Interface for a slice of placement.Instance
// It sorts instances first by subcluster ID, then by instance ID within each subcluster
type BySubClusterIDInstanceID []Instance

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for simplicity should we rename it to "BySubClusterIDThenInstanceID"

maxShardSetID uint32
isSharded bool
isMirrored bool
hasSubClusters bool

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename this to "isSubClusteringEnabled" or some 7686 thing similar which aligns more with the existing variables like "isSharded" and "isMirrored"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0