Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 60
OCPBUGS-44813: UPSTREAM: <drop>: catalog cache: retry cache population when cache contains an error#197
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
Uh oh!
There was an error while loading. Please reload this page.
OCPBUGS-44813: UPSTREAM: <drop>: catalog cache: retry cache population when cache contains an error #197
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -96,12 +96,10 @@ func TestFilesystemCachePutAndGet(t *testing.T) { | ||
| assert.NoError(t, equalFilesystems(actualFSPut, actualFSGet)) | ||
| t.Log("Put v1 error into cache") | ||
| actualFSPut, err = c.Put(catalogName, resolvedRef1, nil, errors.New("fake put error")) | ||
| // Errors do not override previously successfully populated cache | ||
| require.NoError(t, err) | ||
| require.NotNil(t, actualFSPut) | ||
| assert.NoError(t, equalFilesystems(defaultFS(), actualFSPut)) | ||
| assert.NoError(t, equalFilesystems(actualFSPut, actualFSGet)) | ||
| actualFSPut, err = c.Put(catalogName, resolvedRef1, nil, errors.New("fake v1 put error")) | ||
| // Errors for an existing resolvedRef should override previously successfully populated cache | ||
| assert.Equal(t, err, errors.New("fake v1 put error")) | ||
| assert.Nil(t, actualFSPut) | ||
Comment on lines
+99
to
+102
MemberAuthor 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. With the changes in | ||
| t.Log("Put v2 error into cache") | ||
| actualFSPut, err = c.Put(catalogName, resolvedRef2, nil, errors.New("fake v2 put error")) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple threads can't be simultaneously
Put-ing because we hold a write lock for the duration of thePutcall. This is leftover from a time when we performed this read with a read lock and then proceeded to a write lock.We also want to do the expected thing and always update the cache with the latest
Put, which ensures eventual consistency when combined with the updates made to the reconciler.