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

[Remote Segment Store] Combine metadata and snapshot files #7777

Merged

Conversation

sachinpkale
Copy link
Member

@sachinpkale sachinpkale commented May 26, 2023

Description

  • Currently, we upload 2 files in addition to segment files per refresh (we upload these files even if there are no segments to upload - that will be fixed by [Remote Segments] Avoid segments metadata upload if no difference in local store and remote store #7443)
  • These 2 files are metadata file and SegmentInfosSnapshot file. In order to avoid explosion of number of files in the remote store, we use the same name of metadata and snapshot file per commit.
  • But the assumed invariant is: there is 1:1 mapping between metadata and SegmentInfosSnapshot file.
  • This does not work if while reading we read metadata file and by the time we read snapshot file, remote store has new snapshot file with the same name.
  • To avoid this race condition, this change combines these 2 files. metadata file will have one more field: segmentInfosBytes and in the restore flow, instance of SegmentInfos will be created by this field in the metadata.

Related Issues

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.

@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

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteStoreRefreshListenerIT.testRemoteRefreshRetryOnFailure

@codecov
Copy link

codecov bot commented May 27, 2023

Codecov Report

Merging #7777 (71c24b4) into main (aa21585) will increase coverage by 0.06%.
The diff coverage is 96.92%.

@@             Coverage Diff              @@
##               main    #7777      +/-   ##
============================================
+ Coverage     70.78%   70.84%   +0.06%     
- Complexity    56251    56275      +24     
============================================
  Files          4689     4689              
  Lines        266304   266324      +20     
  Branches      39086    39087       +1     
============================================
+ Hits         188505   188682     +177     
+ Misses        61847    61664     -183     
- Partials      15952    15978      +26     
Impacted Files Coverage Δ
...in/java/org/opensearch/index/shard/IndexShard.java 70.51% <86.66%> (+1.08%) ⬆️
...search/index/shard/RemoteStoreRefreshListener.java 85.05% <100.00%> (+0.10%) ⬆️
...earch/index/store/RemoteSegmentStoreDirectory.java 93.22% <100.00%> (+0.41%) ⬆️
...x/store/remote/metadata/RemoteSegmentMetadata.java 100.00% <100.00%> (ø)
.../remote/metadata/RemoteSegmentMetadataHandler.java 100.00% <100.00%> (ø)

... and 434 files with indirect coverage changes

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Sachin Kale added 8 commits June 6, 2023 14:02
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Signed-off-by: Sachin Kale <kalsac@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.search.backpressure.SearchBackpressureIT.testSearchTaskCancellationWithHighCpu

@sachinpkale
Copy link
Member Author

Precommit is failing on windows. Re-triggering the build.

Signed-off-by: Sachin Kale <kalsac@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Gradle Check (Jenkins) Run Completed with:

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

@gbbafna gbbafna merged commit 8dd5461 into opensearch-project:main Jun 6, 2023
@gbbafna gbbafna added the backport 2.x Backport to 2.x branch label Jun 6, 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-7777-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8dd5461bff681238546f08f91b49d6d0755abcc7
# Push it to GitHub
git push --set-upstream origin backport/backport-7777-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-7777-to-2.x.

sachinpkale added a commit to sachinpkale/OpenSearch that referenced this pull request Jun 8, 2023
gbbafna pushed a commit that referenced this pull request Jun 8, 2023
sandeshkr419 pushed a commit to sandeshkr419/OpenSearch that referenced this pull request Jun 8, 2023
gaiksaya pushed a commit to gaiksaya/OpenSearch that referenced this pull request Jun 26, 2023
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…h-project#7777)

Signed-off-by: Sachin Kale <kalsac@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.

3 participants