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

Add timestamp pinning service and scheduler to update in-memory state #15180

Merged
merged 12 commits into from
Aug 15, 2024

Conversation

sachinpkale
Copy link
Member

@sachinpkale sachinpkale commented Aug 9, 2024

Description

  • As part of timestamp pinning , we are adding support of pinning the timestamp for remote backed indices.
  • In this PR, we introduce a service which provides APIs to pin and unpin the timestamp.
  • Once the pinned timestamp list is updated, we need to modify in-memory data structure at each node. This is done by a scheduler which runs periodically and updates the local state.
  • The periodicity of this scheduler is controlled by a dynamic cluster setting.

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.

@sachinpkale sachinpkale force-pushed the timestamp-pinning branch 2 times, most recently from 1179bfd to 83c945b Compare August 9, 2024 10:14
Copy link
Contributor

github-actions bot commented Aug 9, 2024

❌ Gradle check result for 0cd75b1: 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 Aug 9, 2024

❌ Gradle check result for 1179bfd: 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 Aug 9, 2024

❌ Gradle check result for 83c945b: 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 Aug 9, 2024

❌ Gradle check result for 3fe94b0: 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 <[email protected]>
Copy link
Contributor

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

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

❕ Gradle check result for 3bad790: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.http.SearchRestCancellationIT.testAutomaticCancellationMultiSearchDuringQueryPhase

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 Aug 14, 2024

Codecov Report

Attention: Patch coverage is 46.95122% with 87 lines in your changes missing coverage. Please review.

Project coverage is 71.83%. Comparing base (6e27e5a) to head (4212363).
Report is 80 commits behind head on main.

Files with missing lines Patch % Lines
...remotestore/RemoteStorePinnedTimestampService.java 31.89% 77 Missing and 2 partials ⚠️
...h/gateway/remote/model/RemotePinnedTimestamps.java 78.78% 5 Missing and 2 partials ⚠️
...te/model/RemoteStorePinnedTimestampsBlobStore.java 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #15180      +/-   ##
============================================
- Coverage     71.89%   71.83%   -0.07%     
- Complexity    63043    63064      +21     
============================================
  Files          5197     5200       +3     
  Lines        295311   295474     +163     
  Branches      42676    42687      +11     
============================================
- Hits         212314   212246      -68     
- Misses        65552    65827     +275     
+ Partials      17445    17401      -44     

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

Signed-off-by: Sachin Kale <[email protected]>
Copy link
Contributor

✅ Gradle check result for 4212363: SUCCESS

@sachinpkale
Copy link
Member Author

Codecov patch is failing as integ test coverage is not covered (added in RemoteStorePinnedTimestampsIT)

@sachinpkale sachinpkale merged commit 1717b55 into opensearch-project:main Aug 15, 2024
34 of 35 checks passed
@sachinpkale sachinpkale added the backport 2.x Backport to 2.x branch label Aug 15, 2024
@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:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-15180-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1717b551db0d6e5d22aff89bf6fd9873d8d4ec20
# Push it to GitHub
git push --set-upstream origin backport/backport-15180-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

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

@@ -807,6 +808,18 @@ protected Node(
remoteIndexPathUploader = null;
remoteClusterStateCleanupManager = null;
}
final RemoteStorePinnedTimestampService remoteStorePinnedTimestampService;
if (isRemoteStoreAttributePresent(settings)) {
Copy link
Member

Choose a reason for hiding this comment

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

Should use isRemoteDataAttributePresent here instead since this is required for remote data store.

BlobPath path = pinnedTimestampsBlobStore.getBlobPathForUpload(remotePinnedTimestamps);
try {
if (updateTimetampPinningSemaphore.tryAcquire(10, TimeUnit.MINUTES)) {
ActionListener<Void> semaphoreAwareListener = ActionListener.runBefore(listener, updateTimetampPinningSemaphore::release);
Copy link
Collaborator

Choose a reason for hiding this comment

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

any unhandled exception is not logged in the listener chaining, we should log it to get visibility into unexpected failures

wdongyu pushed a commit to wdongyu/OpenSearch that referenced this pull request Aug 22, 2024
@sachinpkale sachinpkale added backport 2.x Backport to 2.x branch and removed backport 2.x Backport to 2.x branch labels Aug 31, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 31, 2024
…#15180)

---------

Signed-off-by: Sachin Kale <[email protected]>
Co-authored-by: Sachin Kale <[email protected]>
(cherry picked from commit 1717b55)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sachinpkale pushed a commit that referenced this pull request Aug 31, 2024
…#15180) (#15547)

---------



(cherry picked from commit 1717b55)

Signed-off-by: Sachin Kale <[email protected]>
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: Sachin Kale <[email protected]>
akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants