-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Cleanup file cache on deleting index/shard directory #11443
Cleanup file cache on deleting index/shard directory #11443
Conversation
❌ Gradle check result for 50c3b60: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Compatibility status:Checks if related components are compatible with change e1e1472 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git] |
@andrross @adnapibar Would you mind taking a look? |
This PR is stalled because it has been open for 30 days with no activity. |
@andrross Sorry to bother you again. I believe this is a bug that need to fix, can you have a look |
@bugmakerrrrrr Apologies for the delay, I'll look into this today, thanks! |
test/framework/src/main/java/org/opensearch/test/InternalTestCluster.java
Outdated
Show resolved
Hide resolved
Signed-off-by: panguixin <panguixin@bytedance.com>
50c3b60
to
36a6bb1
Compare
Signed-off-by: panguixin <panguixin@bytedance.com>
36a6bb1
to
e1e1472
Compare
@andrross I add a new listener |
@bugmakerrrrrr I'll take a look today, thanks! |
❕ Gradle check result for 36a6bb1: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11443 +/- ##
============================================
+ Coverage 71.34% 71.41% +0.07%
- Complexity 59486 59511 +25
============================================
Files 4927 4927
Lines 279663 279682 +19
Branches 40663 40666 +3
============================================
+ Hits 199513 199745 +232
+ Misses 63533 63335 -198
+ Partials 16617 16602 -15 ☔ View full report in Codecov by Sentry. |
❕ Gradle check result for e1e1472: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
* cleanup file cache on deleting index/shard directory Signed-off-by: panguixin <panguixin@bytedance.com> * add index store listener Signed-off-by: panguixin <panguixin@bytedance.com> --------- Signed-off-by: panguixin <panguixin@bytedance.com> (cherry picked from commit c564ee3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* cleanup file cache on deleting index/shard directory * add index store listener --------- (cherry picked from commit c564ee3) Signed-off-by: panguixin <panguixin@bytedance.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ect#11443) * cleanup file cache on deleting index/shard directory Signed-off-by: panguixin <panguixin@bytedance.com> * add index store listener Signed-off-by: panguixin <panguixin@bytedance.com> --------- Signed-off-by: panguixin <panguixin@bytedance.com>
…ect#11443) * cleanup file cache on deleting index/shard directory Signed-off-by: panguixin <panguixin@bytedance.com> * add index store listener Signed-off-by: panguixin <panguixin@bytedance.com> --------- Signed-off-by: panguixin <panguixin@bytedance.com>
…ect#11443) * cleanup file cache on deleting index/shard directory Signed-off-by: panguixin <panguixin@bytedance.com> * add index store listener Signed-off-by: panguixin <panguixin@bytedance.com> --------- Signed-off-by: panguixin <panguixin@bytedance.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
Currently, we rely on the index event listener to manage file cache cleanup. This approach is effective when we simply delete the index. However, in certain situations, such as shard relocation, the shard data may be deleted asynchronously, causing the preset index event listener to not be triggered (as noted in the comments for
org.opensearch.indices.cluster.IndicesClusterStateService#removeIndices/removeShards
). To address this issue, I suggest that we implement file cache cleanup (including cache entry eviction and file deletion) during the deletion of the index/shard directory inNodeEnvironment
.Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.