Skip to content

OCPBUGS-6741: refactor FBC caching (#1051) #435

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 1 commit into from
Feb 2, 2023

Conversation

grokspawn
Copy link
Contributor

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/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 27, 2023
@openshift-ci-robot
Copy link

@grokspawn: This pull request references Jira Issue OCPBUGS-6741, which is invalid:

  • expected the bug to target the "4.13.0" version, but it targets "4.13.z" instead

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

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

In response to this:

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
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added 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. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 27, 2023
@openshift-ci-robot
Copy link

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

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

Requesting review from QA contact:
/cc @jianzhangbjz

In response to this:

/jira 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.

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

openshift-ci bot commented Jan 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn

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

@grokspawn
Copy link
Contributor Author

/retest-required

1 similar comment
@grokspawn
Copy link
Contributor Author

/retest-required

@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 Jan 29, 2023
@grokspawn
Copy link
Contributor Author

/retest-required

1 similar comment
@grokspawn
Copy link
Contributor Author

/retest-required

@grokspawn
Copy link
Contributor Author

/test e2e-gcp-ovn

@grokspawn
Copy link
Contributor Author

/retest-required

1 similar comment
@grokspawn
Copy link
Contributor Author

/retest-required

@oceanc80
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 31, 2023
@grokspawn
Copy link
Contributor Author

/cherry-pick release-4.12

@openshift-cherrypick-robot

@grokspawn: once the present PR merges, I will cherry-pick it on top of release-4.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.12

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 removed the lgtm Indicates that a PR is ready to be merged. label Jan 31, 2023
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD c62913d and 2 for PR HEAD 5af8f3a in total

@grokspawn
Copy link
Contributor Author

/retest-required

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
Copy link
Contributor Author

/retest-required

1 similar comment
@grokspawn
Copy link
Contributor Author

/retest-required

@oceanc80
Copy link
Contributor

oceanc80 commented Feb 1, 2023

/lgtm

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

/retest-required

Remaining retests: 0 against base HEAD c62913d and 2 for PR HEAD bf5fac6 in total

@Xia-Zhao-rh
Copy link

/retest

1 similar comment
@grokspawn
Copy link
Contributor Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 2, 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 0c03a71 into openshift:master Feb 2, 2023
@openshift-ci-robot
Copy link

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

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

In response to this:

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-cherrypick-robot

@grokspawn: #435 failed to apply on top of branch "release-4.12":

Applying: refactor FBC caching (#1051)
Using index info to reconstruct a base tree...
M	staging/operator-registry/go.mod
M	staging/operator-registry/go.sum
M	vendor/modules.txt
Falling back to patching base and 3-way merge...
Auto-merging vendor/modules.txt
Removing vendor/github.com/operator-framework/operator-registry/pkg/registry/query.go
Removing staging/operator-registry/pkg/registry/query.go
Auto-merging staging/operator-registry/go.sum
CONFLICT (content): Merge conflict in staging/operator-registry/go.sum
Auto-merging staging/operator-registry/go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 refactor FBC caching (#1051)
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.12

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/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. 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.

7 participants