Commit Graph

61981 Commits

Author SHA1 Message Date
Adam Simpkins
dea831d5ec fix Python deprecation warnings about PY_SSIZE_T_CLEAN
Summary:
Update pywatchman/bser.c to define `PY_SSIZE_T_CLEAN` before including
`Python.h` and then receive parsed string lenghts as `Py_ssize_t` rather than
`int`.  This eliminates some runtime Python warnings about the old `int`
behavior being deprecated.

Reviewed By: chadaustin

Differential Revision: D25294778

fbshipit-source-id: 7db678ed918db3bf4745ba716585ed6475d1c910
2020-12-03 10:58:47 -08:00
Xavier Deguillard
dceab3479b prjfs: thread notifications in PrjfsChannel
Summary:
EdenFS can now show notifications to the user in case something wrong is
happening.

Reviewed By: chadaustin

Differential Revision: D24864354

fbshipit-source-id: fabc30f14bc022b4367af562481235fe984df458
2020-12-03 10:45:30 -08:00
Xavier Deguillard
6d90ceea25 prjfs: add timeout to ProjectedFS callbacks
Summary:
One of the main sub-par user experience on Windows is the lack of notification
of any kind when EdenFS can't reach the Mercurial servers. Prior to this diff,
the callbacks would never return, causing commands to simply hangs for the
user.

As a first step, let's add a timeout, a later step will hook the notification
mechanism used on macOS/Linux to display a notification when timeouts occurs.

The only callback that doesn't have a proper timeout is the notification one,
as timing out on these would mean that EdenFS won't have registered that some
files/directories have been materialized which will lead to inconsistencies
later.

Reviewed By: kmancini

Differential Revision: D24809645

fbshipit-source-id: 0ddd9d443a17db405a3edbaa8edecf3764c31d37
2020-12-03 10:45:29 -08:00
Xavier Deguillard
faf0985885 prjfs: wait for pending requests before unmounting
Summary:
As described in the previous diff, unmounting a repo while a request is pending
would lead to a use after free. To solve this, we can wrap the inner channel
with a shared_ptr, and set it to NULL whenever unmount is in progress.

While this solution has a fairly large overhead due to requiring at least 2
atomics per callbacks (one for the lock, the second one for the shared_ptr
copy), it is correct. A future improvement will swap these with an RCU pointer
to reduce the callback cost to almost nothing.

Reviewed By: chadaustin

Differential Revision: D25071423

fbshipit-source-id: 77d14a38403bef3e276d3e5e48e6fd95dd641964
2020-12-03 10:45:29 -08:00
Xavier Deguillard
54f6aae49c prjfs: add an inner channel
Summary:
There is currently a race condition where unmounting a repo can happen
concurrently with a ProjectedFS notification/callback. Depending on who wins
that race, this can lead to a use-after-free as the PrjfsChannel/EdenMount
would be freed but the callback would still have reference to it.

To solve this, we need to keep track of inflight requests, and in particular
make sure that memory isn't freed before all the pending callbacks have
completed. And that effectively means that we need to refcount the channel used
by these callbacks so we only free the memory when nobody else is using it.

The first step towards this is splitting the channel in 2 halves.

Reviewed By: chadaustin

Differential Revision: D25071422

fbshipit-source-id: 743f38c9b19ba534961d06ea6f2ddc96b685fe19
2020-12-03 10:45:29 -08:00
svcscm
4e72f23c20 Updating submodules
Summary:
GitHub commits:

7f548f806c
2c49761f55
585062dffd

Reviewed By: jurajh-fb

fbshipit-source-id: 42bdd488ad39441e606fd8964c89c8f104e03e3a
2020-12-03 10:45:29 -08:00
svcscm
8558de8e00 Updating submodules
Summary:
GitHub commits:

a16e5ed9d5
5af3424776

Reviewed By: jurajh-fb

fbshipit-source-id: 8d2c4e02639873fb8f1c28a4048474e14ef0c536
2020-12-03 07:37:54 -08:00
Pavel Aslanov
70bfc4abd0 convret to new type futures
Summary: convert blobrepo:blobrepo_common to new type futures

