-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 Store] Add file details to recoveryState while downloading segments from remote store #6825
[Remote Store] Add file details to recoveryState while downloading segments from remote store #6825
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Sample response:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
📣 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 #6825 +/- ##
============================================
+ Coverage 70.60% 70.68% +0.08%
- Complexity 59151 59228 +77
============================================
Files 4810 4810
Lines 283502 283515 +13
Branches 40884 40888 +4
============================================
+ Hits 200153 200414 +261
+ Misses 66869 66635 -234
+ Partials 16480 16466 -14
... and 505 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -4377,6 +4377,9 @@ public void close() throws IOException { | |||
* @throws IOException if exception occurs while reading segments from remote store | |||
*/ | |||
public void syncSegmentsFromRemoteSegmentStore(boolean overrideLocal) throws IOException { | |||
if (recoveryState.getStage() != RecoveryState.Stage.INDEX) { |
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 - should we add an assert here and control this from the caller itself; what I mean is that calling this method when recovery state stage is not Index is probably not the correct thing to do in the first place. By the looks, for the caller it could lead to unexpected behaviour while this call is supposed to sync segments from remote store.
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.
Agree, I am not very much convinced on adding this block here (also the part of quietly returning). In SegRep integration with remote store, this can create issues (cc: @ankitkala ). Let me think more on this.
@@ -268,7 +268,9 @@ public void copyFrom(Directory from, String src, String dest, IOContext context) | |||
in.copyFrom(new FilterDirectory(from) { | |||
@Override | |||
public IndexInput openInput(String name, IOContext context) throws IOException { | |||
index.addFileDetail(dest, l, false); | |||
if (index.getFileDetails(dest) == null) { |
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 a question - this check has been added to dedup file download? or from stats point of view?
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.
Why do we need to add this ? Is it for retries for the same file ?
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.
This check is from stats point of view. If I report the same file twice, assertion in addFileDetails
method fails.
Before downloading files, we are reporting all the files to be downloaded (new code block is added in the IndexShard
class) before the actual transfer starts.
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 then remove the assert ? Looks to be harmless .
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.
Those asserts make sure that we don't add the same file twice to the recovery tracker. IMO, that is the correct behavior. Currently, in our restore flow, we call IndexShard.syncSegmentsFromRemoteSegmentStore
twice. Even though the second time, we skip downloading the files, without the above check, it will get added to tracker again.
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.
LGTM on high level. Have left some minor comments & questions.
…ote store Signed-off-by: Sachin Kale <[email protected]>
Signed-off-by: Sachin Kale <[email protected]>
Signed-off-by: Sachin Kale <[email protected]>
Signed-off-by: Sachin Kale <[email protected]>
Signed-off-by: Sachin Kale <[email protected]>
Signed-off-by: Sachin Kale <[email protected]>
4306497
to
f15b02d
Compare
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Sachin Kale <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Sachin Kale <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
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.
LGTM. 1 minor comment .
…gments from remote store (#6825) * Use existing StatsDirectoryWrapper to record recovery stats Signed-off-by: Sachin Kale <[email protected]> (cherry picked from commit e12a5b9) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…gments from remote store (#6825) (#6976) * Use existing StatsDirectoryWrapper to record recovery stats (cherry picked from commit e12a5b9) Signed-off-by: Sachin Kale <[email protected]>
…gments from remote store (opensearch-project#6825) * Use existing StatsDirectoryWrapper to record recovery stats Signed-off-by: Sachin Kale <[email protected]> Signed-off-by: Valentin Mitrofanov <[email protected]>
Description
_cat/recovery
API provide details of progress of recovery. This helps in getting insight especially when shards are bigger in size._cat/recovery
.Issues Resolved
_cat/recovery
should provide progress of remote segment download during recovery #6821Check 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.