Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 locking module data store #3139
File locking module data store #3139
Changes from 2 commits
c4cad75
d4eb36a
a9dffdd
584b8f1
f1953ef
c40e2fa
e9589be
89a076d
0e49421
812da0c
caaad59
1ac3afd
ad470e5
05ea4bb
7332a7d
e7bf3cd
2b73dc4
cbf7021
427e0b5
f146b60
d162eec
8829be0
1f6c0d2
7dfa33e
c44c7ee
3916950
e98467d
6a9416a
b52c371
4266bd0
d4340a7
baa4f31
1939643
ede95e9
d5d9178
5c3baa2
44f3966
2e46398
7fa96d1
a6c476a
c520685
723e85c
61a38bb
fbd040f
4598d8c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It's really difficult to understand what the code in here is trying to accomplish now. We need specific documentation as we go, and comment within explaining what this code block is trying to accomplish. Something like "we're going to first check for X, if that's not the case, we're going to do this overwrite like this, etc etc".
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.
So
getModuleDataForModuleKey
currently only does read operations, and each step of that read is documented... we can add more documentation, but I need some clarification on which parts.As the last comment in
getModuleDataForModuleKey
addresses, validity of content is always determined bymodule.yaml
, and that is always expected to be written last.Any error and or invalid
module.yaml
is returned as an error, and then handled by fetching new data and putting it into the cache. There is nothing being overwritten/changed bygetModuleDataForModuleKey
, it is only reading the cache.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.
Can you point me to the documentation? I can't follow what is going on here.
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 don't see anywhere where invalid data is cleaned up anymore. Perhaps I missed it. What happens if I have invalid data, say file "a.proto", and the valid data is only the file "b.proto", both written to same cache directory...will "a.proto" not be there anymore? Basically, I don't understand how the deleteInvalidModuleData case is now handled. It appears to only be handled for tar files (
getModuleDataForModuleKey
callsbucket.Delete
).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.
So the validity of the contents of
v3/modules/<digest_type>/<module_key>
is determined by the presence of a validmodule.yaml
file. As documented at the end ofgetModuleDataForModuleKey
, we rely onmodule.yaml
to be written last.So the case you're describing, where there is an invalid
a.proto
but a validb.proto
, this occurs because of some interruption to the process while writinga.proto
. In which case, nomodule.yaml
would be written, this would not be considered valid, and then new data is fetched, etc.