Reviewed By: StanislavGlebik

Differential Revision: D25245426

fbshipit-source-id: d3db0e417545b2b0043e48a536737586005ac4bb
2020-12-03 07:15:04 -08:00
Thomas Orozco
15d3670d72 mononoke: UploadHgFileEntry: allow calling it without a path
Summary:
I'd like to experiment with splitting this into its own service. To do that, I
don't want to have to include a path, since it's only used for reporting an
error that will never occur (because for that service I'll be using the
"generate" variant of the filenode id). Let's just make it optional.

Reviewed By: lukaspiatkowski

Differential Revision: D25220901

fbshipit-source-id: 6d3cf70a63b077de18a7d43f3b65766b453c425e
2020-12-03 06:19:31 -08:00
Thomas Orozco
5765030c7e mononoke: asyncify UploadHgFileEntry
Summary: Like it says in the title. Let's turn this into an async fn.

Reviewed By: lukaspiatkowski

Differential Revision: D25220902

fbshipit-source-id: b5de783adaca05919eb5cd6858c8b0aaf03ddfc2
2020-12-03 06:19:31 -08:00
Thomas Orozco
bf4dc18009 mononoke: UploadHgFileEntry::upload: just return a plain future
Summary:
This returns a Result of a tuple, but:

- This never errs.
- Nothing ever reads the left side of the tuple.

So let's stop doing that.

Reviewed By: StanislavGlebik

Differential Revision: D25219887

fbshipit-source-id: f33dcf6f6e68cb17b40c4638470312afae0662e6
2020-12-03 06:19:31 -08:00
Thomas Orozco
679735fbdf mononoke/unbundle: stop collecting ContentBlobMeta given we never use it
Summary:
Like it says in the title. We've had this comment about potentially using this
for a couple of years now. It seems a bit unlikely at this point that we're
going to use this, but currently it makes the code that provides uploading hg
entries more complex than it needs to be, so let's just get rid of this.

Reviewed By: lukaspiatkowski, StanislavGlebik

Differential Revision: D25219728

fbshipit-source-id: 61d254edef16d24a4c29f96f983f894863b5232a
2020-12-03 06:19:31 -08:00
Thomas Orozco
d5097a2d8c mononoke/lfs_server: account for size in object popularity
Summary:
This modifies our object popularity mechanism to account for the size of the
objects being downloaded. Indeed, considering our bottleneck is bandwidth, we
forcing similar routing for 10 downloads of a 10MB object and 10 downloads of a
1GB object doesn't make that much sense.

This diffs updates our counting so that we now record the object size instead
of a count. I'll set up routing so that we disallow consistent routing when a
single object exceeds 250MiB/s of throughput ( = 1/4th of a task).

It's worth noting that this will be equivalent to what we have right now for
our most problematic objects (GraphQL schemas in Fbsource, 35M each), given
that we "unroute" at 150 requests / 20 seconds (`150 * 35 / 20 = 262`).

The key difference here is that this will work for all objects.

This does mean LFS needs to cache and know about content metadata. That's not
actually a big deal. Indeed, over a week, we serve 25K distinct objects
(https://fburl.com/scuba/mononoke_lfs/a2d26s1a), so considering content
metadata is a hundred bytes (and so is the key), we are looking at a few MBs of
cache space here.

As part of this, I've also refactored our config handling to stop duplicating
structures in Configerator and LFS by using the Thrift objects directly (we
still have a few dedicated structs when post-processing is necessary, but we
no longer have anything that deserializes straight from JSON).

Note that one further refinement here would be to consistently route but to
more tasks (i.e. return one of 2 routing tokens for an object that is being downloaded
at 500MiB/s). We'll see if we need that.

Reviewed By: HarveyHunt

Differential Revision: D24361314

fbshipit-source-id: 49e1f86cf49357f60f1eac298a753e0c1fcbdbe5
2020-12-03 06:17:06 -08:00
Thomas Orozco
5194707ccf mononoke/lfs_server: import config structs from Configerator
Summary: See D24360844.

Reviewed By: HarveyHunt

Differential Revision: D24361313

fbshipit-source-id: a32c5d5ed6039bba9d8fbb67dcb8b0e724b7d395
2020-12-03 06:17:06 -08:00
Harvey Hunt
3b7978c437 mononoke: cmdlib: Fix default cachelib size crash
Summary:
D24761026 (caa684450f) formatted the default cachelib size with the specifier
`{:3}`. This specifier pads the left side of the string with spaces if there
are less than 3 digits.

Unfortunately, this means that attempting to parse the string into an `f64`
fails. Here's a minimal example:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=11a1e819f9919f7d02565cb8fa561b85

Remove the format specifier and instead call `.to_string()`.

Reviewed By: ahornby

Differential Revision: D25302079

fbshipit-source-id: 461dd628a312a967f6cf5958d2e5d51b72b0ffd8
2020-12-03 05:48:31 -08:00
Thomas Orozco
282d93d906 mononoke: up the cache zstd threshold a little bit
Summary:
Right now this is the same as our Filestore threshold so we always attempt to
compress Filestore chunks even though they were designed to fit in cache.

Whoops.

Reviewed By: ikostia

Differential Revision: D25274080

fbshipit-source-id: f17b54710fc36ca7c11c74247d038bf73777f7f9
2020-12-03 03:37:22 -08:00
svcscm
a32da4264f Updating submodules
Summary:
GitHub commits:

4478d9a470
558d505de3

Reviewed By: jurajh-fb

fbshipit-source-id: 1f544a0528aab2bb38742cc7f6dfbc73e93008df
2020-12-02 20:27:42 -08:00
Stefan Filip
5c7ecf402f segmented_changelog_tailer: initialize caching
Summary:
Cachelib wasn't initialized so a production configuration would crash because
the cache pools wouldn't be found.

Reviewed By: singhsrb

Differential Revision: D25291880

fbshipit-source-id: 382db0efda072b11da587e863566e816bd5393ca
2020-12-02 19:18:32 -08:00
svcscm
3bdc7e1e9d Updating submodules
Summary:
GitHub commits:

7f46daa126
e8c1279295
755145b641
29e8f6a698

Reviewed By: jurajh-fb

fbshipit-source-id: 147dfcb83210353ab897341bf559a74c5505a514
2020-12-02 19:18:32 -08:00
svcscm
dfe689549b Updating submodules
Summary:
GitHub commits:

89c6ebd694
3b9bfe8f14
34aedb0f44
600479ab39
bddd13a94a
914be87f68
fbf0331b77

Reviewed By: jurajh-fb

fbshipit-source-id: 63a8b58bc6fbc91c6cab6a71d84daf3c21126b8c
2020-12-02 17:41:26 -08:00
Pavel Aslanov
337bab2744 convert to new type futures
Summary: Convert `ChangesetFetcher` to new type futures

Reviewed By: StanislavGlebik

Differential Revision: D25244213

fbshipit-source-id: 4207386d81397a930a566db008019bb8f31bf602
2020-12-02 15:40:12 -08:00
Jun Wu
ed473e23fd phrevset: do not return None for namespace lookup
Summary:
The `repo.names` namespace lookup should not return `[None]`. Detect and avoid
that to avoid crashes.

Reviewed By: singhsrb

Differential Revision: D25261462

fbshipit-source-id: c7a0bba557717ab292a05d753569c68112e7f0b0
2020-12-02 15:09:18 -08:00
svcscm
e9752579e6 Updating submodules
Summary:
GitHub commits:

aab4f82ba9
a850991c34

Reviewed By: jurajh-fb

fbshipit-source-id: 6e6f98e96b0965158f6cefa8272fdea829ec13a6
2020-12-02 15:09:18 -08:00
svcscm
e16d1e1ca2 Updating submodules
Summary:
GitHub commits:

96bb55db96
1213fc1889
e7e1cde26a

Reviewed By: jurajh-fb

fbshipit-source-id: 300d3b4fbeca952c84fe7a80157421aa3372f4e2
2020-12-02 12:14:31 -08:00
Kostia Balytskyi
fd2b114424 observability: import thrift
Summary: Imports D25231497

Reviewed By: ahornby

Differential Revision: D25231581

fbshipit-source-id: e8be84e0cc25d2ae6b952b4f856fb427c82ca12b
2020-12-02 12:10:22 -08:00
svcscm
66ed13fed0 Updating submodules
Summary:
GitHub commits:

46051fbc75
85336f2797
4031bcc52a
e062a719cc
27e9bff1e0
ccabc1eed5
3c57f3d157

Reviewed By: jurajh-fb

fbshipit-source-id: 7d1a03c0c5fb0e8d83782ed377ef5fc8fd46088d
2020-12-02 11:02:56 -08:00
Mark Juggurnauth-Thomas
aea042fc29 skeleton_manifests: check case on upload if not enabled
Summary:
If skeleton manifests are not enabled for a repository, ignore the tunables
that delay casefolding checks until land-time.

Reviewed By: StanislavGlebik

Differential Revision: D25271607

fbshipit-source-id: dcaf9291da31d0f57b3b632888ed688ecd6cecda
2020-12-02 09:08:34 -08:00
svcscm
f48046681c Updating submodules
Summary:
GitHub commits:

7c5cfe6b17

Reviewed By: jurajh-fb

fbshipit-source-id: d26054ceadb285cfef89ca116f3133764e642ea5
2020-12-02 09:08:34 -08:00
svcscm
3755248814 Updating submodules
Summary:
GitHub commits:

0daaf1ef48

Reviewed By: jurajh-fb

fbshipit-source-id: a7a49e03c4626bb6c3b9680d6f2b679e1bb5c96f
2020-12-02 08:01:27 -08:00
Mark Juggurnauth-Thomas
8fe2b30e9a derived_data: commonise blobstore mapping implementations
Summary:
Create `BlobstoreMapping` as a trait with the common implementations for
derived data mappings that are stored in the blobstore.

Reviewed By: StanislavGlebik

Differential Revision: D25099915

fbshipit-source-id: 8a62fbb809918045336944c8cd3584b109811012
2020-12-02 07:33:41 -08:00
Mark Juggurnauth-Thomas
0f13c1283e derived_data: rename Mode to DeriveMode
Reviewed By: StanislavGlebik

Differential Revision: D25218193

fbshipit-source-id: 7a4ff3cb3e2b0e0c0f849b0de69a75626aeddf4c
2020-12-02 07:33:41 -08:00
Mark Juggurnauth-Thomas
6b0203d10f derived_data: use batch_derive for backfilling data
Summary:
Batch derivation was disabled as it caused problems for other derived data types.

This was because the default batch implementation was wrong: it attempted to derive
potentially linear stacks concurrently, which would cause O(n^2) derivations.

Fix the default implementation to be a naive sequential iteration, and re-enable
batch derivation for fsnodes and skeleton manifests.

Reviewed By: StanislavGlebik

Differential Revision: D25218195

fbshipit-source-id: 730555829f092cc36e1c81cf02c2b4962a3904da
2020-12-02 07:33:41 -08:00
Mark Juggurnauth-Thomas
c414b36a30 fsnodes: don't rederive parents fsnodes during batch derivation
Summary:
On the second and subsequent linear stack in a batch, the parent fsnode may
have been derived in the previous iteration of the loop.  Since we haven't
completed this batch yet, the mappings have not been stored, and so the
attempt to derive the parent will result in the parent being derived again,
repeating the work of this batch sequentially.

Apply the optimization used in skeleton manifests and fetch the parent fsnodes
out of the result we are accumulating.

Reviewed By: StanislavGlebik

Differential Revision: D25218194

fbshipit-source-id: 5cc49204b53984f8aa73542f1a794a6251eb2b2e
2020-12-02 07:33:41 -08:00
Mark Juggurnauth-Thomas
509dcf3ccd skeleton_manifests: enable derivation of skeleton manifests in batches
Summary:
Similar to fsnodes, allow skeleton manifests to be derived in parallel in large
batches by splitting the changesets into linear stacks with no internal
conflicts, and deriving each changeset in that batch in parallel.

Reviewed By: StanislavGlebik

Differential Revision: D25218196

fbshipit-source-id: e578de9ffd472e732abb1e2ef9cd19c073280cd4
2020-12-02 07:33:41 -08:00
Mark Juggurnauth-Thomas
2d01d4236d tests: wait for source control service to fully start
Summary:
The Mononoke SCS tests can be flaky as the server starts to accept SSL
connections some time before it is fully ready to accept requests, which can
result in request timeouts.

Use a simple request to test for the server being fully up and ready to
handle requests.

Reviewed By: krallin

Differential Revision: D25250245

fbshipit-source-id: b79106ed51e5163ebe5cd1db7b0deaab0035b9bc
2020-12-02 07:33:41 -08:00
Alex Hornby
3902c04261 mononoke: update test cases to use new --with-readonly-storage option
Summary: Update the few test cases remaining on older option to the newer option

Reviewed By: ikostia

Differential Revision: D25219710

fbshipit-source-id: 50af0dcac7ed980ec4c7180cf81e3c00ecc18b95
2020-12-02 07:27:24 -08:00
Alex Hornby
b458ae4217 mononoke: remove --readonly-storage from walker test cmdlines
Summary: Remove this now it is the walker default.  Makes command lines shorter

Reviewed By: ikostia

Differential Revision: D25219551

fbshipit-source-id: bc5ad4237cad35218a0b4c54aa81eb20edb3f3e1
2020-12-02 07:27:24 -08:00
Alex Hornby
99fb41c5bd mononoke: allow binaries to default readonly-storage option
Summary:
This will reduce boilerplate command line for the walker, as most of the time we want to run it with readonly storage

Because the existing --readonly-storage flag can't take a value this introduces a new --with-readonly-storage=<true|false> option

Reviewed By: krallin

Differential Revision: D25216871

fbshipit-source-id: e1b83b428a9c3787f48c18fd396d23ac95991b77
2020-12-02 07:27:23 -08:00
Alex Hornby
935a7ddfc8 mononoke: remove the need to pass in cachelib settings twice
Summary:
Previously needed to pass in cachelib settings once to MononokeAppBuilder and once to parse_and_init_cachelib.

This change adds a MononokeClapApp and MononokeMatches that preserve the settings, thus preventing the need to pass them in twice (and thus avoiding possible inconsistency)

MononokeMatches uses MaybeOwned to hold the inner ArgMatches, which allows us to hold both the usual reference case from get_matches and an owned case for get_matches_from which is used in test cases.

Reviewed By: krallin

Differential Revision: D24788450

fbshipit-source-id: aad5fff2edda305177dcefa4b3a98ab99bc2d811
2020-12-02 07:27:23 -08:00
Alex Hornby
31bcf94df7 mononoke: set a default cache_size in the walker
Summary: Shorten command lines by setting a default in code.

Reviewed By: ikostia

Differential Revision: D24761025

fbshipit-source-id: 13deb1622ee1b97135ee787f6b6ffeed2f05813b
2020-12-02 07:27:23 -08:00
Alex Hornby
caa684450f mononoke: show cachelib cache_size in --help usage
Summary:
Show cachelib cache_size default in --help usage so its clear what you'll get if no command line args passed

Because we need to convert from bytes to GiB, the lifetime of the help string isn't long enough for clap's reference recieving default_value, so use OnceCell to be able to pass a static reference.

Reviewed By: krallin

Differential Revision: D24761026

fbshipit-source-id: 81b5e7ceb832d5cb55cc9faef59c5e6432f7c4b0
2020-12-02 07:27:23 -08:00
Gregory Man
7400f86076 Added ramen alias to amend command
Reviewed By: gareve

Differential Revision: D25088884

fbshipit-source-id: a09cd7124834eafa0864c1cdaba087d4470ffbf8
2020-12-02 06:40:24 -08:00
Thomas Orozco
7df73c4afe hg log --sparse: throw a nicer error on non-sparse repos
Summary: Like it says in the title.

Reviewed By: ikostia

Differential Revision: D25196159

fbshipit-source-id: 9201a07201eaeb13efbe324b35377274c0611e6e
2020-12-02 03:45:15 -08:00
svcscm
26eade80e2 Updating submodules
Summary:
GitHub commits:

7af26bca11
b585c84492
3c030b10ce

Reviewed By: jurajh-fb

fbshipit-source-id: c349270a066d0c34cbe2badb7014aadcdd6e0eac
2020-12-02 03:45:14 -08:00
svcscm
f35f08fcd8 Updating submodules
Summary:
GitHub commits:

1d28898c10
d9e9a993fc
abfe2b9fe4
a7d2ef6612

Reviewed By: jurajh-fb

fbshipit-source-id: ba998fc247d218f1cc51a671ded9c83ef4308fb1
2020-12-02 00:49:13 -08:00
Alex Hornby
f077f69408 mononoke: move expected_item_size_byte into CachelibSettings
Summary:
Move expected_item_size_byte into CachelibSettings, seems like it should be there.

To enable its use also exposes a parse_and_init_cachelib method for callers that have different defaults to default cachelibe settings.

Reviewed By: krallin

Differential Revision: D24761024

fbshipit-source-id: 440082ab77b5b9f879c99b8f764e71bec68d270e
2020-12-02 00:47:22 -08:00
Wez Furlong
687fddca2f eden: remove some dead DMG redirection code
Summary:
We moved to APFS subvolumes a while back, so it's time
to kill this bit.

Reviewed By: chadaustin

Differential Revision: D25260825

fbshipit-source-id: 7487fb6d477f2650e2aedb0c4dfc4f45a10c9807
2020-12-01 23:58:32 -08:00
Meyer Jacobs
f16ef7dafd bindings: introduce C / C++ bindings to EdenAPI for use by EdenFS
Summary:
Introduce `edenapithin` crate, which offers C bindings to EdenAPI Client.

There are two top-level `owned` types, `EdenApiClient` and `TreeEntryFetch`, which represent `Box`ed results from calls to EdenAPI's blocking client. The C / C++ code is responsible for calling the associated `free` functions for these types, as well as `OwnedString`, which is used to represent error variants of a `Result` as a string.

Most functionality is provided through functions which operate on and return references into these top-level owned types, providing access into Rust `Result`s and `Vec`s (manually-monomorphized), and EdenApi's `TreeEntry` and `TreeChildEntry`.

Additional non-pointer types are defined in the `types` module, which do not require manual memory management.

C++ bindings are not included currently, but will be introduced soon.

Reviewed By: fanzeyi

Differential Revision: D24866065

fbshipit-source-id: bb15127b84cdbc6487b2d0e1798f37ef62e5b32d
2020-12-01 19:07:25 -08:00
Meyer Jacobs
293053b774 edenapi: expose "attributes" parameter in tree request API
Summary:
Introduce a new API type, `TreeAttributes`, corresponding to the existing type `WireTreeAttributesRequest`, which exposes which optional attributes are available for fetching. An `Option<TreeAttributes>` parameter is added to the `trees` API, and if set to `None`, the client will make a request with TreeAttributes::default().

The Python bindings accept a dictionary for the attributes parameter, and any fields present will overwrite the default settings from TreeAttributes::default(). Unrecognized attributes will be silently ignored.

Reviewed By: kulshrax

Differential Revision: D25041255

fbshipit-source-id: 5c581c20aac06eeb0428fff42bfd93f6aecbb629
2020-12-01 19:07:25 -08:00
svcscm
4cc54e6a63 Updating submodules
Summary:
GitHub commits:

ae733b8877

Reviewed By: jurajh-fb

fbshipit-source-id: 923443b1ffd43e2efdd5dbd854c0955da5c5fbdd
2020-12-01 18:08:08 -08:00