mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
fde6230ea2
Summary: The motivation for the whole stack: At the moment if mysql is down then Mononoke is down as well, both for writes and for reads. However we can relatively easily improve the situation. During hg update client sends getpack() requests to fetch files, and currently for each file fetch we also fetch file's linknode. However hg client knows how to deal with null linknodes [1], so when mysql is unavailable we can disable filenode fetching completely and just return null linknodes. So the goal of this stack is to add a knob (i.e. a tunable) that can turn things filenode fetches on and off, and make sure the rest of the code deals nicely with this situation. Now, about this diff. In order to force callers to deal with the fact that filenodes might unavailable I suggest to add a special type of result, which (in later diffs) will be returned by every filenodes methods. This diff just introduces the FilenodeResult and convert BlobRepo filenode methods to return it. The reason why I converted BlobRepo methods first is to limit the scope of changes but at the same time show how the callers' code will look like after FilenodeResult is introduced, and get people's thoughts of whether it's reasonable or not. Another important change I'd like to introduce in the next diffs is modifying FilenodesOnlyPublic derived data to return success if filenodes knob is off. If we don't do that then any attempt to derive filenodes might fail which in turn would lead to the same problem we have right now - people won't be able to do hg update/hg pull/etc if mysql is down. [1] null linknodes might make some client side operation slower (e.g. hg rebase/log/blame), so we should use it only in sev-like situations Reviewed By: krallin Differential Revision: D21787848 fbshipit-source-id: ad48d5556e995af09295fa43118ff8e3c2b0e53e |
||
---|---|---|
.. | ||
blobsync | ||
changeset_fetcher | ||
errors | ||
factory | ||
repo_blobstore | ||
src | ||
test | ||
Cargo.toml |