-
Notifications
You must be signed in to change notification settings - Fork 61
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
Bug fixes: leaderCheckpoint initialisation and retention lease issue #904
Conversation
Codecov Report
@@ Coverage Diff @@
## main #904 +/- ##
=============================================
+ Coverage 46.21% 73.05% +26.83%
- Complexity 630 1014 +384
=============================================
Files 141 141
Lines 4695 4717 +22
Branches 527 528 +1
=============================================
+ Hits 2170 3446 +1276
+ Misses 2266 942 -1324
- Partials 259 329 +70
|
@@ -290,7 +290,7 @@ open class IndexReplicationTask(id: Long, type: String, action: String, descript | |||
private suspend fun pollShardTaskStatus(): IndexReplicationState { | |||
val failedShardTasks = findAllReplicationFailedShardTasks(followerIndexName, clusterService.state()) | |||
if (failedShardTasks.isNotEmpty()) { | |||
log.info("Failed shard tasks - ", failedShardTasks) | |||
log.info("Failed shard tasks - {}", failedShardTasks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's directly use ${shardtasks}
// was at higher sequence number than the minRetainedSequenceNumber(i.e. RETAIN_ALL). | ||
// To get around this, we always renew the existing retention lease with same sequence number to increase the | ||
// expiry time. | ||
val retainedSequenceNumber = leaderIndexShard.retentionLeases.leases().filter { lease -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we consider the case for expired leases?
Rather than doing this, can we get the seqno from the commitId and use that for renewal ?
This ensures that, we are not deviating from the underlying assumption for "SYNCING" phase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i use the seqNo from commitId, then technically that can also fail with RetentionLeaseInvalidRetainingSeqNoException
.
The ideal way to do would be something like:
if (commitSeqNo > retainedSeqNo){
//use commitSeqNo
} else {
// use retainedSeqNo
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think, we should let it fail or remove the lease and add it again.
In case, we don't follow above, we can risk of loosing the operations b/w the seqno obtained from the commit-id and current seqno(which will be higher) tracked by the current lease.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to simplify this, i've removed the lease renewal as fallback. We'll simply add a lease. If lease exists, we clear the old one and retry.
I've also used RETAIN_ALL
to keep parity with the existing code..
Signed-off-by: Ankit Kala <[email protected]>
The backport to
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.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-904-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x Then, create a pull request where the |
The backport to
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.7 2.7
# Navigate to the new working tree
cd .worktrees/backport-2.7
# Create a new branch
git switch --create backport/backport-904-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-to-2.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.7 Then, create a pull request where the |
The backport to
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-904-to-1.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-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 |
The backport to
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.2 1.2
# Navigate to the new working tree
cd .worktrees/backport-1.2
# Create a new branch
git switch --create backport/backport-904-to-1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-to-1.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.2 Then, create a pull request where the |
The backport to
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.3 2.3
# Navigate to the new working tree
cd .worktrees/backport-2.3
# Create a new branch
git switch --create backport/backport-904-to-2.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-to-2.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.3 Then, create a pull request where the |
The backport to
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.5 2.5
# Navigate to the new working tree
cd .worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-904-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-to-2.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.5 Then, create a pull request where the |
The backport to
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
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-904-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
The backport to
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.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-904-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ba7d1fa303299dfd874349ee9bc117fae5b2157c
# Push it to GitHub
git push --set-upstream origin backport/backport-904-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3 Then, create a pull request where the |
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…#904) (#952) Signed-off-by: Ankit Kala <[email protected]>
…#904) (#951) Signed-off-by: Ankit Kala <[email protected]>
…#904) Signed-off-by: Ankit Kala <[email protected]>
…#904) (#951) Signed-off-by: Ankit Kala <[email protected]> (cherry picked from commit cd0a6b2)
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…opensearch-project#904) Signed-off-by: Ankit Kala <[email protected]>
…#904) (#951) Signed-off-by: Ankit Kala <[email protected]>
…#904) (#951) Signed-off-by: Ankit Kala <[email protected]> (cherry picked from commit cd0a6b2)
…#904) Signed-off-by: Ankit Kala <[email protected]>
…#904) Signed-off-by: Ankit Kala <[email protected]>
…#904) Signed-off-by: Ankit Kala <[email protected]>
Description
I've added the Integ Test for retention lease issue. For
leaderCheckpoint
, I tried adding a IT to simulate the test scenario using shard reroute but wasn't able to make it work.Issues Resolved
#900
#882
Check List
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.