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

Enable computation of evenness score based on a preferred scoring key #2738

Merged

Conversation

csudharsanan
Copy link
Contributor

Issues

Description

  • Here are some details about my PR, including screenshots of any UI changes:

Currently, WAGED consider many capacity categories/dimensions such as CPU, Disk, etc for the placement decision evenness scores. In some use case, only one dimension is relevant because the clusters are provisioned based on that category. And, if evenness scores are not based on that then it introduces more shuffle/movements.

So, we would like to provide a way for users to specify a prioritized evennessScoringKey that will help computing scores based on that category only.

Tests

  • The following tests are written for this issue:
  1. TestClusterContext
  • testEstimateMaxUtilization
  1. TestMaxCapacityUsageInstanceConstraint
  • testGetNormalizedScoreWithPreferredScoringKey
  1. TestTopStateMaxCapacityUsageInstanceConstraint
  • testGetNormalizedScoreWithPreferredScoringKey
[INFO] Reactor Summary for Apache Helix 1.3.2-SNAPSHOT:
[INFO] 
[INFO] Apache Helix ....................................... SUCCESS [  1.573 s]
[INFO] Apache Helix :: Metrics Common ..................... SUCCESS [  0.432 s]
[INFO] Apache Helix :: Metadata Store Directory Common .... SUCCESS [  0.537 s]
[INFO] Apache Helix :: ZooKeeper API ...................... SUCCESS [  0.502 s]
[INFO] Apache Helix :: Helix Common ....................... SUCCESS [  0.312 s]
[INFO] Apache Helix :: Core ............................... SUCCESS [  0.417 s]
[INFO] Apache Helix :: Admin Webapp ....................... SUCCESS [  0.919 s]
[INFO] Apache Helix :: Restful Interface .................. SUCCESS [  1.260 s]
[INFO] Apache Helix :: Distributed Lock ................... SUCCESS [  0.292 s]
[INFO] Apache Helix :: HelixAgent ......................... SUCCESS [  0.260 s]
[INFO] Apache Helix :: Front End .......................... SUCCESS [  0.060 s]
[INFO] Apache Helix :: Recipes ............................ SUCCESS [  0.035 s]
[INFO] Apache Helix :: Recipes :: Rabbitmq Consumer Group . SUCCESS [  0.344 s]
[INFO] Apache Helix :: Recipes :: Rsync Replicated File Store SUCCESS [  0.299 s]
[INFO] Apache Helix :: Recipes :: distributed lock manager  SUCCESS [  0.277 s]
[INFO] Apache Helix :: Recipes :: distributed task execution SUCCESS [  0.288 s]
[INFO] Apache Helix :: Recipes :: service discovery ....... SUCCESS [  0.248 s]
[INFO] Apache Helix :: View Aggregator .................... SUCCESS [  0.304 s]
[INFO] Apache Helix :: Meta Client ........................ SUCCESS [  0.232 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12.373 s
[INFO] Finished at: 2024-01-16T13:52:48-08:00
[INFO] ------------------------------------------------------------------------

mvn test -o -Dtest=TestClusterContext -pl=helix-core


[INFO] Results:
[INFO] 
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jacoco:0.8.6:report (generate-code-coverage-report) @ helix-core ---
[INFO] Loading execution data file /Users/csudhars/Documents/GitHub/csudharsanan_helix/helix/helix-core/target/jacoco.exec
[INFO] Analyzed bundle 'Apache Helix :: Core' with 947 classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

mvn test -o -Dtest=TestMaxCapacityUsageInstanceConstraint -pl=helix-core

[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.534 s - in org.apache.helix.controller.rebalancer.waged.constraints.TestMaxCapacityUsageInstanceConstraint
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jacoco:0.8.6:report (generate-code-coverage-report) @ helix-core ---
[INFO] Loading execution data file /Users/csudhars/Documents/GitHub/csudharsanan_helix/helix/helix-core/target/jacoco.exec
[INFO] Analyzed bundle 'Apache Helix :: Core' with 947 classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

mvn test -o -Dtest=TestTopStateMaxCapacityUsageInstanceConstraint -pl=helix-core

[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.218 s - in org.apache.helix.controller.rebalancer.waged.constraints.TestTopStateMaxCapacityUsageInstanceConstraint
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jacoco:0.8.6:report (generate-code-coverage-report) @ helix-core ---
[INFO] Loading execution data file /Users/csudhars/Documents/GitHub/csudharsanan_helix/helix/helix-core/target/jacoco.exec
[INFO] Analyzed bundle 'Apache Helix :: Core' with 947 classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

Changes that Break Backward Compatibility (Optional)

  • My PR contains changes that break backward compatibility or previous assumptions for certain methods or API. They include:

(Consider including all behavior changes for public methods or API. Also include these changes in merge description so that other developers are aware of these changes. This allows them to make relevant code changes in feature branches accounting for the new method/API behavior.)

Documentation (Optional)

  • In case of new functionality, my PR adds documentation in the following wiki page:

(Link the GitHub wiki you added)

Commits

  • My commits all reference appropriate Apache Helix GitHub issues in their subject lines. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Code Quality

  • My diff has been formatted using helix-style.xml
    (helix-style-intellij.xml if IntelliJ IDE is used)

@csudharsanan csudharsanan force-pushed the csudhars/eveness-soft-constraint-eval branch from 809cb32 to 040e702 Compare January 17, 2024 20:42
Copy link
Contributor

@himanshukandwal himanshukandwal left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks Charanya!

@csudharsanan csudharsanan force-pushed the csudhars/eveness-soft-constraint-eval branch 3 times, most recently from ca6e2bc to 972ba64 Compare January 25, 2024 03:34
Copy link
Contributor

@zpinto zpinto left a comment

Choose a reason for hiding this comment

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

Overall LGTM 😁 Just had one question.

@csudharsanan csudharsanan force-pushed the csudhars/eveness-soft-constraint-eval branch from 972ba64 to c27a0c9 Compare January 25, 2024 19:30
Copy link
Contributor

@zpinto zpinto left a comment

Choose a reason for hiding this comment

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

LGTM, nice work!

@csudharsanan
Copy link
Contributor Author

csudharsanan commented Jan 26, 2024

This PR is ready to be merged.

Commit Message: This PR provides a way for users to specify a list of PreferredScoringKeys that will help in computing evenness scores based on the preferred capacity keys only.

@xyuanlu xyuanlu merged commit 86ee2c3 into apache:master Jan 27, 2024
2 checks passed
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.

5 participants