Commit Graph

8094 Commits

Author SHA1 Message Date
Stefan Filip
4f70ffdff8 dag: update IdDag::universal_id visibility to public
Summary:
This function is useful in the mononoke to compute the universal commit idmap
that is required for clone.

Reviewed By: quark-zju

Differential Revision: D24808327

fbshipit-source-id: 0cccd59bd7982dd0bc024d5fc85fb5aa5eafb831
2020-11-10 16:47:23 -08:00
Stefan Filip
d00281f8dc dag: add IdDag::flat_segments
Summary:
`flat_segments` are going to be used to generate CloneData. These segments will
be sent to a client repository and are going to bootstrap the iddag.

Reviewed By: quark-zju

Differential Revision: D24808331

fbshipit-source-id: 00bf9723a43bb159cd98304c2c4c6583988d75aa
2020-11-10 16:47:23 -08:00
Stefan Filip
bff5a9ba29 dag: add CloneData
Summary: This is the object that will be used to bootstrap a Dag after a clone.

Reviewed By: quark-zju

Differential Revision: D24808328

fbshipit-source-id: 2c7e97c027c84a11e8716f2e288500474990169b
2020-11-10 16:47:23 -08:00
Stefan Filip
40333a545f dag: rename AssignHeadOutcome to PreparedFlatSegments
Summary:
The goal is to reused the functionality provided by AssignHeadOutcome for clone
purposes.

Reviewed By: quark-zju

Differential Revision: D24717924

fbshipit-source-id: e88f21ee0d8210e805e9d6896bc8992009bd7975
2020-11-10 16:47:23 -08:00
Xavier Deguillard
34598d4337 remove dependency on glog
Summary:
The EdenFS codebase uses folly/logging/xlog to log, but we were still relying
on glog for the various CHECK macros. Since xlog also contains equivalent CHECK
macros, let's just rely on them instead.

This is mostly codemodded + arc lint + various fixes to get it compile.

Reviewed By: chadaustin

Differential Revision: D24871174

fbshipit-source-id: 4d2a691df235d6dbd0fbd8f7c19d5a956e86b31c
2020-11-10 16:31:15 -08:00
Katie Mancini
6e3d9d272e fix eden top on mac
Summary:
There were `eden top` issues on MacOS that I thought had been fixed a while ago,
but it doesn't look like we caught them all. This should catch the remaining bug
in `eden top`.

Reviewed By: genevievehelsel

Differential Revision: D23743199

fbshipit-source-id: ca66748c7a8a26062caf934c8f2c1fd13d9ae69e
2020-11-10 15:30:29 -08:00
Xavier Deguillard
f3b0124f01 prjfs: use a shared_ptr for the context
Summary:
In order to allow request to timeout to display notifications to the user, the
`within` future method will need to be called on the various callback futures.
Unfortunately, once the timeout expires, the underlying future isn't cancelled
and stopped, but the unique pointer holding the context will be reclaimed.
Whenever the future actually completes, it will try to use an invalid pointer,
crashing EdenFS.

To solve this, switch to using a shared_ptr and copy it in the right places so
it will only be freed once all futures holding a reference to it will be gone.

I also took the opportunity to reduce the nesting a bit to make the code more
readable.

Reviewed By: kmancini

Differential Revision: D24809647

fbshipit-source-id: 987d6e5763106fabc6bed3ea00d28b129b5285a1
2020-11-10 09:59:25 -08:00
Xavier Deguillard
4626f30206 utils: actually return an HRESULT from exceptionToHResult
Summary: These errors are Win32 errors, we need to wrap them into a HRESULT.

Reviewed By: chadaustin

Differential Revision: D24809646

fbshipit-source-id: 9f42b9d0c43474967dc26cb2c14cbee463768b79
2020-11-10 09:59:25 -08:00
Robin Håkanson
64523f39c1 Convinience access functions for BonsaiDiffFileChange
Summary: Convinience access functions for BonsaiDiffFileChange

Reviewed By: krallin

Differential Revision: D24715052

fbshipit-source-id: 6eac5dd8ff4ec21a59c82ebe5d3b39386f57baea
2020-11-10 09:39:29 -08:00
Egor Tkachenko
99643e0409 Added verification of generated bonsai changeset between backup and prod repos during blobimport
Summary: It is possible that hash of newly created bonsai_changeset will be different from what is in prod repo. In this case let's fetch bonsai from the prod, to make backup repo consistent with prod.

