-
Notifications
You must be signed in to change notification settings - Fork 2k
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 MinDocsCondition to Rollover API #7243
Add MinDocsCondition to Rollover API #7243
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7243 +/- ##
============================================
- Coverage 71.02% 70.71% -0.32%
+ Complexity 58078 56029 -2049
============================================
Files 4825 4670 -155
Lines 274032 265699 -8333
Branches 39930 39015 -915
============================================
- Hits 194628 187876 -6752
+ Misses 63067 61927 -1140
+ Partials 16337 15896 -441 ☔ View full report in Codecov by Sentry. |
@@ -131,6 +132,18 @@ public RolloverRequest addMaxIndexSizeCondition(ByteSizeValue size) { | |||
return this; | |||
} | |||
|
|||
/** |
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.
same description as addMaxIndexDocsCondition. Specify what makes them different.
import java.io.IOException; | ||
|
||
/** | ||
* Condition for minimum index docs. Evaluates to <code>true</code> |
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: same as above - mention how it's different from maxDocs.
boolean metMinDocsCondition = rolloverRequest.getConditions().containsKey(MinDocsCondition.NAME) | ||
? conditionResults.get(rolloverRequest.getConditions().get(MinDocsCondition.NAME)) | ||
: true; | ||
if (conditionResults.size() == 0 || (metConditions.size() > 0 && metMinDocsCondition)) { |
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.
Just to confirm: our expected behavior is that when a minDocsCondition is set -
any max condition and minDocsCondition must be true in order to rollover?
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.
I think so. If there is no enough number of docs, it should not rollover
for (Map.Entry<String, Boolean> entry : results.entrySet()) { | ||
if (entry.getKey().equals(maxAgeCondition.toString())) { | ||
assertThat(entry.getValue(), equalTo(true)); | ||
} else if (entry.getKey().equals(maxDocsCondition.toString())) { | ||
assertThat(entry.getValue(), equalTo(false)); | ||
} else if (entry.getKey().equals(maxSizeCondition.toString())) { | ||
assertThat(entry.getValue(), equalTo(false)); | ||
} else if (entry.getKey().equals(minDocsCondition.toString())) { |
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.
In a test, it makes more sense to have deterministic expected outcomes. We could set the minDocsCondition value to 10, in which case the expected value will always be false.
Thanks @shinbay-almaz for contributing by opening this PR! |
This PR was closed because it has been stalled for 7 days with no activity. |
Apologies. This PR was auto closed without reaching a resolution from the maintainers. |
Compatibility status:Checks if related components are compatible with change 2ef35db Incompatible componentsSkipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git] |
Gradle Check (Jenkins) Run Completed with:
|
@kotwanikunal Hi 👋 Sorry that I left in the middle. I had work in this summer. I think now I can finally complete this PR |
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Almaz Shinbay <shinbay.almaz@gmail.com>
2ef35db
to
156a367
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Hi @shinbay-almaz, the PR is stalled. Is this being worked upon? Feel free to reach out to maintainers for further reviews. |
This PR is stalled because it has been open for 30 days with no activity. |
It seems like this contribution is stalled. I would recommend we close it for now. @opensearch-project/opensearch-core could some close this please? Thanks |
This PR is stalled because it has been open for 30 days with no activity. |
Closing this PR since there are no updates. |
Description
Added MinDocsCondition to prevent rollover if the index has less than specified number of docs
Issues Resolved
#6780
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.