Skip to content

OCPBUGS-7086: cherry-pick pull request refactor FBC caching (#1051) f… #441

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

Conversation

grokspawn
Copy link
Contributor

…rom openshift/master

refactor FBC caching (#1051)

This commit improves maintainability and extensibility of the FBC caching used to serve the GRPC API.

It:

  • introduces a new cache package and interface, which defines primitives for checking cache integrity, building the cache, and loading the cache.
  • moves the existing registry.Querier to an implementation of the cache interface, called cache.JSON

This refactor also resolves two outstanding issues:

  1. The current code contains a bug that causes panics when certain failures occur loading the cache.
  2. The current code is hardcoded to always rebuild the cache if it is unreadable or its digest doesn't contain the expected value.

This commit:

  1. Refactors and removes the cases the led to the panic situation
  2. Adds a new flag, --cache-enforce-integrity, that causes opm serve to exit with a failure if the cache is unreadable or its digest doesn't contain the expected value. This is useful in production contexts when one always expects the cache to be pre-populated correctly.

Signed-off-by: Joe Lanford [email protected]
Upstream-repository: operator-registry
Upstream-commit: 562cf9c9bc649f1df2bbae26f8b543529499b60f

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid 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. labels Feb 6, 2023
@openshift-ci-robot
Copy link

@grokspawn: This pull request references Jira Issue OCPBUGS-7086, which is valid. The bug has been moved to the POST state.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.12.z) matches configured target version for branch (4.12.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-6741 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE))
  • dependent Jira Issue OCPBUGS-6741 targets the "4.13.0" version, which is one of the valid target versions: 4.13.0
  • bug has dependents

Requesting review from QA contact:
/cc @Xia-Zhao-rh

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

…rom openshift/master

refactor FBC caching (#1051)

This commit improves maintainability and extensibility of the FBC caching used to serve the GRPC API.

It:

  • introduces a new cache package and interface, which defines primitives for checking cache integrity, building the cache, and loading the cache.
  • moves the existing registry.Querier to an implementation of the cache interface, called cache.JSON

This refactor also resolves two outstanding issues:

  1. The current code contains a bug that causes panics when certain failures occur loading the cache.
  2. The current code is hardcoded to always rebuild the cache if it is unreadable or its digest doesn't contain the expected value.

This commit:

  1. Refactors and removes the cases the led to the panic situation
  2. Adds a new flag, --cache-enforce-integrity, that causes opm serve to exit with a failure if the cache is unreadable or its digest doesn't contain the expected value. This is useful in production contexts when one always expects the cache to be pre-populated correctly.

Signed-off-by: Joe Lanford [email protected]
Upstream-repository: operator-registry
Upstream-commit: 562cf9c9bc649f1df2bbae26f8b543529499b60f

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 requested a review from Xia-Zhao-rh February 6, 2023 15:23
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 6, 2023

@grokspawn: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

Retaining the bugzilla/valid-bug label as it was manually added.

In response to this:

OCPBUGS-7086: cherry-pick pull request refactor FBC caching (#1051) f…

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 requested review from anik120 and benluddy February 6, 2023 15:29
…rom openshift/master

refactor FBC caching (#1051)

This commit improves maintainability and extensibility of the FBC
caching used to serve the GRPC API.

It:
- introduces a new cache package and interface, which defines
  primitives for checking cache integrity, building the cache, and
  loading the cache.
- moves the existing registry.Querier to an implementation of the cache
  interface, called cache.JSON

This refactor also resolves two outstanding issues:
1. The current code contains a bug that causes panics when certain
   failures occur loading the cache.
2. The current code is hardcoded to always rebuild the cache if it is
   unreadable or its digest doesn't contain the expected value.

This commit:
1. Refactors and removes the cases the led to the panic situation
2. Adds a new flag, --cache-enforce-integrity, that causes `opm serve`
   to exit with a failure if the cache is unreadable or its digest
   doesn't contain the expected value. This is useful in production
   contexts when one always expects the cache to be pre-populated
   correctly.

Signed-off-by: Joe Lanford <[email protected]>
Upstream-repository: operator-registry
Upstream-commit: 562cf9c9bc649f1df2bbae26f8b543529499b60f
@grokspawn grokspawn force-pushed the opm-refactor-caching branch from bf071c2 to 7db6517 Compare February 6, 2023 15:31
@Xia-Zhao-rh
Copy link

/retest

@Xia-Zhao-rh
Copy link

LGTM, verified.
Detail: https://issues.redhat.com/browse/OCPBUGS-7086

@Xia-Zhao-rh
Copy link

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Feb 7, 2023
@Xia-Zhao-rh
Copy link

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Feb 7, 2023
@grokspawn
Copy link
Contributor Author

/test e2e-upgrade

@Xia-Zhao-rh
Copy link

/retest

3 similar comments
@grokspawn
Copy link
Contributor Author

/retest

@grokspawn
Copy link
Contributor Author

/retest

@Xia-Zhao-rh
Copy link

/retest

@grokspawn
Copy link
Contributor Author

/approve

@oceanc80
Copy link
Contributor

/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Feb 10, 2023
@oceanc80
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2023
@oceanc80
Copy link
Contributor

/approve

1 similar comment
@gallettilance
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gallettilance, grokspawn, oceanc80

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2023
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 2fe8e47 and 2 for PR HEAD 7db6517 in total

@grokspawn
Copy link
Contributor Author

/retest

1 similar comment
@grokspawn
Copy link
Contributor Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 14, 2023

@grokspawn: all tests passed!

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.

@openshift-merge-robot openshift-merge-robot merged commit 2fbb6fb into openshift:release-4.12 Feb 14, 2023
@openshift-ci-robot
Copy link

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

Jira Issue OCPBUGS-7086 has been moved to the MODIFIED state.

In response to this:

…rom openshift/master

refactor FBC caching (#1051)

This commit improves maintainability and extensibility of the FBC caching used to serve the GRPC API.

It:

  • introduces a new cache package and interface, which defines primitives for checking cache integrity, building the cache, and loading the cache.
  • moves the existing registry.Querier to an implementation of the cache interface, called cache.JSON

This refactor also resolves two outstanding issues:

  1. The current code contains a bug that causes panics when certain failures occur loading the cache.
  2. The current code is hardcoded to always rebuild the cache if it is unreadable or its digest doesn't contain the expected value.

This commit:

  1. Refactors and removes the cases the led to the panic situation
  2. Adds a new flag, --cache-enforce-integrity, that causes opm serve to exit with a failure if the cache is unreadable or its digest doesn't contain the expected value. This is useful in production contexts when one always expects the cache to be pre-populated correctly.

Signed-off-by: Joe Lanford [email protected]
Upstream-repository: operator-registry
Upstream-commit: 562cf9c9bc649f1df2bbae26f8b543529499b60f

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.

@grokspawn grokspawn deleted the opm-refactor-caching branch February 15, 2023 13:33
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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. 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. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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.

9 participants