-
Notifications
You must be signed in to change notification settings - Fork 47
WIP: OCPBUGS-62517 ha replicas #709
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -106,8 +106,10 @@ func (c *Client) PopulateCache(ctx context.Context, catalog *ocv1.ClusterCatalog | |||||||||||||||||||||||||||||||||
| defer resp.Body.Close() | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if resp.StatusCode != http.StatusOK { | ||||||||||||||||||||||||||||||||||
| errToCache := fmt.Errorf("error: received unexpected response status code %d", resp.StatusCode) | ||||||||||||||||||||||||||||||||||
| return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.Ref, nil, errToCache) | ||||||||||||||||||||||||||||||||||
| // Do not cache non-200 responses (e.g. 404 from a non-leader catalogd pod). | ||||||||||||||||||||||||||||||||||
| // Returning the error directly lets the next reconcile retry a fresh HTTP | ||||||||||||||||||||||||||||||||||
| // request and eventually hit the leader. | ||||||||||||||||||||||||||||||||||
| return nil, fmt.Errorf("error: received unexpected response status code %d", resp.StatusCode) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
108
to
113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-200 responses are now hidden from cache consumers On Line 112, returning directly skips Proposed scoped fix if resp.StatusCode != http.StatusOK {
- // Do not cache non-200 responses (e.g. 404 from a non-leader catalogd pod).
- // Returning the error directly lets the next reconcile retry a fresh HTTP
- // request and eventually hit the leader.
- return nil, fmt.Errorf("error: received unexpected response status code %d", resp.StatusCode)
+ err := fmt.Errorf("error: received unexpected response status code %d", resp.StatusCode)
+ // Avoid pinning transient HA misses, but preserve error visibility for other failures.
+ if resp.StatusCode == http.StatusNotFound {
+ return nil, err
+ }
+ return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.Ref, nil, err)
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| return c.cache.Put(catalog.Name, catalog.Status.ResolvedSource.Image.Ref, resp.Body, nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2621,7 +2621,7 @@ metadata: | |
| namespace: olmv1-system | ||
| spec: | ||
| minReadySeconds: 5 | ||
| replicas: 1 | ||
| replicas: 2 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The shared Both Deployments still mount the same Also applies to: 2775-2775 🤖 Prompt for AI Agents |
||
| strategy: | ||
| type: RollingUpdate | ||
| rollingUpdate: | ||
|
|
@@ -2772,7 +2772,7 @@ metadata: | |
| name: operator-controller-controller-manager | ||
| namespace: olmv1-system | ||
| spec: | ||
| replicas: 1 | ||
| replicas: 2 | ||
| strategy: | ||
| type: RollingUpdate | ||
| rollingUpdate: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.