Skip to content
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

Constraints to de-prioritize nodes from becoming shard allocation targets #489

Closed
wants to merge 1 commit into from

Conversation

ashwinpankaj
Copy link
Contributor

Signed-off-by: Ashwin Pankaj appankaj@amazon.com

Description

An allocation constraint mechanism, that de-prioritizes nodes from getting picked for allocation if they breach certain constraints

Issues Resolved

#487

Check List

  • [x ] New functionality includes testing.
    • [x ] All tests pass
  • [x ] New functionality has been documented.
    • [x ] New functionality has javadoc added
  • [x ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…gets

Signed-off-by: Ashwin Pankaj <appankaj@amazon.com>
@odfe-release-bot
Copy link

✅   Gradle Wrapper Validation success 647f72a

@odfe-release-bot
Copy link

✅   DCO Check Passed 647f72a

@odfe-release-bot
Copy link

❌   Gradle Precommit failure 647f72a
Log 79

@peterzhuamazon
Copy link
Member

start gradle precommit
start dco check
start wrapper validation

@odfe-release-bot
Copy link

✅   DCO Check Passed 647f72a

@odfe-release-bot
Copy link

✅   Gradle Wrapper Validation success 647f72a

@peterzhuamazon
Copy link
Member

start gradle precommit

@odfe-release-bot
Copy link

❌   Gradle Precommit failure 647f72a
Log 249

Copy link
Member

@shwetathareja shwetathareja left a comment

Choose a reason for hiding this comment

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

did the first pass, pending tests review

@@ -204,14 +234,15 @@ public float getShardBalance() {
* </ul>
* <code>weight(node, index) = weight<sub>index</sub>(node, index) + weight<sub>node</sub>(node, index)</code>
*/
private static class WeightFunction {
public static class WeightFunction {
Copy link
Member

Choose a reason for hiding this comment

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

lets keep the class private along with its constructor or any method which has been changed to public

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was needed for tests - so we can have more scoped UTs that test the weight fn alone. Existing balancer tests always tested the full reroute path. We can explore if package private helps.

Copy link
Contributor

@itiyamas itiyamas left a comment

Choose a reason for hiding this comment

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

Have not reviewed the tests yet. It will be tricky to explain the new weight function now, especially with more constraints.

Copy link
Contributor

@vigyasharma vigyasharma left a comment

Choose a reason for hiding this comment

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

Thanks for merging this, @ashwinpankaj ! Good to see this make it upstream.

@@ -204,14 +234,15 @@ public float getShardBalance() {
* </ul>
* <code>weight(node, index) = weight<sub>index</sub>(node, index) + weight<sub>node</sub>(node, index)</code>
*/
private static class WeightFunction {
public static class WeightFunction {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was needed for tests - so we can have more scoped UTs that test the weight fn alone. Existing balancer tests always tested the full reroute path. We can explore if package private helps.

}

/**
* {@link ConstraintMode} values define possible modes in which allocation constraints can be enabled on
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove the ConstraintMode parameter, and always use it for unassigned shards only. That is, enabled would apply this to allocate unassigned operation, and disabled will turn this off.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@setiah
Copy link
Contributor

setiah commented May 25, 2021

@ashwinpankaj can we close this, since we have #680 ?

@ashwinpankaj
Copy link
Contributor Author

closed in favour of #680

ritty27 pushed a commit to ritty27/OpenSearch that referenced this pull request May 12, 2024
* fix: change int type to long

Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>

* update CHANGELOG.md

Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>

* fix: change totalDataSetSizeInBytes to Long too

Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>

* fix: skip removing opensearch-observability index in AfterTest cleanup

Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>

---------

Signed-off-by: Dominik Szczepanczyk <szczepanczyk.dominik@gmail.com>
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.

7 participants