A Scalable, User-Friendly Source Control System.
Go to file
Thomas Orozco 895aa3c27a mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor)
Summary:
This updates Mononoke to support LFS metadata when serving data over getpackv2.

However, in doing so, I've also refactored the various ways in which we currently access file data to serve it to clients or to process client uploads (when we need to compute deltas). The motivation to do that is that we've had several issues recently where some protocols knew about some functionality, and others didn't. Notably, redaction and LFS were supported in getfiles, but neither of them were supported in getpack or eden_get_data.

This patch refactors all those callsites away from blobrepo and instead through repo_client/remotefilelog, which provides an internal common method to fetch a filenode and return its metadata and bytes (prepare_blob), and separate protocol specific implementations for getpackv1 (includes metadata + file content -- this is basically the existing fetch_raw_filenode_bytes function), getpackv2 (includes metadata + file contents + getpackv2 metadata), getfiles (includes just file content, and ties file history into its response) and eden_get_data (which uses getpackv1).

Here are a few notable changes here that are worth noting as you review this:

- The getfiles method used to get its filenode from get_maybe_draft_filenode, but all it needed was the copy info. However, the updated method gets its filenode from the envelope (which also has this data). This should be equivalent.
- I haven't been able to remove fetch_raw_filenode_bytes yet because there's a callsite that still uses it and it's not entirely clear to me whether this is used and why. I'll look into it, but for now I left it unchanged.
- I've used the Mercurial implementation of getpack metadata here. This feels like the better approach so we can reuse some of the code, but historically I don't think we've depended on many Mercurial crates. Let me know if there's a reason not to do that.

Finally, there are a couple things to be aware of as you review:

- I removed some more `Arc<BlobRepo>` in places where it made it more difficult to call the new remotefilelog methods.
- I updated the implementation to get copy metadata out of a file envelope to not require copying the metadata into a mercurial::file::File only to immediately discard it.
- I cleaned up an LFS integration test a little bit. There are few functional changes there, but it makes tests a little easier to work with.

Reviewed By: farnz

Differential Revision: D16784413

fbshipit-source-id: 5c045d001472fb338a009044ede1e22ccd34dc55
2019-08-14 08:48:35 -07:00
apiserver mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
async-compression Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
asyncmemo Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
benchmark mononoke: add filestore params to configuration 2019-07-31 11:48:18 -07:00
blobimport_lib/src move mercurial related creates to mercurial subdirectory 2019-08-14 04:03:00 -07:00
blobrepo mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
blobrepo_utils mononoke: remove Logger from BlobRepo 2019-07-17 08:31:56 -07:00
blobstore use memcache leases in derived data implementation 2019-08-14 04:02:59 -07:00
blobstore_sync_queue mononoke: prepare to remove repo_id from blobstore_sync_queue, remove writes 2019-08-12 05:19:00 -07:00
bonsai_hg_mapping move mercurial related creates to mercurial subdirectory 2019-08-14 04:03:00 -07:00
bonsai_utils Transition fbcode Rust crates to 2018 edition 2019-06-24 13:15:17 -07:00
bookmarks rust: Head start on some upcoming warnings 2019-07-12 00:56:44 -07:00
bundle2_resolver mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
bytes-ext rust/thrift: Remove dependency of thrift runtime on folly 2019-07-12 18:09:34 -07:00
cache_warmup/src add more traces 2019-06-17 05:13:11 -07:00
changesets rust: Head start on some upcoming warnings 2019-07-12 00:56:44 -07:00
cmdlib/src mononoke: add support for fb303 and ods stats to cmdlib. use for blobstore_healer 2019-08-09 00:30:27 -07:00
cmds move mercurial related creates to mercurial subdirectory 2019-08-14 04:03:00 -07:00
common mononoke: avoid combinatoric explosion in derived_data framework 2019-07-24 11:55:34 -07:00
derived_data/src use memcache leases in derived data implementation 2019-08-14 04:02:59 -07:00
failure_ext Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
filenodes move mercurial related creates to mercurial subdirectory 2019-08-14 04:03:00 -07:00
filestore/src mononoke/filestore: remove ::* usage 2019-08-06 10:35:14 -07:00
futures-ext added bounded_traversal_dag 2019-08-05 05:41:17 -07:00
hgcli Transition fbcode Rust crates to 2018 edition 2019-06-24 13:15:17 -07:00
hgproto Log clienttelemetry data (correlator, hostname, short command) 2019-07-26 03:41:24 -07:00
hook_tailer mononoke: add filestore params to configuration 2019-07-31 11:48:18 -07:00
hooks mononoke: add filestore params to configuration 2019-07-31 11:48:18 -07:00
manifest use memcache leases in derived data implementation 2019-08-14 04:02:59 -07:00
mercurial mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
metaconfig mononoke: remove glusterblob 2019-08-07 07:37:17 -07:00
mononoke_api/src remove inefficient find_path_in_manifest 2019-06-19 09:33:50 -07:00
mononoke_types mononoke/types: clean up ContentMetadata out of FileContents 2019-08-02 03:43:16 -07:00
netstring rust: Remove extern crate from common/rust 2019-07-10 11:58:48 -07:00
phases mononoke: remove Logger from BlobRepo 2019-07-17 08:31:56 -07:00
py_tar_utils move tar_utils.py from update_rust into an open sourceable location 2017-09-14 13:52:23 -07:00
reachabilityindex mononoke: improve memory usage on mononoke startup and reduce number of small allocations 2019-07-19 04:30:26 -07:00
ready_state/src Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
repo_client mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
revset mononoke: replace Box::new with boxify() 2019-07-19 01:49:52 -07:00
server mononoke/context: don't track load if load limiting is not enabled 2019-08-12 07:32:57 -07:00
sshrelay Transition fbcode Rust crates to 2018 edition 2019-06-24 13:15:17 -07:00
tests mononoke: getpackv2 LFS support (+ getfiles / getpack / eden_get_data refactor) 2019-08-14 08:48:35 -07:00
.gitignore add .gitignore 2018-03-13 11:58:20 -07:00
.rlsconfig mononoke: add a .rlsconfig 2019-07-04 02:00:09 -07:00
.travis.yml Add travis-CI integration by adding .travis.yml file. 2018-07-26 10:09:32 -07:00
Cargo.toml mononoke: rename crates to contain underscores instead of dashes 2019-03-06 07:18:28 -08:00
CONTRIBUTING.md Initial commit 2017-07-27 18:00:19 -07:00
LICENSE Initial commit 2017-07-27 18:00:19 -07:00
packman.yml mononoke: add mononoke_exec helper script 2019-06-14 03:59:58 -07:00
README.md mononoke: simple useless change 2019-05-21 12:25:10 -07:00
rustfmt.toml provide edition in .rustfmt.toml 2019-05-29 19:55:37 -07:00

Mononoke

Mononoke is a next-generation server for the Mercurial source control system, meant to scale up to accepting thousands of commits every hour across millions of files. It is primarily written in the Rust programming language.

Caveat Emptor

Mononoke is still in early stages of development. We are making it available now because we plan to start making references to it from our other open source projects such as Eden.

The version that we provide on GitHub does not build yet.

This is because the code is exported verbatim from an internal repository at Facebook, and not all of the scaffolding from our internal repository can be easily extracted. The key areas where we need to shore things up are:

  • Full support for a standard cargo build.
  • Open source replacements for Facebook-internal services (blob store, logging etc).

The current goal is to get Mononoke working on Linux. Other Unix-like OSes may be supported in the future