-
Notifications
You must be signed in to change notification settings - Fork 464
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
base: master
Are you sure you want to change the base?
Conversation
|
||
// 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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"
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:
The placement object will have two new fields:
Similarly the Options interface will also have the same new methods/fields as placement to pass these values to the placement during Initial placement.