Commit Graph

61865 Commits

Author SHA1 Message Date
Pavel Aslanov
13ee62332d prefix old future with Old
Summary: Prefix old futures with `Old` so it would be possible to start conversion of BlobRepo to new type futures

Reviewed By: StanislavGlebik

Differential Revision: D25187882

fbshipit-source-id: d66debd2981564b289d50292888f3f6bd3343e94
2020-11-27 06:49:06 -08:00
Alex Hornby
2b703be885 mononoke: fix flaky walker test case
Summary:
The expected walker validation failures can appear in any order.  Sort
them so the comparison is deterministic

Reviewed By: StanislavGlebik

Differential Revision: D25195052

fbshipit-source-id: aeded6675c85186e12d27023fb862d7c52dd764f
2020-11-27 05:34:12 -08:00
James Donald
c7fe8b849e Fix merge on Windows when path contains spaces
Summary: editmergeps.bat was separating a filename with spaces into args[0] and args[1] when calling editmergeps.ps1. Use proper quoting to send files with spaces as a single argument.

Reviewed By: ikostia

Differential Revision: D25194324

fbshipit-source-id: 065f677c9015681b310e1cfc46f52ff563a35f99
2020-11-27 03:57:03 -08:00
Lukas Piatkowski
a1e8abc88c mononoke/unbundle: mark non-public all objects that are not used outside unbundle
Summary: This will make it easier to choose how to migrate this code to futures 0.3

Reviewed By: ahornby

Differential Revision: D25185646

fbshipit-source-id: b39f7540275115fff4e8b6f2e740d544c2c876ef
2020-11-27 03:31:08 -08:00
Lukas Piatkowski
fa1a195fd0 mononoke/blobstore: pass CoreContext via borrowed instead of owned value
Summary: Follow up after removing 'static from blobstore.

Reviewed By: StanislavGlebik

Differential Revision: D25182106

