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

Avoid use of indicesService in Resume replicaiton flow #1030

Merged

Conversation

monusingh-1
Copy link
Collaborator

@monusingh-1 monusingh-1 commented Jun 30, 2023

Description

Calling indicesService's indexServiceSafe in the resume flow breaks in dedicated master node configuration with following error:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "index_not_found_exception",
        "reason" : "no such index [follower-01]",
        "index" : "follower-01",
        "index_uuid" : "G3b2f19FRtSl7m7zQS7jRw"
      }
    ],
    "type" : "index_not_found_exception",
    "reason" : "no such index [follower-01]",
    "index" : "follower-01",
    "index_uuid" : "G3b2f19FRtSl7m7zQS7jRw"
  },
  "status" : 404
}

This change avoids using indicesService and instead passes RetentionLeaseActions.RETAIN_ALL as new retention lease is only taken when the new lease id does not exists but old lease id exists.

Issues Resolved

[List any issues this PR will resolve]

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

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.

@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Merging #1030 (c00d190) into main (448e7a7) will decrease coverage by 0.21%.
The diff coverage is 100.00%.

❗ Current head c00d190 differs from pull request most recent head 1cdb22c. Consider uploading reports for the commit 1cdb22c to get more accurate results

@@             Coverage Diff              @@
##               main    #1030      +/-   ##
============================================
- Coverage     70.71%   70.51%   -0.21%     
+ Complexity     1001      997       -4     
============================================
  Files           141      141              
  Lines          4770     4768       -2     
  Branches        540      540              
============================================
- Hits           3373     3362      -11     
- Misses         1052     1062      +10     
+ Partials        345      344       -1     
Impacted Files Coverage Δ
...on/resume/TransportResumeIndexReplicationAction.kt 85.29% <100.00%> (-0.43%) ⬇️
...ication/seqno/RemoteClusterRetentionLeaseHelper.kt 66.08% <100.00%> (ø)

... and 4 files with indirect coverage changes

@monusingh-1 monusingh-1 marked this pull request as ready for review June 30, 2023 12:27
@soosinha
Copy link
Member

Can you add some description regarding why this change is being done ?

val indexShard = followerIndexService.getShard(followerShardId.id)

if (!retentionLeaseHelper.verifyRetentionLeaseExist(ShardId(params.leaderIndex, followerShardId.id), followerShardId, indexShard.lastSyncedGlobalCheckpoint+1)) {
if (!retentionLeaseHelper.verifyRetentionLeaseExist(ShardId(params.leaderIndex, followerShardId.id), followerShardId, RetentionLeaseActions.RETAIN_ALL)) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you instead remove the last argument here? and simply use RETAIN_ALL in verifyRetentionLeaseExist.

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed ✅

@monusingh-1 monusingh-1 force-pushed the retention_lease_fix2 branch from 2ada1c0 to 1cdb22c Compare July 4, 2023 05:50
@monusingh-1 monusingh-1 merged commit 66d126e into opensearch-project:main Jul 5, 2023
@opensearch-trigger-bot
Copy link

The backport to 1.1 failed:

The process '/usr/bin/git' failed with exit code 1

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-1.1 1.1
# Navigate to the new working tree
cd .worktrees/backport-1.1
# Create a new branch
git switch --create backport/backport-1030-to-1.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 66d126e626b5ddbe84d1139655478e14fb9de0be
# Push it to GitHub
git push --set-upstream origin backport/backport-1030-to-1.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.1

Then, create a pull request where the base branch is 1.1 and the compare/head branch is backport/backport-1030-to-1.1.

monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
(cherry picked from commit 66d126e)
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 5, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
(cherry picked from commit 66d126e)

Co-authored-by: Monu Singh <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
(cherry picked from commit 66d126e)

Co-authored-by: Monu Singh <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
monusingh-1 added a commit that referenced this pull request Jul 6, 2023
Avoid use of indicesService in Resume replicaiton flow.
Signed-off-by: monusingh-1 <[email protected]>
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.

4 participants