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

[1.10] Fix issue 5696 #5714

Merged
merged 1 commit into from
Dec 22, 2022
Merged

Conversation

Lyndon-Li
Copy link
Contributor

Fix issue 5696, check if the repo is still openable before running the prune and forget operation, if it is not, try to reconnect the repo

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2022

Codecov Report

Merging #5714 (1b84610) into release-1.10 (f2fe0f6) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@               Coverage Diff                @@
##           release-1.10    #5714      +/-   ##
================================================
- Coverage         40.85%   40.83%   -0.03%     
================================================
  Files               239      239              
  Lines             20629    20662      +33     
================================================
+ Hits               8429     8437       +8     
- Misses            11582    11608      +26     
+ Partials            618      617       -1     
Impacted Files Coverage Δ
pkg/repository/manager.go 18.04% <0.00%> (-0.86%) ⬇️
pkg/repository/provider/restic.go 0.00% <0.00%> (ø)
pkg/repository/provider/unified_repo.go 54.16% <0.00%> (-4.05%) ⬇️
pkg/restore/restore.go 64.66% <0.00%> (+0.55%) ⬆️

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

}

bkRepo, err := urp.repoService.Open(ctx, *repoOption)
if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

BoostRepoConnect which means that we first need to close the repo and then reconnect no matter if it could be connected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We try to connect the repo only when urp.repoService.Open fails, the open is for a test purpose.
There is no reconnect, if urp.repoService.Open succeeds, it means the repo has already been connected, so quit at line 228; otherwise, the repo may has not been connected, so call urp.ConnectToRepo.
urp.repoService.Open may fail for other reasons, this is out of the scope of this function to fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

first Open the repo, if no error, it will close the repo at L224.
So the repo will be closed before you do Forget, PruneRepo action?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The call of urp.repoService.Open in function BoostRepoConnect for test purpose only, outside BoostRepoConnect, the caller will open the repo again own their own

@qiuming-best qiuming-best merged commit b73914d into vmware-tanzu:release-1.10 Dec 22, 2022
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