sapling/eden/mononoke/blobrepo
Stanislau Hlebik fde6230ea2 RFC: introduce FilenodeResult
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
2020-06-01 05:27:34 -07:00
..
blobsync Expose ctime from Blobstore::get() in mononoke 2020-05-06 00:55:07 -07:00
changeset_fetcher Clean out unused deps from our TARGETS files 2020-04-14 03:38:11 -07:00
errors blobrepo: add mutation store 2020-05-13 11:00:55 -07:00
factory autocargo: regenerate 2020-05-19 16:08:40 -07:00
repo_blobstore Expose ctime from Blobstore::get() in mononoke 2020-05-06 00:55:07 -07:00
src RFC: introduce FilenodeResult 2020-06-01 05:27:34 -07:00
test mononoke: improve reporting of case conflicts 2020-05-12 06:44:39 -07:00
Cargo.toml autocargo: regenerate 2020-05-19 16:08:40 -07:00