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

Make IndexStoreListener a pluggable interface #16583

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

jed326
Copy link
Collaborator

@jed326 jed326 commented Nov 6, 2024

Description

I have a use case where I have a custom file cache implementation and in order to not have dangling entries in my fc I need to implement IndexStoreListener to clean up my file cache when shards move off a node. Today that is not possible as IndexStoreListener is an @opensearch.internal interface and not pluggable, which this PR changes.

Long term I think the solution is to make the FileCache itself pluggable, but that is much more complicated and anyways would require us to expose this interface as pluggable, so I believe this is a useful intermediary step.

The other thing to note is in Node.java I am now creating the CompositeIndexStoreListener regardless of if it isSearchNode() or not as it should be up to the specific listener implementations to determine how/when to perform their action.

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@jed326
Copy link
Collaborator Author

jed326 commented Nov 6, 2024

@andrross @bugmakerrrrrr @sohami could you review this PR as it is related to #11443?

Copy link
Contributor

github-actions bot commented Nov 6, 2024

❌ Gradle check result for 8c4fd86: 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?

@jed326 jed326 force-pushed the indexstorelistener branch from 8c4fd86 to 829b470 Compare November 6, 2024 18:38
@jed326 jed326 force-pushed the indexstorelistener branch from 829b470 to ceeb08a Compare November 6, 2024 19:36
Copy link
Contributor

github-actions bot commented Nov 6, 2024

❌ Gradle check result for ceeb08a: 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?

@jed326 jed326 force-pushed the indexstorelistener branch from ceeb08a to 65497a0 Compare November 6, 2024 21:07
Copy link
Contributor

github-actions bot commented Nov 6, 2024

❌ Gradle check result for 65497a0: 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?

Copy link
Contributor

github-actions bot commented Nov 7, 2024

✅ Gradle check result for 2de2403: SUCCESS

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 72.11%. Comparing base (034bd2b) to head (ca32a2f).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...org/opensearch/index/store/IndexStoreListener.java 80.95% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16583      +/-   ##
============================================
+ Coverage     72.04%   72.11%   +0.07%     
- Complexity    65093    65102       +9     
============================================
  Files          5314     5315       +1     
  Lines        303541   303572      +31     
  Branches      43921    43925       +4     
============================================
+ Hits         218683   218935     +252     
+ Misses        66946    66672     -274     
- Partials      17912    17965      +53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sohami
Copy link
Collaborator

sohami commented Nov 7, 2024

lgtm. Will wait for others to approve as well

Copy link
Contributor

@bugmakerrrrrr bugmakerrrrrr left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Looks good, once the @PublicApi tag is added per @reta's comment

Signed-off-by: Jay Deng <jayd0104@gmail.com>
@jed326 jed326 force-pushed the indexstorelistener branch from 2de2403 to ca32a2f Compare November 7, 2024 17:07
Copy link
Contributor

github-actions bot commented Nov 7, 2024

❕ Gradle check result for ca32a2f: 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.

@jed326 jed326 merged commit 9b7681c into opensearch-project:main Nov 7, 2024
38 of 39 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 7, 2024
Signed-off-by: Jay Deng <jayd0104@gmail.com>
(cherry picked from commit 9b7681c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
jed326 added a commit that referenced this pull request Nov 7, 2024
* Make IndexStoreListener a pluggable interface (#16583)

Signed-off-by: Jay Deng <jayd0104@gmail.com>
(cherry picked from commit 9b7681c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Resolve breaking changes

Signed-off-by: Jay Deng <jayd0104@gmail.com>

---------

Signed-off-by: Jay Deng <jayd0104@gmail.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: Jay Deng <jayd0104@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 v2.19.0 Issues and PRs related to version 2.19.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants