-
Notifications
You must be signed in to change notification settings - Fork 9
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
File size check when detecting changed inputs (Provide a mechanism to force cache rebuild) #108
Comments
I'm surprised we don't already detect that kind of change. In these lines we store the path, mtime, and size. When we retrieve it we only check mtime though. We also try to copy those values over from the older many-small-json cache. https://github.com/conda/conda-index/blob/main/conda_index/index/convert_cache.py#L246-L251 |
Thanks for the details. Do you think we could safely add a check on the size during the comparison with |
Yes that sounds like a good addition. We can easily test by updating the DB
with bad mtimes or sizes to see what happens.
…On Thu, Aug 24, 2023, 9:27 PM Shaun Walbridge ***@***.***> wrote:
Thanks for the details. Do you think we could safely add a check on the
size during the comparison
<https://github.com/conda/conda-index/blob/ceb9cabd1c24beff750702093322fe480e0ecd90/conda_index/index/sqlitecache.py#L481>
with (fs.mtime != cached.mtime OR fs.size != cached.size OR cached.path
IS NULL)? I rebuilt the index manually after I encountered this so I
can't directly reproduce it currently, but I can try to do so and
breakpoint into the code if that'd be helpful.
—
Reply to this email directly, view it on GitHub
<#108 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABSZETWYSOS3UVUW5QI3BTXW75QDANCNFSM6AAAAAA3B2GYMA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
OK, I was able to observe this again: if you replace a package with an exact matching name to one that is already cached, e.g. |
This excerpt from a changed-packages query checks md5 or sha256 sums, only when the upstream or 'fs' state has a non-empty checksum.
|
Checklist
What happened?
If builds are not deduplicated with the hash suffix, replacing package archives will not be detected by
conda_index
and it will provide out of date metadata. Checking on file size would be a relatively inexpensive way to detect this case, but an option to force cache recreation may be simpler to implement and not impose runtime costs for environments where hash suffixes are exclusively used.Conda Info
Conda Config
Conda list
No response
Additional Context
Removing the
.cache
directories forces a refresh, this wasn't immediately obvious to me migrating from the historicalconda index
The text was updated successfully, but these errors were encountered: