mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
a4b21e589f
Summary: In the next diffs we'll make it possible to disable filenodes in Mononoke. See D21787848 and attached task for more details, but TL;DR is that if xdb is down we still want to serve "hg update" traffic. If filenodes are disabled we obviously can't generate filenodes for new commits. So one option would be to just return an error from FilenodesOnlyPublic::derive(...) call. But that would mean that any attempt to call derivation would fail, and e.g. Mononoke servers won't be able to start up - (see https://fburl.com/diffusion/roau028d). We could change callers to always process errors from FilenodesOnlyPublic, but I think it would be harder to enforce and easier to forget. So this diff changes FilenodesOnlyPublic to be an enum, and FilenodesOnlyPublic::Disabled is returned immediately if filenodes are disabled. For callers it means that they can't rely on filenodes being present in db even after FilenodesOnlyPublic were derived. That's the whole of the stack, and the next diffs will update the callers to properly deal with missing filenodes. One caveat is that when we re-enable filenodes back we might need to derive them for a lot of commits. I don't expect it to happen often (i.e. if xdb is down then we probably can't commit anyway), but if somehow it happened, then we should be a bit more careful with re-enabling them after the problem was fixed. For example, we can first derive all the filenodes locally by e.g. running backfill_derived_data, and only after that has finished successfully we can re-enable them. Reviewed By: krallin Differential Revision: D21840328 fbshipit-source-id: ce9594d4a21110a5cb392c3049ccaede064c1e66 |
||
---|---|---|
.. | ||
fs | ||
integration | ||
locale | ||
mononoke | ||
scm | ||
scripts | ||
test_support | ||
test-data | ||
win | ||
.clang-format | ||
.gitignore | ||
Eden.project.toml |