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

Update replicationCheckpoint to include accurate seqNo from SegmentInfos. #6122

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Feb 1, 2023

Signed-off-by: Marc Handalian [email protected]

Description

This change updates IndexShard#getlatestSegmentInfos to include the latest max seqNo from the primary's segmentInfos snapshot. It also updates the method to return a Tuple so that both can be fetched. This change also updates replicas to not bump their SegmentInfos version when performing a commit.

Issues Resolved

closes #6121

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.

@mch2 mch2 changed the title Update replicationCheckpoint to include accurate seqNo from provided … Update replicationCheckpoint to include accurate seqNo from SegmentInfos. Feb 1, 2023
@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Gradle Check (Jenkins) Run Completed with:

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

…SegmentInfos.

This change updates IndexShard#getlatestSegmentInfos to include the latest max seqNo from the primary's
segmentInfos snapshot.  It also updates the method to return a Tuple so that both can be fetched.
This change also updates replicas to not bump their SegmentInfos version when performing a commit.

Signed-off-by: Marc Handalian <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2023

Codecov Report

Merging #6122 (ab971f3) into main (53d54de) will decrease coverage by 0.02%.
The diff coverage is 75.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6122      +/-   ##
============================================
- Coverage     70.74%   70.72%   -0.02%     
+ Complexity    58752    58716      -36     
============================================
  Files          4776     4776              
  Lines        280990   280993       +3     
  Branches      40596    40598       +2     
============================================
- Hits         198774   198735      -39     
- Misses        65876    65910      +34     
- Partials      16340    16348       +8     
Impacted Files Coverage Δ
...in/java/org/opensearch/index/shard/IndexShard.java 69.50% <66.66%> (-0.19%) ⬇️
...rc/main/java/org/opensearch/index/store/Store.java 79.91% <100.00%> (+0.28%) ⬆️
...ensearch/indices/replication/common/CopyState.java 88.88% <100.00%> (-1.12%) ⬇️
...n/indices/forcemerge/ForceMergeRequestBuilder.java 0.00% <0.00%> (-75.00%) ⬇️
.../java/org/opensearch/node/NodeClosedException.java 50.00% <0.00%> (-50.00%) ⬇️
...ava/org/opensearch/action/NoSuchNodeException.java 0.00% <0.00%> (-50.00%) ⬇️
...cluster/coordination/PendingClusterStateStats.java 20.00% <0.00%> (-48.00%) ⬇️
...regations/metrics/AbstractHyperLogLogPlusPlus.java 51.72% <0.00%> (-44.83%) ⬇️
...pensearch/action/ingest/DeletePipelineRequest.java 31.25% <0.00%> (-37.50%) ⬇️
...ensearch/client/indices/DetailAnalyzeResponse.java 20.54% <0.00%> (-34.25%) ⬇️
... and 457 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2023

Gradle Check (Jenkins) Run Completed with:

@mch2 mch2 merged commit c5a1bdf into opensearch-project:main Feb 2, 2023
@mch2 mch2 deleted the seqno branch February 2, 2023 06:58
@mch2 mch2 added the backport 2.x Backport to 2.x branch label Feb 2, 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-6122-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c5a1bdfbfa2f2baab6f100cccd47db2e709e733a
# Push it to GitHub
git push --set-upstream origin backport/backport-6122-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-6122-to-2.x.

mch2 added a commit to mch2/OpenSearch that referenced this pull request Feb 2, 2023
…fos. (opensearch-project#6122)

* Update replicationCheckpoint to include accurate seqNo from provided SegmentInfos.

This change updates IndexShard#getlatestSegmentInfos to include the latest max seqNo from the primary's
segmentInfos snapshot.  It also updates the method to return a Tuple so that both can be fetched.
This change also updates replicas to not bump their SegmentInfos version when performing a commit.

Signed-off-by: Marc Handalian <[email protected]>

* Add missing test to StoreTests verifying version and userData on commitSegmentInfos.

Signed-off-by: Marc Handalian <[email protected]>

---------

Signed-off-by: Marc Handalian <[email protected]>
(cherry picked from commit c5a1bdf)
dreamer-89 pushed a commit that referenced this pull request Feb 2, 2023
…fos. (#6122) (#6156)

* Update replicationCheckpoint to include accurate seqNo from provided SegmentInfos.

This change updates IndexShard#getlatestSegmentInfos to include the latest max seqNo from the primary's
segmentInfos snapshot.  It also updates the method to return a Tuple so that both can be fetched.
This change also updates replicas to not bump their SegmentInfos version when performing a commit.

Signed-off-by: Marc Handalian <[email protected]>

* Add missing test to StoreTests verifying version and userData on commitSegmentInfos.

Signed-off-by: Marc Handalian <[email protected]>

---------

Signed-off-by: Marc Handalian <[email protected]>
(cherry picked from commit c5a1bdf)
andrross added a commit to andrross/OpenSearch that referenced this pull request Feb 3, 2023
Three changes here:
 - Remove unneeded entry (was removed in backport) (opensearch-project#6049)
 - Move segrep change to proper section (was put in correct spot in
   backport) (opensearch-project#6122)
 - Add back issue that was merged to main prior to 2.5 release but not
   backported, and was therefore removed from the main CHANGELOG (opensearch-project#4603)

Signed-off-by: Andrew Ross <[email protected]>
@andrross andrross mentioned this pull request Feb 3, 2023
6 tasks
andrross added a commit that referenced this pull request Feb 4, 2023
Three changes here:
 - Remove unneeded entry (was removed in backport) (#6049)
 - Move segrep change to proper section (was put in correct spot in
   backport) (#6122)
 - Add back issue that was merged to main prior to 2.5 release but not
   backported, and was therefore removed from the main CHANGELOG (#4603)

Signed-off-by: Andrew Ross <[email protected]>
mch2 added a commit to mch2/OpenSearch that referenced this pull request Mar 4, 2023
…fos. (opensearch-project#6122)

* Update replicationCheckpoint to include accurate seqNo from provided SegmentInfos.

This change updates IndexShard#getlatestSegmentInfos to include the latest max seqNo from the primary's
segmentInfos snapshot.  It also updates the method to return a Tuple so that both can be fetched.
This change also updates replicas to not bump their SegmentInfos version when performing a commit.

Signed-off-by: Marc Handalian <[email protected]>

* Add missing test to StoreTests verifying version and userData on commitSegmentInfos.

Signed-off-by: Marc Handalian <[email protected]>

---------

Signed-off-by: Marc Handalian <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Segment Replication] - SeqNo and Version comparison between shards is not accurate.
3 participants