Reviewed By: StanislavGlebik

Differential Revision: D24593003

fbshipit-source-id: 70496c59927dae190a8508d67f0e3d5bf8d32e5c
2020-11-10 08:46:16 -08:00
Alex Hornby
7c33ddab42 mononoke: use create_graph to generate EdgeType enum in walker
Summary: Use create_graph to generate EdgeType enum in walker to reduce boiler plate needed when adding new derived node and edge types to the walker

Differential Revision: D24687827

fbshipit-source-id: 63337f4136c649948e0d3039529965c296c6d67e
2020-11-10 08:26:54 -08:00
Alex Hornby
72006da99d mononoke: add edge support to create_graph macro
Summary: Prepare for populating edge types programmatically from create_graph

Differential Revision: D24687830

fbshipit-source-id: be109b1dd45ef6cc398b0f7658d9168e8286699c
2020-11-10 08:26:54 -08:00
Lukas Piatkowski
3b6d8c2c0a rust-shed/futures_ext: add .return_remainder similar to futures_01_ext
Summary: Also use the 0.3 compatible .return_remainder in unbundle.

Reviewed By: ikostia

Differential Revision: D24729464

fbshipit-source-id: ede5cc60f4b872a3b968cf14bb0e2c5d9b85c242
2020-11-10 07:40:14 -08:00
Mark Juggurnauth-Thomas
6b0c3cfef7 mononoke_types: don't allocate and format error string on good path
Summary:
When finishing a hash computation for a blob, we currently call `format!` to allocate
and format the error string before calling `.expect` on the `write_all` result.

In practice this will never fail, so this is wasted work.  From experimentation on
the playground, the Rust compiler does not appear to be smart enough to optimize this
away, either.

A small optimization, but let's get rid of this by calling panic directly, and
only in the failure path.

Reviewed By: farnz

Differential Revision: D24857833

fbshipit-source-id: e3e35b402ca3a9f6c9d8fbbd758cc486ef1c5566
2020-11-10 07:12:33 -08:00
Mateusz Kwapich
10bc4843d3 new mode to reverse-fill bookmarks
Summary:
Adds `--reversefill` mode to bookmarks filler that fetches bookmark updates
from the queue and syncs them to infinitepush database.

Reviewed By: farnz

Differential Revision: D24538317

fbshipit-source-id: 5ac7ef601f2ff120c4efd8df08a416e00df0ceb9
2020-11-10 02:58:00 -08:00
Mateusz Kwapich
89fd335b1e populate bookmark filler queue on scratch bookmark updates
Summary:
Summarry:
This is the first part of syncing new scratch bookmark pushes from Mononoke to
Mercurial: on each bookmark movement we log this bookmark movement to filler's
queue.

Reviewed By: liubov-dmitrieva

Differential Revision: D24480546

fbshipit-source-id: 27103b4b4f8c4600aaf485826db2936eaffcc4a9
2020-11-10 02:58:00 -08:00
Alex Hornby
6d316abaf3 mononoke: fix naming for BonsaiToRootFsnode EdgeTypes in walker
Summary: Make the naming of bonsai fsnode edge variants consistent with the other edges in preparation for building them programmatically from a macro

Reviewed By: krallin

Differential Revision: D24687833

fbshipit-source-id: 8d46a53c023a4b8f95c0edc42df86e467c054ebb
2020-11-09 10:26:48 -08:00
Alex Hornby
39f27ef010 mononoke: fix naming for linknode EdgeTypes in walker
Summary: Make the naming of linknode edge variants consistent with the other edges in preparation for building them programmatically from a macro

Reviewed By: krallin

Differential Revision: D24687832

fbshipit-source-id: 46525d7bebd17723a130a70f566b24104cc39656
2020-11-09 10:26:47 -08:00
Alex Hornby
2f4bc233d4 mononoke: use macro to implement Node::get_type() in walker
Summary:
Use macro to implement Node::get_type() in walker.

Reduces the boiler plate when adding new types to the graph.

Reviewed By: farnz

Differential Revision: D24687826

fbshipit-source-id: 5f89c6fb69fd9df3fff25a2425a4d2035dbf5ed9
2020-11-09 10:26:47 -08:00
Alex Hornby
4b3bc9f285 mononoke: generate NodeType::root_edge_type() from macro in walker
Summary: Generate NodeType::root_edge_type() so less boiler plate when adding new types to the walk.

Reviewed By: farnz

Differential Revision: D24687825

fbshipit-source-id: 083fc57aee8fe01b29ad4a6f9ebe660cc057dfab
2020-11-09 10:26:47 -08:00
Alex Hornby
804dbe3a6c mononoke: define walker graph with macro to reduce repetition
Summary:
Define walker graph with macro to reduce repetition which should make adding new derived data types simpler.

Specifically, this removes the duplication between NodeType and Node

Reviewed By: farnz

Differential Revision: D24687831

fbshipit-source-id: 97d67faf02b2a88bb871dc0388d75d3dd3e8528d
2020-11-09 10:26:47 -08:00
Alex Hornby
8673a9387a mononoke: use strum EnumCount instead of own macros
Summary: use strum EnumCount instead of own macros,  can remove some code. This needed strum upgrade to 0.19

Reviewed By: krallin

Differential Revision: D24680441

fbshipit-source-id: 56e5b66f75c3d8ff949685c26f503571873c0cde
2020-11-09 10:26:47 -08:00
Alex Hornby
1d44f3a2b3 rust: update to strum 0.19
Summary: Update to strum 0.19 as it has improved EnumCount derivation

Reviewed By: mohanz

Differential Revision: D24680442

fbshipit-source-id: 2d3d2a84e994f09bf3b1c7ea748a80a67d100c13
2020-11-09 10:26:47 -08:00
Mark Juggurnauth-Thomas
4909562fe9 derived_data_test_utils: move test_utils to derived_data and update to new futures
Summary:
`manifest/test_utils` contains test utilities that are only used by derived data, and only one
of which relates to manifests.  Its name (`test_utils`) is also confusing with `tests/utils`.

Move it to `derived_data_test_utils`, and update it to new futures.

Reviewed By: mitrandir77

Differential Revision: D24787536

fbshipit-source-id: 7a4a735132ccf81e3f75683c7f44c9ada11bc9d7
2020-11-09 07:23:51 -08:00
Alex Hornby
6091d25bee mononoke: reduce visibility of add_* functions that MononokeApp controls
Summary:
Reduce visibility of add_* functions that MononokeApp controls, no need for them to be public.

Updated a couple of binaries to use MononokApp.with_fb303_args() instead of calling the add_fb303 function directly.

Reviewed By: krallin

Differential Revision: D24757202

fbshipit-source-id: a068ca4fd976429e7c02c4049429553cc8acf3d4
2020-11-09 02:25:25 -08:00
Alex Hornby
08595c74a1 mononoke: update benchmark to be MononokeApp
Summary: benchmark is the last remaining user of args::add_cachelib_args outside of MononokeApp,  switch it to use MononokeApp instead.

Reviewed By: krallin

Differential Revision: D24755785

fbshipit-source-id: c105b4443394c88b6effdac382089e7eaca65bfe
2020-11-09 02:25:24 -08:00
Alex Hornby
f28a33a86e mononoke: make MononokeApp arguments more configurable
Summary: make MononokeApp arguments more configurable so binaries can opt out of them if a section does not apply,  making the --help more relevant.

Reviewed By: krallin

Differential Revision: D24757007

fbshipit-source-id: eed2f321bdbd04208567ef9a45cf861e56cdd07e
2020-11-09 02:25:24 -08:00
Stanislau Hlebik
d59b6d61e9 mononoke: make hash_validation_percentage a tunable
Summary:
Previously it was a config knob, but they are rather hard to change because
they require a restart of the service. Let's make it a tunable instead.

Reviewed By: farnz

Differential Revision: D24682129

fbshipit-source-id: 9832927a97b1ff9da49c69755c3fbdc1871b3c5d
2020-11-09 02:25:24 -08:00
Jun Wu
d89311e478 Back out "log: backout D24293498 about prefetching commit data"
Summary:
The original problem was a fastlog bug, solved by D24513444 (c3bcc1ab88).

Restores prefetching for phabricator status so `hg ssl` and `hg fssl` become fast again.

Original commit changeset: b10c4caf8fda

Reviewed By: sfilipco

Differential Revision: D24749774

fbshipit-source-id: fa14f7dde9c922733525a7ff014efc32875426fa
2020-11-06 16:25:00 -08:00
Jun Wu
c6741e4c3a Back out "smartset: back out use Rust reentrant generator for generatorset"
Summary:
The original issue was a rust-cpython bug, solved by D24698226, or https://github.com/dgrunwald/rust-cpython/pull/244.

Original commit changeset: 08f598df0892

Reviewed By: sfilipco

Differential Revision: D24759765

fbshipit-source-id: f9a1359cfce68c8754ddd1bcb8bfc54bf75af7ff
2020-11-06 16:25:00 -08:00
Stanislau Hlebik
7b1746907e mononoke: initialize with_seq at the beginning of request handling
Reviewed By: ahornby

Differential Revision: D24788666

fbshipit-source-id: 25b2d854b96bc1ada42739fe0f94e20355a4d61b
2020-11-06 15:25:06 -08:00
Stanislau Hlebik
e7fe9e4ea9 mononoke: do not allow too big commits to be landed
Reviewed By: krallin

Differential Revision: D24730106

fbshipit-source-id: e2b116c437a557f1b795c3b07eb124b8dd1a3ef8
2020-11-06 11:24:19 -08:00
Thomas Orozco
447217c840 mononoke/filestore: update fetch to use 0.3 futures
Summary:
This updates the last bit of the Filestore that was using 0.1 futures to 0.3.
This used to use a weighted buffered stream (which we don't have for 0.3
futures at this point), but as I started working on one I realized we don't
even need it here, so I took this out.

Reviewed By: StanislavGlebik

Differential Revision: D24735907

fbshipit-source-id: 00a55c14864b09f9c353f95f2f8cbb895cf52791
2020-11-06 07:26:04 -08:00
Thomas Orozco
26e06ef1a0 mononoke/filestore: update fetch methods to return 0.3 stream
Summary:
This updates the external facing API of the filestore to use 0.3 streams.
Internally, there is still a bit of 0.3 streams, but as of this change, it's
all 0.3 outside.

This required a few changes here and there in places where it was simpler to
just update them to use 0.3 futures instead of `compat()`-ing everything.

Reviewed By: ikostia

Differential Revision: D24731298

fbshipit-source-id: 18a1dc58b27d129970a6aa2d0d23994d5c5de6aa
2020-11-06 07:26:04 -08:00
Thomas Orozco
8cad2ed3f2 mononoke/filestore: update exists() to futures 0.3
Summary: Like it says in the title.

Reviewed By: StanislavGlebik

Differential Revision: D24731300

fbshipit-source-id: b9c44fc1e4bd4cfe8655e1024a0547e40fb99424
2020-11-06 07:26:03 -08:00
Thomas Orozco
184310158b mononoke/filestore: update fetch external API to 0.3 futures
Summary:
Like it says in the title. This required quite a lot of changes at callsites,
as you'd expect.

Reviewed By: StanislavGlebik

Differential Revision: D24731299

fbshipit-source-id: e58447e88dcc3ba1ab3c951f87f7042e2b03eb2c
2020-11-06 07:26:03 -08:00
Thomas Orozco
b6949dbc26 mononoke/filestore: update store to futures 0.3
Summary: Like it says in the title. This updates `store()` and its (many) callsites.

Reviewed By: ahornby

Differential Revision: D24728658

fbshipit-source-id: 5fccf76d25e58eaf069f3f0cf5a31d2c397687ea
2020-11-06 07:26:03 -08:00
Thomas Orozco
a9b64b93c5 mononoke/filestore: update rechunk module to futures 0.3
Summary: Not much to be seen here.

Reviewed By: ahornby

Differential Revision: D24727257

fbshipit-source-id: d97b68544d53cfe32eb11caab73535d9be16ad11
2020-11-06 07:26:03 -08:00
Thomas Orozco
8e7bf512a5 mononoke/filestore: convert alias module to futures 0.3
Summary: Like it says in the title. Not much to be said here.

Reviewed By: ahornby

Differential Revision: D24727256

fbshipit-source-id: 1645339edf287ac7e59612589b308f08b708ae00
2020-11-06 07:26:03 -08:00
Thomas Orozco
40e8cab560 mononoke/filestore: update metadata to futures 0.3
Summary:
This updates the metadata APIs in the filestore to futures 0.3 & async / await.
This changes the external API of the filestore, so there's quite a bit of churn
outside of that module.

Reviewed By: markbt

Differential Revision: D24727255

fbshipit-source-id: 59833f185abd6ab9c609c6bcc22ca88ada6f1b42
2020-11-06 07:26:03 -08:00
Thomas Orozco
c2ad26f991 mononoke/filestore: convert finalize to futures 0.3
Summary:
Like it says in the title. This also lets us get rid of some macros we no
longer need.

Reviewed By: markbt

Differential Revision: D24727259

fbshipit-source-id: 5e3211bc08fa5376b4cfce4bea0428ab7bf3dc0f
2020-11-06 07:26:03 -08:00
Thomas Orozco
5adbccff53 mononoke/filestore: convert prepare to futures 0.3 / tokio 0.2
Summary:
Like it says in the title. This also lets us remove the spawn module entirely.
Note that there is one little annoyance here: I ran into the good old "not
general enough" compiler issue, so I had to add a bit more boxing to make this
go away :(

Reviewed By: markbt

Differential Revision: D24727253

fbshipit-source-id: 73435305d39cade2f32b151734adf0969311c243
2020-11-06 07:26:03 -08:00
Thomas Orozco
565eff1f9d mononoke/filestore: convert ChunkStream to futures 0.3
Summary: Like it says in the title!

Reviewed By: markbt

Differential Revision: D24727252

fbshipit-source-id: dc4b3f1f5631d54d5964e1e5e5f538f81769e425
2020-11-06 07:26:02 -08:00
Thomas Orozco
b1b1860c67 mononoke/filestore: just require input streams to be Send
Summary:
This will simplify a bunch of refactoring, and we no longer need them not to
be. This lets us convert parts of `chunk` to new futures as well.

Reviewed By: markbt

Differential Revision: D24727254

fbshipit-source-id: de643effe2d1d42ff9bf85a48d09301e929e66de
2020-11-06 07:26:02 -08:00
Thomas Orozco
b37bd20ab8 mononoke/filestore: update multiplexer to futures 0.3 / tokio 0.2
Summary:
Like it says in the title. This updates the Filestore's multiplexer to new
futures. The change is pretty mechanical, save for:

- We don't use filestore::spawn anymore, since that's provided by
  `tokio::task::spawn`  now.
- We no longer need to use futures or streams with `Error = !` since in Futures
  0.3 you can have an `Output` that isn't a `Result`.
- We need to make the `Stream` we accept `Send` because we can't used
  `boxed().compat()` otherwise. I'd like to remove that constraint once the
  conversion is complete, but considering all callsites do have a `Send` stream
  (the only one that didn't was API Server but that's long gone), just adding
  the bound is easiest.

Reviewed By: farnz

Differential Revision: D24708596

fbshipit-source-id: 8b278b5ae49029b7f0d0d9d4fe96c467e1343f60
2020-11-06 07:26:02 -08:00
Thomas Orozco
390d305281 mononoke/test: call the filestore with static streams
Summary:
This makes some refactoring later easier. I'd like to not require this, but for
now it's a bit simpler to just do this. Those are the only callsites that
send non-static streams.

Reviewed By: markbt

Differential Revision: D24727258

fbshipit-source-id: c0e4dc86e249a08c2194a20de5a2dfd5a5933d0b
2020-11-06 07:26:02 -08:00
Stanislau Hlebik
a5f6874c72 mononoke: add a tunable to log large read requests
Reviewed By: krallin

Differential Revision: D24780218

fbshipit-source-id: 9207a471e65407a023223ce5a0aeee3511a9823e
2020-11-06 04:23:40 -08:00
Lukas Piatkowski
a3c2ea6fa0 mononoke/commit_rewriting: fix doc generation
Reviewed By: ahornby

Differential Revision: D24780398

fbshipit-source-id: 79570f6b6959362bcdbc20f425378b7ec460e480
2020-11-06 03:24:20 -08:00
Alex Hornby
14128ce2dc mononoke: remove unnecessary .version("0.0.0") in clap App setup
Summary: We don't need to declare a fake empty version number

Reviewed By: farnz

Differential Revision: D24757981

fbshipit-source-id: 594c97e225704d783bea723efcbb9dfc4d5d800b
2020-11-06 02:23:46 -08:00
Xavier Deguillard
c5480fdf6f hooks: forbid windows reserved names in the repos
Summary:
The root cause for S199754 was a file named "con.rs" was checked in onto the
repo. Since this is a reserved filename on Windows, this broke all Windows
users having it in their sparse profiles.

The rules for reserved names are defined as such by Microsoft:

"CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9,
LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these
names followed immediately by an extension; for example, NUL.txt is not
recommended. For more information, see Namespaces."

Of course, since the filesystem is case insensitive, these can have any casing.

Reviewed By: krallin

Differential Revision: D24453528

fbshipit-source-id: 389f15e2b1a88e3c1e8721fb7868616acabebc64
2020-11-05 19:24:04 -08:00