fbshipit-source-id: e13a7a31d71b4674425123268e655ae66127f1b7
2020-11-27 03:31:07 -08:00
Thomas Orozco
8840f92d07 edenapi server: properly deserialize history requests
Summary:
While trying to repro a user report (https://fburl.com/jqvm320o), I ran into a
new hg error: P151186623, i.e.:

```
KeyError: 'Key not found HgId(Key { path: RepoPathBuf("fbcode/thrift/facebook/test/py/TARGETS"), hgid: HgId("55713728544d5955703d604299d77bb1ed50c62d") })'
```

After some investigation (and adding a lot of prints), I noticed that this
was trying to query the EdenAPI server for this filenode. That request should
succeed, given Mononoke knows about this filenode:

```
[torozco@devbig051]~/fbcode % mononoke_exec mononoke_admin fbsource --use-mysql-client filenodes by-id fbcode/thrift/facebook/test/py/TARGETS 55713728544d5955703d604299d77bb1ed50c62d
mononoke_exec: Using config stage prod (set MONONOKE_EXEC_STAGE= to override)
I1126 08:10:02.089614 3697890 [main] eden/mononoke/cmdlib/src/args/mod.rs:1097] using repo "fbsource" repoid RepositoryId(2100)
I1126 08:10:02.995172 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:137] Filenode: HgFileNodeId(HgNodeHash(Sha1(55713728544d5955703d604299d77bb1ed50c62d)))
I1126 08:10:02.995282 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:138] -- path: FilePath(MPath("fbcode/thrift/facebook/test/py/TARGETS"))
I1126 08:10:02.995341 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:139] -- p1: Some(HgFileNodeId(HgNodeHash(Sha1(ccb76adc7db0fc4a395be066fe5464873cdf57e7))))
I1126 08:10:02.995405 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:140] -- p2: None
I1126 08:10:02.995449 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:141] -- copyfrom: None
I1126 08:10:02.995486 3697890 [main] eden/mononoke/cmds/admin/filenodes.rs:142] -- linknode: HgChangesetId(HgNodeHash(Sha1(dfe46f7d6cd8bc9b03af8870aca521b1801126f0)))
```

Turns out, the success rate for this method is actually 0% — out of thousands of requests,
not a single one succeeded :(

https://fburl.com/scuba/edenapi_server/cma3c3j0

The root cause here is that the server side is not properly deserializing
requests (actually finding that was a problem of its own, I filed T80406893 for this).

If you manage to get it to print the errors, it says:

```
{"message":"Deserialization failed: missing field `path`","request_id":"f97e2c7c-a432-4696-9a4e-538ed0db0418"}
```

The reason for this is that the server side tries to deserialize the request
as if it was a `WireHistoryRequest`, but actually it's a `HistoryRequest`, so
all the fields have different names (we use numbers in `WireHistoryRequest`).

This diff fixes that. I also introduced a helper method to make this a little
less footgun-y and double-checked the other callsites. There is one callsite
right now that looks like it might be broken (the commit one), but I couldn't
find the client side interface for this (I'm guessing it's not implemented
yet), so for now I left it as-is.

Reviewed By: StanislavGlebik

Differential Revision: D25187639

fbshipit-source-id: fa993579666dda762c0d71ccb56a646c20aee606
2020-11-27 02:48:58 -08:00
Stanislau Hlebik
cebde43d3f mononoke: refactoring to allow combining bundles in the sync job
Summary:
In the next diff I'd like to allow hg sync job to combine a few bookmark update log entries and send a single bundle for all of them. The goal is to reduce the lag between mononoke and hg servers.

We've already made an attempt to implement bundle combining some time ago, hence why we have things like CombinedBookmarkUpdateLogEntry. However it was never really used in prod - back then the only way to sync a bundle from mononoke to hg servers was to replay a bundle that client has pushed to us, and combining bundles like that was tricky.

Now it's different, because hg sync job has the logic to generates the bundles itself rather than re-use the bundle that client has pushed to us. This makes implementing bundle combinging easier.

This diff doesn't add the actual bundle combining, but it does the refactoring that makes it easier. In particular:
1) Old logic for combining bundles was removed - it was never really used anyway.
1) prepare_bundles() function was added - this function takes a vector of BookmarkUpdateLogEntry and returns a vector of CombinedBookmarkUpdateLogEntry. The idea is to move bundle combining logic from main function to BundlePreparer class, since it has better knowledge of how to do bundle combining (in particular, it knows whether sync job re-uses existing bundle or generates it)
1) prepare_single_bundle() was changed - instead of taking bookmark name, from/to changeset id from BookmarkUpdateLogEntry, it now requires passing them explicitly. This makes adding bundle combining easier in the next diff.

Reviewed By: mitrandir77

Differential Revision: D25168877

fbshipit-source-id: 2935d1795925b4bf0456b9221e2f76ce3987cbd0
2020-11-27 02:21:50 -08:00
Stanislau Hlebik
966d33a84f mononoke: asyncify prepare_single_bundle
Reviewed By: aslpavel

Differential Revision: D25185096

fbshipit-source-id: 4a61420cdf01ceb7e64592c515271459c27114b3
2020-11-27 02:21:50 -08:00
Stanislau Hlebik
d856af393a mononoke: asyncify BundlePreparer constructor
Reviewed By: aslpavel

Differential Revision: D25185048

fbshipit-source-id: 251bca9e6693151e889520e0a40a8051e824d4f7
2020-11-27 02:21:49 -08:00
Stanislau Hlebik
f10d77ce5d mononoke: continue asyncifying main hg sync job loop
Reviewed By: aslpavel

Differential Revision: D25184859

fbshipit-source-id: 7cdc4a2676ee04d8832dc5fd60072cadf5474a18
2020-11-27 02:21:49 -08:00
Alex Hornby
0b873a594f mononoke: DeletedManifest does not need path in walker key
Summary: Only the id is used when loading the manifest, not the path. Path is only needed for route information

Reviewed By: mitrandir77

Differential Revision: D25185264

fbshipit-source-id: 1af453fa2716d53ea4fb18a81d59867e98ea07f6
2020-11-27 00:06:48 -08:00
Alex Hornby
867c6785c4 mononoke: Fsnode does not need path in walker key
Summary: The path is not needed to load the fsnode, only as route info for things like compression

Reviewed By: mitrandir77

Differential Revision: D25184485

fbshipit-source-id: afd84dcd9dbd82c2c9018e86fb676bc57a5d009b
2020-11-27 00:06:48 -08:00
Thomas Orozco
acf1453e12 mononoke: rename BlobManifest to HgBlobManifest
Summary:
We have `HgBlobChangeset`, `HgFileEnvelope`, `HgManifestEnvelope` ... but we
also have `BlobManifest`. Let's be a little consistent.

Reviewed By: markbt

Differential Revision: D25122288

fbshipit-source-id: 9ae0be49986dbcc31cee9a46bd30093b07795c62
2020-11-26 11:26:50 -08:00
Alex Hornby
49ead437dd mononoke: add SkeletonManifest to walker
Summary: Add them to the walker so we can scrub and inspect them

Reviewed By: StanislavGlebik

Differential Revision: D25124144

fbshipit-source-id: 5df1ca6e48d18d3d55f68905e93fd75fbae92adb
2020-11-26 10:11:25 -08:00
Lukas Piatkowski
077b90de0d mononoke:hgcli: fix broken OSS build
Summary: OSS build fails due to unused `res` variable, I don't know why it passes buck builds.

Reviewed By: ikostia

Differential Revision: D25187773

fbshipit-source-id: ee15132f5ccd279104a07bc8dc91de096566d9cf
2020-11-26 09:57:18 -08:00
Thomas Orozco
65c6869384 mononoke/blobrepo/test: use fbinit::compat_test consistently
Summary:
We have 4 different ways of awaiting futures in there: sometimes we create a
runtime, sometimes we use async-unit, sometimes we use `fbinit::test` and
sometimes we use `fbinit::compat_test`. Let's be consistent.

While in there, let's also get rid of `should_panic`, since that's not a very
good way of running tests.

Reviewed By: HarveyHunt

Differential Revision: D25186195

fbshipit-source-id: b64bb61935fb2132d2e5d8dff66fd4efdae1bf64
2020-11-26 08:22:05 -08:00
Thomas Orozco
015331583d mononoke: remove HgBlobEntry
Summary:
HgBlobEntry is kind of a problematic type right now:

- It has no typing to indicate if it's a file or a manifest
- It always has a file type, but we only sometimes care about it

This results in us using `HgBlobEntry` to sometimes represent
`Entry<HgManifestId, (FileType, HgFileNodeId)>`, and some other times to
represent `Entry<HgManifestId, HgFileNodeId>`.

This makes code a) confusing, b) harder to refactor because you might be having
to change unrelated code that cares for the use case you don't care about (i.e.
with or without the FileType), and c) results in us sometimes just throwing in
a `FileType::Normal` because we don't care about the type, which is prone to
breaking stuff.

So, this diff just removes it, and replaces it with the appropriate types.

Reviewed By: farnz

Differential Revision: D25122291

fbshipit-source-id: e9c060c509357321a8059d95daf22399177140f1
2020-11-26 08:22:05 -08:00
Thomas Orozco
1916f9c60b mononoke/derived_data/mercurial: prepare to remove HgEntry
Summary:
I'd like to get rid of HgEntry altogether, as it's not a very useful
abstraction (`Entry` is better). This is one step towards this, by moving the
HgEntry -> Leaf conversion close to where the `HgEntry` is created (which is
where we upload filenodes).

Reviewed By: markbt

Differential Revision: D25122290

fbshipit-source-id: 0e3049392791153b9547091516e702fb04ad7094
2020-11-26 08:22:05 -08:00
Thomas Orozco
c43aa44aca mononoke/mercurial_types: use manifest::Entry instead of HgEntryId
Summary:
I'd like to remove the number of places that use HgEntryId, and make its usage
a little more consistent. Indeed, right now, HgEntryId is used in some places
to upload things where we just give it a fake entry type, and sometimes to
represent an actual entry in a manifest; This isn't great.

Let's remove it from here.

Reviewed By: markbt

Differential Revision: D25122289

fbshipit-source-id: 5075383e037e4e890af203d133f0a25118c19823
2020-11-26 08:22:05 -08:00
Thomas Orozco
34fbac34e1 mononoke/mercurial_types: remove unused ContentBlobInfo
Summary:
This contains a path, which it turns out is actually never used throughout the
codebase. Remove it.

Reviewed By: markbt

Differential Revision: D25122292

fbshipit-source-id: eab528bfb1e3893bca4d92d62c30499cf9eead6c
2020-11-26 08:22:05 -08:00
Alex Hornby
636536bebb mononoke: add SkeletonManifestMapping to walker
Summary: So we can scrub and inspect them

Reviewed By: StanislavGlebik

Differential Revision: D25120995

fbshipit-source-id: d150e55f0d72f584c15dbaf2bd017d19130312b2
2020-11-26 08:07:52 -08:00
Stanislau Hlebik
3d03808d05 mononoke: asyncifying loop_over_log_entries
Reviewed By: aslpavel

Differential Revision: D25184814

fbshipit-source-id: 74e702e059856371fc8737bea3e755321ebe07ba
2020-11-26 07:42:49 -08:00
Stanislau Hlebik
3492e5531b mononoke: asyncify build_outcome_handler
Reviewed By: aslpavel

Differential Revision: D25184784

fbshipit-source-id: 66ca7fb874c7172c39ddfafd0ebde36e9c71f350
2020-11-26 07:42:49 -08:00
Stanislau Hlebik
629cfc750d mononoke: asyncify build_reporting_handler
Summary: This diff asyncifies build_reporting_handler, and while there also simplifies this function a bit by ignoring cases where log_entries is empty or not specified

Reviewed By: farnz

Differential Revision: D25184396

fbshipit-source-id: 46b5d2f9fb5571e502bcdf5a0fe964fb62426313
2020-11-26 07:42:49 -08:00
Stanislau Hlebik
c8400473c9 mononoke: asyncify locking/unlocking functions in hg_sync
Reviewed By: aslpavel

Differential Revision: D25184377

fbshipit-source-id: 72457cb669d00c68eee0fb2c19a866458a369bdb
2020-11-26 07:42:49 -08:00
Stanislau Hlebik
9f6fb707d9 mononoke: asyncify combine_entries in hg_sync job
Reviewed By: ahornby

Differential Revision: D25184363

fbshipit-source-id: fcc289e72b99fe524e6f92ab672bbcfba7101e9a
2020-11-26 07:42:49 -08:00
Stanislau Hlebik
196dec1904 mononoke: asyncify sync_single_combined_entry in hg_sync job
Reviewed By: ahornby

Differential Revision: D25184245

fbshipit-source-id: 59985cdc3cadc7ff945db60fabbcd6c241ff3ba1
2020-11-26 07:42:49 -08:00
Stanislau Hlebik
569733215c mononoke: make SYNC_LOOP async
Summary:
This diff asyncifies SYNC_LOOP similar to how SYNC_ONCE was asyncified.
The biggest part of SYNC_LOOP is a stream that starts with loop_over_log_entries. Previously it was a very long chain of combinators. This diff makes this chain ~2 times smaller, but unfortunately it can't make it even smaller  because of the use of "buffered(...)" method.

Reviewed By: ahornby

Differential Revision: D25123487

fbshipit-source-id: e913bbd1369e4375b5b1d0e6ba462e463a5a44fc
2020-11-26 07:42:48 -08:00
Thomas Orozco
e209225921 commitcloud: read backed up heads via backedup() revset
Summary:
The write & read path use different back up state files, which means they can
go out of sync. If that happens, it's a bit annoying because:

- The output of `hg cloud check` is out of sync with that of `hg sl`
- `hg cloud backup -r` says the commit is backedup, and `hg cloud check -r`
  says it isn't.

This diff fixes this by just using the `backedup()` revset, which under the
hood reads all state files.

Reviewed By: liubov-dmitrieva

Differential Revision: D25186071

fbshipit-source-id: 0ae2d43227d65a3564b2f796218b55982d5cc467
2020-11-26 06:35:57 -08:00
Stanislau Hlebik
2ca8bd5900 mononoke: make hg sync job SYNC_ONCE async
Reviewed By: farnz

Differential Revision: D25123103

fbshipit-source-id: 634287909a6be9e1b34160d63e27f14eabcdce95
2020-11-26 04:41:44 -08:00
Stanislau Hlebik
ed51aac36c mononoke: make retry asynchronous
Reviewed By: ikostia

Differential Revision: D25122781

fbshipit-source-id: a7d69c2cdeff0c9c6abd92e486af191e8baed8d5
2020-11-26 04:41:44 -08:00
Stanislau Hlebik
657d226360 mononoke: make try_prepare_single_bundle async
Reviewed By: farnz

Differential Revision: D25121835

fbshipit-source-id: 2564c404a01ad1f1772da4fef47c4a8940f80f0d
2020-11-26 04:41:44 -08:00
Lukas Piatkowski
15f0f924e6 mononoke/blobstore: use async_trait instead of BoxFuture
Reviewed By: farnz

Differential Revision: D25124793

fbshipit-source-id: 1ebe72d1db8043fabf9f20538f3e95c755e049e0
2020-11-23 07:58:34 -08:00
Thomas Orozco
95cc0e5a30 revisionstore: log more info when we time out
Summary:
Right now we just get a "deadline exceeded" error, which isn't very amenable to
helping us understand why we timed out. Let's add more logging. Notably,
I'd like to understnad what we've actually received at this point, if anything,
and how long we waited, as I'm starting to suspect this issue doesn't have much
to do with HTTP.

See https://fb.workplace.com/groups/scm/permalink/3361972140519049/ for
more context.

Reviewed By: quark-zju

Differential Revision: D25128159

fbshipit-source-id: b45d3415526fdf21aa80b7eeed98ee9206fbfd12
2020-11-23 01:45:54 -08:00
svcscm
080712c602 Updating submodules
Summary:
GitHub commits:

1a5fc4f577
8ed313ff53
0186ce6393

Reviewed By: wittgenst

fbshipit-source-id: 1772b81a9f6aecf2f7175385683d08cb505c1707
2020-11-21 18:22:33 -08:00
svcscm
251a17c317 Updating submodules
Summary:
GitHub commits:

8f2f4d97a2

Reviewed By: wittgenst

fbshipit-source-id: 6cc2fbdc3c8218a794556e62e5d1f60c9ae4c9b6
2020-11-20 17:34:25 -08:00
Katie Mancini
a46707cc19 Fix eden du --clean on MacOS
Summary:
`eden du --clean` currently fails with

```
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
```
Full error: P149352812

It looks like this is because Buck expects to run with a different python, so
here I clear out the PYTHONHOME variable before we start buck.

This reuses out logic used elsewhere to clean up the environment before
calling buck.

Reviewed By: wez

Differential Revision: D24904105

fbshipit-source-id: 73587c52aff3ea00f68339eb44e7042329de2e44
2020-11-20 17:25:55 -08:00
Jonathan Keljo
8cb2b9b710 Work around lru-disk-cache UB in Rust 1.48
Summary: `lru-disk-cache` depends on an old version of `linked-hash-map` which contains UB in 1.48 (see https://github.com/mozilla/sccache/issues/813). They updated the deps in their repo months ago, but haven't pushed a new version. This diff makes us get `lru-disk-cache` directly from their GitHub instead.

Reviewed By: dtolnay

Differential Revision: D25134582

fbshipit-source-id: 05fd63a76b7095ebeea458645b92a83bbd8c4614
2020-11-20 17:01:01 -08:00
svcscm
123e9fffaf Updating submodules
Summary:
GitHub commits:

e2c9673f65
4f88c3f60e
8b64c71ab7
179b347d9b
b2170a6824
3263b4e18e
43bf02b6cb
367f209cee
dea2f94287
8613ac65b7
3d70533b04

Reviewed By: wittgenst

fbshipit-source-id: 37e8d77debbb3a61afb6a14c7a6f52b7120ee6c5
2020-11-20 17:01:00 -08:00
svcscm
895f8473c5 Updating submodules
Summary:
GitHub commits:

16f11fd360
1848775fc6
2cc87b20ea
a5e2a703c5
6e689b6043
4c2949e7b8
7c8b7a6697
f602d77a51
73ef49fcca
200fa12b7b
282ac89fc5
9d562b2ae5

Reviewed By: wittgenst

fbshipit-source-id: 042a35e1055ccf1df255b24d0c8c01a77b8cb74c
2020-11-20 14:47:04 -08:00
Rajan Kumar
3378ebc55d Adding yaml-cpp fboss code for oss
Summary: Added yaml-cpp library to the fboss OSS build

Reviewed By: shri-khare

Differential Revision: D25126509

fbshipit-source-id: 1e88150dbf8c96a5ac696e003265dc1f14bec105
2020-11-20 14:04:20 -08:00
Rajan Kumar
c4c7b2cd09 Adding yaml-cpp in fboss oss build
Summary: The new library firmware_storage needs the yaml-cpp. For OSS build this diff adds the yaml-cpp library to manifest

Reviewed By: shri-khare

Differential Revision: D25115387

fbshipit-source-id: 9ed1c374df7e87f284c48d366095a20183719534
2020-11-20 14:04:20 -08:00
svcscm
a0e7577bec Updating submodules
Summary:
GitHub commits:

6a97a3094b

Reviewed By: wittgenst

fbshipit-source-id: 57303f630fc2f31191b2d69cd5afd70c3a3f4a7c
2020-11-20 13:52:59 -08:00
Alex Hornby
5a6ccc9188 mononoke: fix DeletedManifest to child step in walker
Summary:
It was mistakenly mapping deleted manifest id to a unode id.

I'm surprised the walk.rs code that constructs the DeletedManifestToDeletedManifestChild edge built with this bug. The DeletedManifestId and ManifestUnodeId types presumably coerce to each other.

Reviewed By: markbt

Differential Revision: D25120994

fbshipit-source-id: 1b53037808779c345c163ef32324961938078fc7
2020-11-20 10:30:09 -08:00
Stanislau Hlebik
444289c5d0 mononoke: allow Push bookmark moves in hg sync job
Summary:
Soon we are going to use hg sync job for configerator repos, and they might use
Push bookmark move. Let's allow it in sync job

Reviewed By: ikostia

Differential Revision: D25121176

fbshipit-source-id: f6000617b42be8392730ffc56be1947fbdbfff76
2020-11-20 08:20:38 -08:00
svcscm
e20454e184 Updating submodules
Summary:
GitHub commits:

c18333ca21
5fadb53144

Reviewed By: wittgenst

fbshipit-source-id: 341d212ec8bb051568c46d6f7bbc393ea5529b40
2020-11-20 08:12:26 -08:00
Thomas Orozco
e65b22d9c4 mononoke/repo_client: do not re-upload commits we already have for infinitepush
Summary:
This adds support for optionally not uploading commits we already have when
they arrive via infinitepush. This can happen if we're replaying bundles.

This works by filtering the commits we have. We still get some futures created
for the underlying uploads, but we never poll them because when we visit
what futures are needed for what commits, we don't select uploads that are
only reachable from commits we filtered out.

Obviously, this isn't super efficient, since the client still has to send us
all this data, but it's better than having them send us all that data then
having us take hours overwriting it all.

Reviewed By: mitrandir77

Differential Revision: D25120844

fbshipit-source-id: f96881d0d98ec622259bedb624fd94b600a2bf1d
2020-11-20 06:30:12 -08:00
svcscm
2876306726 Updating submodules
Summary:
GitHub commits:

5fd0ebb094
15a39945ef

Reviewed By: wittgenst

fbshipit-source-id: 8440c56319f8146c763d78376c7d6bf044809084
2020-11-20 06:16:36 -08:00
Lukas Piatkowski
0f54cc3d63 mononoke/blobstore: make Blobstore generic over lifetime
Summary: Remove 'static requirement for async methods of Blobstore, propagate this change and fixup low hanging fruits where the code can become 'static free easily.

Reviewed By: ahornby, farnz

Differential Revision: D24839054

fbshipit-source-id: 5d5daa04c23c4c9ae902b669b0a71fe41ee6dee6
2020-11-20 05:51:52 -08:00
svcscm
a354b73ff5 Updating submodules
Summary:
GitHub commits:

d5f68ec943

Reviewed By: wittgenst

fbshipit-source-id: f42ce70830bb72ef2875d83aaa3aa0ec0f2684cb
2020-11-20 05:51:52 -08:00