Repository navigation
bugfix: if used cache, when delete a repository, should clear the cache, otherwise, can not push this repository again. - #3323
dk-lockdown wants to merge 1 commit into
Conversation
|
@dk-lockdown thanks for the PR. Can you please add DCO signature as per contribution guidelines |
signed |
|
@wy65701436 can you help me review this pr? thanks. |
|
Hi @dk-lockdown , Thanks. |
1a9abe6 to
103c8ff
Compare
this problem solved,clear the cache when gc. |
103c8ff to
47f696d
Compare
The trouble is distribution have two caches, one is global cache, one is repository scope cache. |
|
Do you want to rebase @dk-lockdown |
4b3feb0 to
3b250a1
Compare
rebased! |
e6dc63b to
0b3ffb2
Compare
Signed-off-by: scott lewis <[email protected]>
0b3ffb2 to
651158b
Compare
|
@milosgajdos this pr need a review |
Jamstah
left a comment
There was a problem hiding this comment.
One thing missing from this PR is a test case.
Also, as the garbage collection runs in a separate process, I'm not sure this will actually clear an in-memory cache successfully. I expect it could clear a redis cache.
Overall, garbage collection is designed to be run while the registry is in readonly or stopped. To switch to read only (and back) means a restart of the registry process. This means for an in-memory cache, if the registry is being administered correctly, it would be cleared after GC anyway.
This PR should also update the documentation, perhaps both the garbage collection page and the caching configuration option, to explain what the registry administrator needs to know.
| return err | ||
| } | ||
|
|
||
| // See https://github.com/docker/distribution/issues/3322 to get more detail |
There was a problem hiding this comment.
The comment should explain the code. It can also link to a work item if you like, but the explanation should be in here.
|
Ping @dk-lockdown |
| return err | ||
| } | ||
|
|
||
| // See https://github.com/docker/distribution/issues/3322 to get more detail |
There was a problem hiding this comment.
Cache can be currently cleared in cachedBlobStatter.Clear(). Maybe we should have used cachedBlobStatter in the first place?
|
|
||
| dcontext.GetLogger(v.ctx).Infof("Deleting blob: %s", blobPath) | ||
|
|
||
| if v.blobDescriptorCacheProvider != nil { |
There was a problem hiding this comment.
Is it really a responsibility of GC to clear cache? I think it should already be cleared at this point
ref: #3322
Signed-off-by: 刘晓敏 [email protected]