Skip to content
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

[Searchable Snapshot] Deleted the cache path on index deletion. #6830

Merged

Conversation

harshjain2
Copy link
Contributor

@harshjain2 harshjain2 commented Mar 24, 2023

Description

Fix for the issue due to which cache path was not deleted when index is deleted.

Issues Resolved

Resolves #6532

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@kotwanikunal
Copy link
Member

The solution LGTM. Are you working on adding in the test?

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2023

Codecov Report

Merging #6830 (3f862b8) into main (07565ad) will increase coverage by 0.16%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6830      +/-   ##
============================================
+ Coverage     70.65%   70.81%   +0.16%     
- Complexity    59162    59289     +127     
============================================
  Files          4812     4812              
  Lines        283615   283616       +1     
  Branches      40896    40896              
============================================
+ Hits         200394   200854     +460     
+ Misses        66764    66343     -421     
+ Partials      16457    16419      -38     
Impacted Files Coverage Δ
...index/store/remote/filecache/FileCacheCleaner.java 44.44% <0.00%> (-2.62%) ⬇️

... and 455 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@harshjain2 harshjain2 changed the title [SearchableSnapshot] Deleted the cache path on index deletion. [Searchable Snapshot] Deleted the cache path on index deletion. Mar 25, 2023
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.index.IndexServiceTests.testAsyncTranslogTrimTaskOnClosedIndex

@harshjain2 harshjain2 force-pushed the harshjain2/cache_path_deletion branch from 8cfcbfe to 3f862b8 Compare March 25, 2023 09:57
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@harshjain2 harshjain2 requested a review from xuezhou25 as a code owner March 25, 2023 19:04
@harshjain2
Copy link
Contributor Author

@kotwanikunal Unit Tests doesn't exist for FileCacheCleaner.java probably because it is taking direct dependency on the Low Level Static APIs like Files. Therefore, I have modified the Integration Test case to cover this scenario.

Either the cache directory must be completely deleted. If not, the files in the cache directory must be properly closed. This is currently represented in the Integ Test case. Or should we change it to only first condition where the cache directory shouldn't exist at all?

@harshjain2 harshjain2 force-pushed the harshjain2/cache_path_deletion branch from 3f862b8 to 7b0fc4a Compare March 27, 2023 08:27
@harshjain2
Copy link
Contributor Author

@kotwanikunal Please let me know if more changes are required for this PR.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@kotwanikunal kotwanikunal added the backport 2.x Backport to 2.x branch label Mar 27, 2023
@kotwanikunal
Copy link
Member

@harshjain2 LGTM. @andrross WDYT?

Copy link
Member

@andrross andrross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either the cache directory must be completely deleted. If not, the files in the cache directory must be properly closed. This is currently represented in the Integ Test case. Or should we change it to only first condition where the cache directory shouldn't exist at all?

We deterministically delete the files when the index is deleted, therefore the case that the files exist but must be closed will never be encountered. I think we should remove that logic from the test case.

CHANGELOG.md Outdated
@@ -86,6 +86,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Segment Replication] Apply backpressure when replicas fall behind ([#6563](https://github.com/opensearch-project/OpenSearch/pull/6563))
- [Remote Store] Integrate remote segment store in peer recovery flow ([#6664](https://github.com/opensearch-project/OpenSearch/pull/6664))
- [Segment Replication] Add new cluster setting to set replication strategy by default for all indices in cluster. ([#6791](https://github.com/opensearch-project/OpenSearch/pull/6791))
- [Searchable Snapshot] Deleted the cache path on index deletion. ([#6830](https://github.com/opensearch-project/OpenSearch/pull/6830))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can omit the changelog here. We'll have a single over-arching entry for the feature and do not need these incremental fixes in the changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Harsh Jain added 4 commits March 28, 2023 15:01
Signed-off-by: Harsh Jain <harshjai@amazon.com>
Signed-off-by: Harsh Jain <harshjai@amazon.com>
Signed-off-by: Harsh Jain <harshjai@amazon.com>
Signed-off-by: Harsh Jain <harshjai@amazon.com>
@harshjain2 harshjain2 force-pushed the harshjain2/cache_path_deletion branch from 7b0fc4a to e42b83b Compare March 28, 2023 09:34
@harshjain2
Copy link
Contributor Author

We deterministically delete the files when the index is deleted Taken this forward in the Integration Tests.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      2 org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=indices.split/30_copy_settings/Copy settings during split index}

@harshjain2
Copy link
Contributor Author

@andrross I have addressed the feedback. Let me know if you have any other feedback.

@andrross andrross merged commit bd9b00d into opensearch-project:main Mar 28, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
* [SearchableSnapshot] Deleted the cache path on index deletion.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

* Added changelog, updated Integ Test.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

* Removed changelog entry, updated validation in integ tests.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

* Removed unused import statements.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

---------

Signed-off-by: Harsh Jain <harshjai@amazon.com>
Co-authored-by: Harsh Jain <harshjai@amazon.com>
(cherry picked from commit bd9b00d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kotwanikunal pushed a commit that referenced this pull request Mar 28, 2023
… (#6856)

* [SearchableSnapshot] Deleted the cache path on index deletion.



* Added changelog, updated Integ Test.



* Removed changelog entry, updated validation in integ tests.



* Removed unused import statements.



---------



(cherry picked from commit bd9b00d)

Signed-off-by: Harsh Jain <harshjai@amazon.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>
Co-authored-by: Harsh Jain <harshjai@amazon.com>
Rishikesh1159 added a commit to Rishikesh1159/OpenSearch that referenced this pull request Mar 30, 2023
mitrofmep pushed a commit to mitrofmep/OpenSearch that referenced this pull request Apr 5, 2023
…search-project#6830)

* [SearchableSnapshot] Deleted the cache path on index deletion.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

* Added changelog, updated Integ Test.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

* Removed changelog entry, updated validation in integ tests.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

* Removed unused import statements.

Signed-off-by: Harsh Jain <harshjai@amazon.com>

---------

Signed-off-by: Harsh Jain <harshjai@amazon.com>
Co-authored-by: Harsh Jain <harshjai@amazon.com>
Signed-off-by: Valentin Mitrofanov <mitrofmep@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Searchable Snapshot] Cache path not deleted after index is deleted
4 participants