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

Bug 1882394: Delete lock created by CSO 4.6 #91

Merged
merged 1 commit into from Sep 30, 2020

Conversation

bertinatto
Copy link
Member

@bertinatto bertinatto commented Sep 21, 2020

Leader-for-life leader election causes problems when downgrading from CSO 4.6, which uses library-go and doesn't set an ownerReference in the ConfigMap metadata.

This patch identifies if the lock was created by CSO 4.6 and, if so, deletes it so that CSO 4.5 can become the leader using the leader-for-life model.

More on the the problem:

On a downgrade from 4.5 to 4.6 scenario, the leader election ConfigMap is created by CSO 4.6 (library-go) and it doesn't have any ownerReference set.

However, CSO 4.5 uses operator-sdk with leader-for-life election approach, and it expects that the ConfigMap either doesn't exist or exists but has an ownerReference set (in order to know whether the lock belongs to it or not).

Since it doesn't find any, it tries to create one, but it gets back an error stating the the object already exists. Therefore, CSO 4.5 thinks that the lock belongs to somebody else and it never starts. This goes on forever and CSO 4.5 never become the leader.

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label Sep 21, 2020
@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1877316, which is invalid:

  • expected the bug to target the "4.5.z" release, but it targets "4.6.0" instead
  • expected Bugzilla bug 1877316 to depend on a bug targeting a release in 4.6.0, 4.6.z and in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1877316: Use leader-with-lease rather than leader-for-life

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Sep 21, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 21, 2020
@bertinatto
Copy link
Member Author

/hold
To be tested.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 21, 2020
@bertinatto
Copy link
Member Author

/retest

@bertinatto
Copy link
Member Author

/launch aws

@bertinatto
Copy link
Member Author

/test launch-aws

@openshift-ci-robot
Copy link
Contributor

@bertinatto: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test e2e-aws
  • /test e2e-aws-upgrade
  • /test images
  • /test unit
  • /test verify

Use /test all to run all jobs.

In response to this:

/test launch-aws

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.

@bertinatto
Copy link
Member Author

/test launch-gcp

@openshift-ci-robot
Copy link
Contributor

@bertinatto: The specified target(s) for /test were not found.
The following commands are available to trigger jobs:

  • /test e2e-aws
  • /test e2e-aws-upgrade
  • /test images
  • /test unit
  • /test verify

Use /test all to run all jobs.

In response to this:

/test launch-gcp

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.

@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1877316, which is invalid:

  • expected the bug to target the "4.5.z" release, but it targets "4.6.0" instead
  • expected Bugzilla bug 1877316 to depend on a bug targeting a release in 4.6.0, 4.6.z and in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1877316: Use leader-with-lease rather than leader-for-life

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.

@bertinatto bertinatto changed the title Bug 1877316: Use leader-with-lease rather than leader-for-life Bug 1877316: Delete lock created by CSO 4.6 Sep 24, 2020
@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1877316, which is invalid:

  • expected the bug to target the "4.5.z" release, but it targets "4.6.0" instead
  • expected Bugzilla bug 1877316 to depend on a bug targeting a release in 4.6.0, 4.6.z and in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1877316: Delete lock created by CSO 4.6

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.

@bertinatto
Copy link
Member Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1877316, which is invalid:

  • expected Bugzilla bug 1877316 to depend on a bug targeting a release in 4.6.0, 4.6.z and in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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.

@bertinatto bertinatto changed the title Bug 1877316: Delete lock created by CSO 4.6 Bug 1882394: Delete lock created by CSO 4.6 Sep 24, 2020
@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1882394, which is invalid:

  • expected dependent Bugzilla bug 1877316 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but it is ASSIGNED instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1882394: Delete lock created by CSO 4.6

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.

Comment on lines 103 to 104
// We don't exit if an error happens, but we let the operator
// try to become the leader below. If it doesn't succeed, then we exit
Copy link
Contributor

Choose a reason for hiding this comment

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

