-
Notifications
You must be signed in to change notification settings - Fork 113
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
Replica Count Validation when awareness replica balance is enabled #429
Conversation
@bowenlan-amzn : This change depends on ongoing changes in OpenSearch . Is there a mechanism to run integ tests with local opensearch zip ? I did try copying over the zip to |
Didn't try to do such thing before. I think @saratvemulapalli may know the way to do this. |
@gbbafna sure. Yeah you should be able to run via custom distribution.
Take a look at: https://github.com/opensearch-project/opensearch-plugins/blob/main/TESTING.md#distribution-download-plugin |
OpenSearch changes are merged. We can trigger rerun of the jobs once we have a snapshot build available . |
@bowenlan-amzn : can you take a cursory look at the PR, while i try to fix the build issues ? @saratvemulapalli : The opensearch changes are merged into main as well as |
states = states | ||
) | ||
Assert.assertThrows( | ||
ResponseException::class.java |
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.
nit: better if we can check the validation error message
@gbbafna Hmm what are you really looking for ? |
After the plugin changes to consume 2.2 snapshot is available , the gradle workflow should pass. By the way, shouldn't the plugin use |
@gbbafna you are correct. As soon as the version is released there shouldn't be any development on that version. |
Signed-off-by: Ashish Agrawal <[email protected]>
Signed-off-by: Gaurav Bafna <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #429 +/- ##
============================================
+ Coverage 75.76% 75.94% +0.18%
- Complexity 2470 2474 +4
============================================
Files 314 314
Lines 14440 14454 +14
Branches 2233 2235 +2
============================================
+ Hits 10940 10977 +37
+ Misses 2255 2230 -25
- Partials 1245 1247 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
} | ||
} | ||
} | ||
|
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.
To keep coding style consistency, we can write this method as:
private fun validate() {
request.policy.states.forEach { state ->
state.actions.forEach { action ->
if (action is ReplicaCountAction ) {
val error = awarenessReplicaBalance.validate(action.numOfReplicas)
if (error.isPresent) {
val ex = ValidationException()
ex.addValidationError(error.get())
actionListener.onFailure(ex)
}
}
}
}
}
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.
Thanks, done.
Signed-off-by: Gaurav Bafna <[email protected]>
) * bump version to 2.2 (#446) Signed-off-by: Ashish Agrawal <[email protected]> * Replica Count validation when awareness replica balance is enabled Signed-off-by: Gaurav Bafna <[email protected]> * Addressing PR comments Signed-off-by: Gaurav Bafna <[email protected]> Signed-off-by: Ashish Agrawal <[email protected]> Signed-off-by: Gaurav Bafna <[email protected]> Co-authored-by: Ashish Agrawal <[email protected]> (cherry picked from commit f64c0c7)
) (#463) * bump version to 2.2 (#446) Signed-off-by: Ashish Agrawal <[email protected]> * Replica Count validation when awareness replica balance is enabled Signed-off-by: Gaurav Bafna <[email protected]> * Addressing PR comments Signed-off-by: Gaurav Bafna <[email protected]> Signed-off-by: Ashish Agrawal <[email protected]> Signed-off-by: Gaurav Bafna <[email protected]> Co-authored-by: Ashish Agrawal <[email protected]> (cherry picked from commit f64c0c7) Co-authored-by: Gaurav Bafna <[email protected]>
…pensearch-project#429) (opensearch-project#463) * bump version to 2.2 (opensearch-project#446) Signed-off-by: Ashish Agrawal <[email protected]> * Replica Count validation when awareness replica balance is enabled Signed-off-by: Gaurav Bafna <[email protected]> * Addressing PR comments Signed-off-by: Gaurav Bafna <[email protected]> Signed-off-by: Ashish Agrawal <[email protected]> Signed-off-by: Gaurav Bafna <[email protected]> Co-authored-by: Ashish Agrawal <[email protected]> (cherry picked from commit f64c0c7) Co-authored-by: Gaurav Bafna <[email protected]> Signed-off-by: Angie Zhang <[email protected]>
…pensearch-project#429) (opensearch-project#463) * bump version to 2.2 (opensearch-project#446) Signed-off-by: Ashish Agrawal <[email protected]> * Replica Count validation when awareness replica balance is enabled Signed-off-by: Gaurav Bafna <[email protected]> * Addressing PR comments Signed-off-by: Gaurav Bafna <[email protected]> Signed-off-by: Ashish Agrawal <[email protected]> Signed-off-by: Gaurav Bafna <[email protected]> Co-authored-by: Ashish Agrawal <[email protected]> (cherry picked from commit f64c0c7) Co-authored-by: Gaurav Bafna <[email protected]>
…pensearch-project#429) (opensearch-project#463) * bump version to 2.2 (opensearch-project#446) Signed-off-by: Ashish Agrawal <[email protected]> * Replica Count validation when awareness replica balance is enabled Signed-off-by: Gaurav Bafna <[email protected]> * Addressing PR comments Signed-off-by: Gaurav Bafna <[email protected]> Signed-off-by: Ashish Agrawal <[email protected]> Signed-off-by: Gaurav Bafna <[email protected]> Co-authored-by: Ashish Agrawal <[email protected]> (cherry picked from commit f64c0c7) Co-authored-by: Gaurav Bafna <[email protected]> Signed-off-by: Ronnak Saxena <[email protected]>
Signed-off-by: Gaurav Bafna [email protected]
Issue #, if available:
#381
Description of changes:
CheckList:
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.