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

BugFix: call listener.onFailure on failure to pin the timestamp #16248

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

sachinpkale
Copy link
Member

@sachinpkale sachinpkale commented Oct 9, 2024

Description

  • Today, if we try to pin the timestamp that is older than now() - Lookbak Interval, we throw IllegalArgumentException
  • But as RemoteStorePinnedTimestampService.pinTimestamp is async, on any failure, listener.onFailure() should be called.
    public void pinTimestamp(long timestamp, String pinningEntity, ActionListener<Void> listener) {
    // If a caller uses current system time to pin the timestamp, following check will almost always fail.
    // So, we allow pinning timestamp in the past upto some buffer
    long lookbackIntervalInMills = RemoteStoreSettings.getPinnedTimestampsLookbackInterval().millis();
    if (timestamp < (System.currentTimeMillis() - lookbackIntervalInMills)) {
    throw new IllegalArgumentException(
    "Timestamp to be pinned is less than current timestamp - value of cluster.remote_store.pinned_timestamps.lookback_interval"
    );
    }
  • Due to this, caller will keep waiting on listener.
  • In this PR, we make sure to call listener.onFailure on each type of failure

Related Issues

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.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

❌ Gradle check result for 8854340: 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 Oct 9, 2024

❌ Gradle check result for d627609: 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 Oct 9, 2024

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

Signed-off-by: Sachin Kale <sachinpkale@gmail.com>
Signed-off-by: Sachin Kale <sachinpkale@gmail.com>
Signed-off-by: Sachin Kale <sachinpkale@gmail.com>
Copy link
Contributor

github-actions bot commented Oct 9, 2024

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

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.

Project coverage is 72.01%. Comparing base (e7757e7) to head (1466a73).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
...remotestore/RemoteStorePinnedTimestampService.java 28.57% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16248      +/-   ##
============================================
+ Coverage     71.97%   72.01%   +0.03%     
+ Complexity    64771    64741      -30     
============================================
  Files          5302     5302              
  Lines        302473   302473              
  Branches      43699    43699              
============================================
+ Hits         217715   217832     +117     
+ Misses        66950    66754     -196     
- Partials      17808    17887      +79     

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

@gbbafna gbbafna merged commit 58adc18 into opensearch-project:main Oct 10, 2024
33 of 34 checks passed
@gbbafna gbbafna added the backport 2.x Backport to 2.x branch label Oct 10, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 10, 2024
Signed-off-by: Sachin Kale <sachinpkale@gmail.com>
(cherry picked from commit 58adc18)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
gbbafna pushed a commit that referenced this pull request Oct 10, 2024
…) (#16264)

(cherry picked from commit 58adc18)

Signed-off-by: Sachin Kale <sachinpkale@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>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 16, 2024
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 17, 2024
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
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.

2 participants