-
Notifications
You must be signed in to change notification settings - Fork 68
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
[SYNPY-1316] Updating to caching logic to take in MD5 key #1008
Conversation
Hello @BryanFauble! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2023-11-03 23:54:15 UTC |
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.
💯 I'll take a more in depth look later, but the test cases and the code make sense. I had forgotten about the how we leverage the cachemap even when using those other parameters. Thanks @brucehoff for the catch!
We will only write to the cachemap if there is a cache miss correct?
Yes: The cachemap records the state at the time of a file download (capturing the local time stamp). So writing only occurs when a file is downloaded (when there is a "cache miss". |
Problem:
In the
.cacheMap
file there is a key-value pair of path to file for a particular file handle ID and it's associated modified time, for example:{"/home/bfauble/synapseTestFiles/bryansTestProject/temp/file_1.txt": "2023-11-03T21:46:48.000Z"}
In cases where we are downloading files into the same directory and a file with the same name is matching the current cache mechanism can incorrectly assume the file is already present in the directory and not attempt to download a new copy with
ifcollision='overwrite.local
Solution:
Testing:
.cacheMap
when the new key is and is not present and the expected cache hit/miss occurs.cacheMap
correct sees it as a cache miss