-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add dynamic setting for DiskCircuitBreaker default disk shortage thre… #1532
Conversation
…shold Signed-off-by: Pranav Jadhav <[email protected]>
Thanks for making this change. The CI failed, check https://github.com/opensearch-project/ml-commons/actions/runs/6592907739/job/17914444093?pr=1532
|
The integTest seems to be failing, not sure whats going on here. |
Seems flaky as some platform succeed , some failed, rerun the failed test. |
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.
Can you add some tests for this?
Is there any reference for adding tests I can look at? I'm not really sure where to add tests or what to test. |
Could you please check how other variables were tested? For example This will help you to deep dive in the code. |
@pranavjad do you understand now how to add tests? Please let us know if you are still unclear about this. |
@dhrubo-os I looked through the test folder under plugin and saw how the tests for MemoryCircuitBreaker and MLCircuitBreaker were made, but when creating a DiskCircuitBreaker object in a test, what should I use as the diskDir argument? |
@Zhangxunmt Looks like you worked in this class. Could you please help @pranavjad? Thanks. |
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.
Again, can we add one more test case covering this change?
https://github.com/opensearch-project/ml-commons/blob/2.x/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java#L329, Please use this Dir for your tests. @pranavjad |
@@ -168,6 +168,8 @@ private MLCommonsSettings() {} | |||
Setting.Property.Dynamic | |||
); | |||
|
|||
public static final Setting<Long> ML_COMMONS_DISK_SHORTAGE_THRESHOLD = Setting | |||
.longSetting("plugins.ml_commons.disk_shortage_threshold", 5L, 1L, 10L, Setting.Property.NodeScope, Setting.Property.Dynamic); |
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.
How about rename the setting name?
.longSetting("plugins.ml_commons.disk_shortage_threshold", 5L, 1L, 10L, Setting.Property.NodeScope, Setting.Property.Dynamic); | |
.longSetting("plugins.ml_commons.disk_space_threshold", 5L, 1L, 10L, Setting.Property.NodeScope, Setting.Property.Dynamic); |
@pranavjad are you working on this? Can we please wrap up this PR? Please let me know if you need any help. |
@pranavjad are you working on this? |
No, I am not sorry. I do not think I will be able to finish this PR, so I will close it. Thanks. |
Description
Adds a dynamic setting for the disk shortage threshold in the DiskCircuitBreaker.
Issues Resolved
#1341
Check List
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.