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

fix: improve restore stability #996

Merged
merged 11 commits into from
Aug 10, 2021
Merged

fix: improve restore stability #996

merged 11 commits into from
Aug 10, 2021

Conversation

tolusha
Copy link
Contributor

@tolusha tolusha commented Aug 5, 2021

Signed-off-by: Anatolii Bazko [email protected]

What does this PR do?

  • fix problem with removing CheCluster custom resource several time
  • fix problem when restore is triggered twice

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

eclipse-che/che#20159

How to test this PR?

N/A

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@codecov
Copy link

codecov bot commented Aug 6, 2021

Codecov Report

Merging #996 (f3a025c) into main (95471df) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #996      +/-   ##
==========================================
- Coverage   50.34%   50.33%   -0.01%     
==========================================
  Files          56       56              
  Lines        6821     6822       +1     
==========================================
  Hits         3434     3434              
- Misses       3018     3019       +1     
  Partials      369      369              
Impacted Files Coverage Δ
pkg/util/util.go 13.21% <0.00%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95471df...f3a025c. Read the comment docs.

@tolusha tolusha force-pushed the 20159 branch 2 times, most recently from ecbed0a to cf918e4 Compare August 9, 2021 06:28
@tolusha tolusha changed the title build: increase timeout in backup/restore tests fix: restore is triggered twice Aug 9, 2021
Signed-off-by: Anatolii Bazko <[email protected]>
@tolusha tolusha marked this pull request as ready for review August 9, 2021 11:47
Signed-off-by: Anatolii Bazko <[email protected]>
Copy link
Contributor

@mmorhun mmorhun left a comment

Choose a reason for hiding this comment

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

Good catch!

@openshift-ci
Copy link

openshift-ci bot commented Aug 9, 2021

@tolusha: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
ci/prow/v7-single-host-nightly-deployment af7d522 link /test v7-single-host-nightly-deployment

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@tolusha tolusha marked this pull request as draft August 9, 2021 14:34
Signed-off-by: Anatolii Bazko <[email protected]>
@openshift-ci openshift-ci bot removed the lgtm label Aug 9, 2021
tolusha added 5 commits August 9, 2021 17:55
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
@tolusha tolusha changed the title fix: restore is triggered twice fix: improve restore stability Aug 10, 2021
Signed-off-by: Anatolii Bazko <[email protected]>
Signed-off-by: Anatolii Bazko <[email protected]>
@@ -316,11 +326,13 @@ func restoreCheCR(rctx *RestoreContext, dataDir string) (bool, error) {

if err := rctx.r.client.Create(context.TODO(), cheCR); err != nil {
if errors.IsAlreadyExists(err) {
return false, rctx.r.client.Delete(context.TODO(), cheCR)
return true, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a few lines comment, please, that describes when such a situation possible and what this return mean.

@@ -247,5 +246,6 @@ func (r *ReconcileCheClusterRestore) UpdateCRStatus(cr *chev1.CheClusterRestore)
logrus.Errorf("Failed to update %s CR status: %s", cr.Name, err.Error())
return err
}
logrus.Infof("Status updated with %v: ", cr.Status)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have this log at info level?

return false, nil
} else if !errors.IsNotFound(err) {
return false, err
cr, _, _ := util.FindCheCRinNamespace(rctx.r.client, rctx.namespace)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am afraid, it doesn't comply with the code above

Signed-off-by: Anatolii Bazko <[email protected]>
@openshift-ci openshift-ci bot added the lgtm label Aug 10, 2021
@openshift-ci
Copy link

openshift-ci bot commented Aug 10, 2021

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mmorhun, tolusha

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tolusha tolusha marked this pull request as ready for review August 10, 2021 13:18
@tolusha tolusha merged commit 7ff7399 into main Aug 10, 2021
@tolusha tolusha deleted the 20159 branch August 10, 2021 14:13
@che-bot che-bot added this to the 7.35 milestone Aug 10, 2021
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.

3 participants