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

[Snapshot Interop] Add Logic in Lock Manager to cleanup stale data po… #8472

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

harishbhakuni
Copy link
Contributor

@harishbhakuni harishbhakuni commented Jul 6, 2023

…st index deletion.

Description

Changes to Cleanup Stale Remote Store Data Post Index Deletion if there are no more locks on metadata files.
Here, we are extending LockManager implementation and adding a new method which will along with releasing lock would also attempt cleanup of remote store stale files.
As BlobStoreRepository implementation already have cluster state, we will use that to determine if index is deleted or not, if index is deleted we will call the new method releaseAndCleanup which will release lock and then if there are no more locks in the directory, it will try to cleanup the directory.

Related Issues

Resolves #8469

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.

@harishbhakuni
Copy link
Contributor Author

tagging @gbbafna @sachinpkale to look into the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

Gradle Check (Jenkins) Run Completed with:

@harishbhakuni harishbhakuni force-pushed the lockManagerChanges branch 2 times, most recently from aea333d to 3798261 Compare July 21, 2023 01:36
@harishbhakuni
Copy link
Contributor Author

tagging @sohami as well to take a look into the changes.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

Gradle Check (Jenkins) Run Completed with:

@harishbhakuni harishbhakuni force-pushed the lockManagerChanges branch 2 times, most recently from 20296d3 to cf89b2b Compare August 2, 2023 08:05
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

Gradle Check (Jenkins) Run Completed with:

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/reporting.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/ml-commons.git]

BUILD SUCCESSFUL in 29m 10s

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/reporting.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/ml-commons.git]

BUILD SUCCESSFUL in 30m 2s

…st index deletion.

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

Gradle Check (Jenkins) Run Completed with:

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:



> Task :checkCompatibility
Incompatible components: [https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/security-analytics.git]
Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

BUILD SUCCESSFUL in 30m 5s

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.repositories.azure.AzureBlobStoreRepositoryTests.testIndicesDeletedFromRepository

@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #8472 (87a4658) into main (57eb105) will decrease coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 34.61%.

@@             Coverage Diff              @@
##               main    #8472      +/-   ##
============================================
- Coverage     71.01%   71.00%   -0.02%     
+ Complexity    57248    57238      -10     
============================================
  Files          4765     4765              
  Lines        270315   270332      +17     
  Branches      39534    39537       +3     
============================================
- Hits         191972   191946      -26     
- Misses        62170    62210      +40     
- Partials      16173    16176       +3     
Files Changed Coverage Δ
...ore/lockmanager/RemoteStoreLockManagerFactory.java 75.00% <0.00%> (-5.00%) ⬇️
...ch/repositories/blobstore/BlobStoreRepository.java 61.58% <0.00%> (-0.25%) ⬇️
...earch/index/store/RemoteSegmentStoreDirectory.java 87.54% <100.00%> (-0.17%) ⬇️
...ndex/store/RemoteSegmentStoreDirectoryFactory.java 95.65% <100.00%> (ø)

... and 476 files with indirect coverage changes

Copy link
Collaborator

@gbbafna gbbafna left a comment

Choose a reason for hiding this comment

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

LGTM

@gbbafna gbbafna merged commit 5670d2a into opensearch-project:main Aug 3, 2023
8 of 10 checks passed
@gbbafna gbbafna added the backport 2.x Backport to 2.x branch label Aug 3, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-8472-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5670d2a2be92602c8e8e38cc8fec7ddf5737ed52
# Push it to GitHub
git push --set-upstream origin backport/backport-8472-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-8472-to-2.x.

VachaShah pushed a commit to VachaShah/OpenSearch that referenced this pull request Aug 3, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
harishbhakuni added a commit to harishbhakuni/OpenSearch that referenced this pull request Sep 5, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
(cherry picked from commit 5670d2a)
harishbhakuni pushed a commit to harishbhakuni/OpenSearch that referenced this pull request Sep 5, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
(cherry picked from commit 5670d2a)
harishbhakuni pushed a commit to harishbhakuni/OpenSearch that referenced this pull request Sep 5, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
(cherry picked from commit 5670d2a)
harishbhakuni pushed a commit to harishbhakuni/OpenSearch that referenced this pull request Sep 5, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
(cherry picked from commit 5670d2a)
harishbhakuni pushed a commit to harishbhakuni/OpenSearch that referenced this pull request Sep 5, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
(cherry picked from commit 5670d2a)
harishbhakuni pushed a commit to harishbhakuni/OpenSearch that referenced this pull request Sep 5, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
(cherry picked from commit 5670d2a)
gbbafna pushed a commit that referenced this pull request Sep 6, 2023
…st index deletion. (#8472) (#9769)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
(cherry picked from commit 5670d2a)
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…st index deletion. (opensearch-project#8472)

Signed-off-by: Harish Bhakuni <hbhakuni@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.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.

[Snapshot Interop] Add Logic for Remote Store Cleanup in Lock Manager if there are no more locks.
2 participants