Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

storage/filesystem: check file object before using cache #1056

Merged
merged 1 commit into from
Jan 30, 2019

Conversation

jfontan
Copy link
Contributor

@jfontan jfontan commented Jan 30, 2019

If the cache is shared between several repositories getFromUnpacked can erroneously return an object from other repository.

This decreases performance a little bit as there's an extra fs operation when the object is in the cache but is correct when the cache is shared.

If the cache is shared between several repositories getFromUnpacked can
erroneously return an object from other repository.

This decreases performance a little bit as there's an extra fs operation
when the object is in the cache but is correct when the cache is shared.

Signed-off-by: Javi Fontan <jfontan@gmail.com>
@jfontan jfontan force-pushed the fix/lose-objects-shared-cache branch from 34cd3cb to 51b01ef Compare January 30, 2019 17:58
@jfontan jfontan requested a review from a team January 30, 2019 18:02
@mcuadros mcuadros merged commit a1f6ef4 into src-d:master Jan 30, 2019
@filipnavara
Copy link
Contributor

filipnavara commented May 15, 2019

It makes me wonder why is it a problem that an object from another repository is returned. As long as the hash is the same you should be getting the same object. I also though that FSObject is never ending up in the cache which would pose a problem if the pack file was to disappear from the storage.

Nvm, I see the issue now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants