-
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
Support for system index interface #789
Conversation
Signed-off-by: bowenlan-amzn <[email protected]>
Signed-off-by: bowenlan-amzn <[email protected]>
Codecov Report
@@ Coverage Diff @@
## 2.x #789 +/- ##
============================================
- Coverage 76.09% 75.74% -0.35%
+ Complexity 2863 2846 -17
============================================
Files 364 364
Lines 16420 16426 +6
Branches 2364 2365 +1
============================================
- Hits 12494 12442 -52
- Misses 2553 2619 +66
+ Partials 1373 1365 -8
|
Signed-off-by: bowenlan-amzn <[email protected]>
src/main/kotlin/org/opensearch/indexmanagement/opensearchapi/OpenSearchExtensions.kt
Show resolved
Hide resolved
Signed-off-by: bowenlan-amzn <[email protected]>
@@ -247,6 +247,8 @@ class RestStartRollupActionIT : RollupRestTestCase() { | |||
assertEquals("Rollup is not RETRY", RollupMetadata.Status.RETRY, rollupMetadata.status) | |||
|
|||
// clearing the config index to prevent other tests using this multi shard index | |||
Thread.sleep(2000L) |
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.
Why do we need to wait before deletion. Also adding sleeps in general tend to make tests flaky.
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.
Before it's to wait for rollup metadata update to finish, observe the metadata update may recreate the index after deletion. But cannot guarantee it's the root cause.
This flaky is not related to the change in this PR.
backoff = iter.next() | ||
logger.warn("Rejected execution. Retrying in $backoff.", rje) | ||
delay((backoff.millis)) |
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.
Shall we add test to verify the behavior for this exception handling?
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.
Don't feel there's need to check such simple logic 😛 no test for the existing block also
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.
Its good to have unit tests for code coverage and setting the code expectation for future (or accidental) changes.
@@ -77,6 +77,11 @@ abstract class IndexManagementRestTestCase : ODFERestTestCase() { | |||
|
|||
protected fun Response.restStatus(): RestStatus = RestStatus.fromCode(this.statusLine.statusCode) | |||
|
|||
protected fun isIndexExists(index: String): Boolean { |
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 we also assert on System Index property here to ensure it always remains a system index?
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.
This is a REST API call.
It seems there's no way to check whether an index is system index using REST API.
https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/indices/SystemIndices.java
* Support for system index interface Signed-off-by: bowenlan-amzn <[email protected]> * Handle rejected execution exception as retryable in retry block Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> --------- Signed-off-by: bowenlan-amzn <[email protected]> (cherry picked from commit fa7e46f)
* Support for system index interface Signed-off-by: bowenlan-amzn <[email protected]> * Handle rejected execution exception as retryable in retry block Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> --------- Signed-off-by: bowenlan-amzn <[email protected]> (cherry picked from commit fa7e46f) Co-authored-by: bowenlan-amzn <[email protected]>
…ch-project#799) * Support for system index interface Signed-off-by: bowenlan-amzn <[email protected]> * Handle rejected execution exception as retryable in retry block Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> --------- Signed-off-by: bowenlan-amzn <[email protected]> (cherry picked from commit fa7e46f) Co-authored-by: bowenlan-amzn <[email protected]>
* Support for system index interface Signed-off-by: bowenlan-amzn <[email protected]> * Handle rejected execution exception as retryable in retry block Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> * Fix tests Signed-off-by: bowenlan-amzn <[email protected]> --------- Signed-off-by: bowenlan-amzn <[email protected]> Signed-off-by: Ronnak Saxena <[email protected]>
Issue #, if available:
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.