Skip to content

Bug 2002276: Remove oudated subscription update logic to improve resolution delay #211

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

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

dinhxuanvu
Copy link
Member

Currently, olm logic checks for upgrade in subscription via another
obsolete API that is no longer in use for dependency solution. As a
result, sometimes, subscriptions display UpgradeAvailable status but
there will be no upgrades as the upgrade is not valid in the resolver.
Also, the UpgradeAvailable status is used to trigger the new resolution
even though that status is no longer a valid indicator of having a pending
upgrade. This leads to unwanted upgrade delay when the obsolete API works
properly.

This commit will remove the code that is using this obsolete API and
allow the resolution to happen when there is a subscription change.

Signed-off-by: Vu Dinh [email protected]

@openshift-ci openshift-ci bot requested review from benluddy and exdx October 26, 2021 13:37
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 26, 2021
dinhxuanvu and others added 2 commits October 26, 2021 11:28
…(#2369)

Currently, olm logic checks for upgrade in subscription via another
obsolete API that is no longer in use for dependency solution. As a
result, sometimes, subscriptions display `UpgradeAvailable` status but
there will be no upgrades as the upgrade is not valid in the resolver.
Also, the `UpgradeAvailable` status is used to trigger the new resolution
even though that status is no longer a valid indicator of having a pending
upgrade. This leads to unwanted upgrade delay when the obsolete API works
properly.

This commit will remove the code that is using this obsolete API and
allow the resolution to happen when there is a subscription change.

Signed-off-by: Vu Dinh <[email protected]>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: 81e7a60bc7a62da4a469041ce89e3867e9f47fde
…ock when checking for any namespace caching errors (#2382)

Signed-off-by: timflannagan <[email protected]>
Upstream-repository: operator-lifecycle-manager
Upstream-commit: 396b5461555c2498507b1fff20fccc3e7ae15420
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 26, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu

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:

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

@dinhxuanvu dinhxuanvu changed the title Remove oudated subscription update logic to improve resolution delay Bug 2002276: Remove oudated subscription update logic to improve resolution delay Oct 27, 2021
@openshift-ci openshift-ci bot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label Oct 27, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 27, 2021

@dinhxuanvu: This pull request references Bugzilla bug 2002276, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @jianzhangbjz

In response to this:

Bug 2002276: Remove oudated subscription update logic to improve resolution delay

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 openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Oct 27, 2021
@openshift-ci openshift-ci bot requested a review from jianzhangbjz October 27, 2021 13:43
@jianzhangbjz
Copy link
Contributor

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Nov 2, 2021
@jianzhangbjz
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 2, 2021
@openshift-merge-robot openshift-merge-robot merged commit 8970fc0 into openshift:master Nov 2, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 2, 2021

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

Bugzilla bug 2002276 has been moved to the MODIFIED state.

In response to this:

Bug 2002276: Remove oudated subscription update logic to improve resolution delay

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.

err := snapshot.err
snapshot.m.Unlock()
snapshot.m.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

@dinhxuanvu One question, maybe I missed something, why not us use the defer here?

Copy link
Contributor

Choose a reason for hiding this comment

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

You wouldn't be able to use defer here as we're performing locking/unlocking operations during a for loop and the defer statement only triggers once the function finishes execution. In order to use a defer statement here, you would need to wrap the lock/unlock logic into an anonymous function:

for key, snapshot := range c.snapshots {
    func() {
        snapshot.m.RLock()
        defer snapshot.m.RUnlock()
        ...
    }
}

Copy link
Contributor

Choose a reason for hiding this comment

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

@timflannagan Thanks for your clarification! I think we should make sure the RLock can be released successfully. Actually, we met an issue: https://bugzilla.redhat.com/show_bug.cgi?id=2020486 that the status of the CatalogSource is lastObservedState: IDLE sometimes, and I checked the logs, found the warning: level=warning msg="couldn't find service in cache". I guess it's related to this PR.

@yuvalk
Copy link

yuvalk commented Nov 29, 2021

can we backport this to 4.9?

dinhxuanvu added a commit to dinhxuanvu/operator-framework-olm that referenced this pull request Jan 25, 2022
…shift#211)

The constraint EP uses `failureMessage`, not `message`. This is a
mistake that should be corrected.

Signed-off-by: Vu Dinh <[email protected]>
dinhxuanvu added a commit to dinhxuanvu/operator-framework-olm that referenced this pull request Jan 27, 2022
…shift#211)

The constraint EP uses `failureMessage`, not `message`. This is a
mistake that should be corrected.

Signed-off-by: Vu Dinh <[email protected]>

Upstream-repository: api
Upstream-commit: 160240770853d11a62b3ff721b3ffed2d8edf06d
perdasilva pushed a commit to perdasilva/operator-framework-olm that referenced this pull request Mar 4, 2022
…shift#211)

The constraint EP uses `failureMessage`, not `message`. This is a
mistake that should be corrected.

Signed-off-by: Vu Dinh <[email protected]>

Upstream-repository: api
Upstream-commit: 160240770853d11a62b3ff721b3ffed2d8edf06d
perdasilva pushed a commit to perdasilva/operator-framework-olm that referenced this pull request Mar 4, 2022
…shift#211)

The constraint EP uses `failureMessage`, not `message`. This is a
mistake that should be corrected.

Signed-off-by: Vu Dinh <[email protected]>

Upstream-repository: api
Upstream-commit: 160240770853d11a62b3ff721b3ffed2d8edf06d
@sferich888
Copy link

/cherry-pick release-4.7

@openshift-cherrypick-robot

@sferich888: #211 failed to apply on top of branch "release-4.7":

Applying: Remove oudated subscription update logic to improve resolution delay (#2369)
Using index info to reconstruct a base tree...
M	staging/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go
A	staging/operator-lifecycle-manager/pkg/controller/operators/catalog/querier.go
A	staging/operator-lifecycle-manager/pkg/controller/operators/catalog/querier_test.go
M	staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go
M	vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go
A	vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog/querier.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog/querier.go deleted in HEAD and modified in Remove oudated subscription update logic to improve resolution delay (#2369). Version Remove oudated subscription update logic to improve resolution delay (#2369) of vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog/querier.go left in tree.
Auto-merging vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go
Auto-merging staging/operator-lifecycle-manager/test/e2e/subscription_e2e_test.go
Auto-merging staging/operator-lifecycle-manager/pkg/controller/registry/resolver/querier_test.go
CONFLICT (content): Merge conflict in staging/operator-lifecycle-manager/pkg/controller/registry/resolver/querier_test.go
CONFLICT (modify/delete): staging/operator-lifecycle-manager/pkg/controller/operators/catalog/querier.go deleted in HEAD and modified in Remove oudated subscription update logic to improve resolution delay (#2369). Version Remove oudated subscription update logic to improve resolution delay (#2369) of staging/operator-lifecycle-manager/pkg/controller/operators/catalog/querier.go left in tree.
Auto-merging staging/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Remove oudated subscription update logic to improve resolution delay (#2369)
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.7

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. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants