8000 Added code for assigning subcluster Ids and adding validations in initial placement by RiyaTyagi · Pull Request #4360 · m3db/m3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added code for assigning subcluster Ids and adding validations in initial placement #4360

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: sub-custer-4
Choose a base branch
from

Conversation

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

What this PR does / why we need it:

In this PR we create an initialPlacementHelper method which,

  • first assigns the subcluster ids to the instances
  • then create an empty initial placement and passes it to the newSubclusterHelper method where further calculations and validations gets executed.

The method to assign subcluster ids to the instances follows these steps:

  • Checks if instancesPerSubcluster parameter is set correctly.
  • Checks for the current placement and if the placement is not nil it find out the maximum SubclusterID within the placement along with the number of instances in the subcluster with maximum ID.
    • If the count of subcluster with maximum ID is < instancesPerSubcluster then we assign the maximumSubcluster ID to the instances till the count of instancesPerSubcluster is not reached.
    • else we start assigning the subcluster Ids greater than the max value to complete the count of instancesPerSubcluster.
  • If the current placement is nil, in case of initial placement, we start assigning the subcluster ID starting from 1 completing the instancesPerSubcluster for subclusters.

@RiyaTyagi RiyaTyagi marked this pull request as ready for review June 30, 2025 10:52
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.

1 participant
0