In https://bugzilla.redhat.com/show_bug.cgi?id=1877316 we saw 4.5 CSO trying to become leader for 3 hours without exiting. There should be either timeout for leader.Become or CSO should exit here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was expecting that on line 109 below it would os.Exit(1) if CSO couldn't become the leader, but operator-sdk doesn't return an error the ConfigMap already exists:

https://github.com/bertinatto/cluster-storage-operator/blob/1b1fae52bda9667b7b9bf7da7397c88a82faa4cc/vendor/github.com/operator-framework/operator-sdk/pkg/leader/leader.go#L124-L131

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, PTAL

@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1882394, which is invalid:

  • expected dependent Bugzilla bug 1877316 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but it is CLOSED (CURRENTRELEASE) instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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.

@bertinatto
Copy link
Member Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1882394, which is invalid:

  • expected the bug to be open, but it isn't
  • expected the bug to be in one of the following states: NEW, ASSIGNED, ON_DEV, POST, POST, but it is CLOSED (NOTABUG) instead
  • expected Bugzilla bug 1882394 to depend on a bug targeting a release in 4.6.0, 4.6.z and in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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.

@bertinatto
Copy link
Member Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@bertinatto: This pull request references Bugzilla bug 1882394, which is invalid:

  • expected Bugzilla bug 1882394 to depend on a bug targeting a release in 4.6.0, 4.6.z and in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but no dependents were found

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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.

errWait := wait.PollImmediate(time.Second*10, time.Minute*5, func() (bool, error) {
err := tryDeleteIncompatibleLock(cfg, lockName)
if err != nil {
return false, err
Copy link
Contributor

Choose a reason for hiding this comment

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

Please log the error.

  • log.Error(errWait, ... below logs Deadline exceeded or some timeout message, not the API error
  • It would be better to get some error logged before 5 minute timeout, users are not that patient.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added log

On a downgrade from 4.6 to 4.5 scenario, the leader
election ConfigMap is created by CSO 4.6 (library-go)
and it doesn't have any `ownerReference` set.

However, CSO 4.5 uses `operator-sdk` with
leader-for-life election approach, and it expects
that the ConfigMap either doesn't exist or
exists but has an `ownerReference` set (in order
to know whether the lock belongs to it or not).

Since it doesn't find any, it tries to create one,
but it gets back an error stating the the object
already exists. This goes on forever and CSO 4.5
never become the leader.

This patch identifies if the lock was created
by CSO 4.6 and, if so, deletes it so that CSO 4.5
can become the leader using the leader-for-life model
@jsafrane
Copy link
Contributor

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bertinatto, jsafrane

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [bertinatto,jsafrane]

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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 25, 2020
@jsafrane
Copy link
Contributor

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@jsafrane: This pull request references Bugzilla bug 1882394, which is invalid:

  • expected dependent Bugzilla bug 1877316 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but it is CLOSED (CURRENTRELEASE) instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

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.

@jsafrane jsafrane added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Sep 25, 2020
@jsafrane
Copy link
Contributor

Using my team lead superpowers to add valid-bug label: there is nothing to fix in 4.6

@bertinatto
Copy link
Member Author

/retest
resize flake

@jsafrane
Copy link
Contributor

/retest

@bertinatto
Copy link
Member Author

/retest

[sig-apps][Feature:DeploymentConfig] deploymentconfigs adoption will orphan all RCs and adopt them back when recreated 

[sig-storage] In-tree Volumes [Driver: aws] [Testpattern: Inline-volume (ext3)] volumes should store data

@jsafrane
Copy link
Contributor

/hold cancel
Most of the test pass and CSO is installed.

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 25, 2020
@bertinatto
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@bertinatto
Copy link
Member Author

/retest

@ashcrow ashcrow added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Sep 30, 2020
@openshift-merge-robot openshift-merge-robot merged commit ca9cb18 into openshift:release-4.5 Sep 30, 2020
@openshift-ci-robot
Copy link
Contributor

@bertinatto: All pull requests linked via external trackers have merged:

Bugzilla bug 1882394 has been moved to the MODIFIED state.

In response to this:

Bug 1882394: Delete lock created by CSO 4.6

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants