Commit Graph

56602 Commits

Author SHA1 Message Date
Steven Troxler
41378d4f37 Deprecate rust-crypto in eden/monanoke/derived_data
Summary:
The rust-crypto library appears to be unmaintained, switching
 - `crypto::digest::Digest` to `digest::Digest`
 - `crypto::sha1::Sha1` to `sha1::Sha1`
 - `crypto::sha2::Sha256` to `sha2::Sha256`

Reviewed By: jsgf

Differential Revision: D20456962

fbshipit-source-id: 2e3406dedba05245265d96b480c35ba2421aa3fd
2020-03-19 19:00:06 -07:00
svcscm
378d03858f Updating submodules
Summary:
GitHub commits:

9b74a85c6a
ecf3417784
eca93a4502
a795f497ea
efd1abfa80
d5f8bc5505
34b8d7c8ab
6230082450
233dca40b4
5dd79a370a

Reviewed By: wittgenst

fbshipit-source-id: b7eea2087093403480b489f2f4ac5007cf0413de
2020-03-19 18:26:39 -07:00
Koray Polat
c993337227 Update fmt from 5.3.0 to 6.1.1
Summary: Updated fmt version to be on par with buck build. It was causing inconsistencies.

Reviewed By: vitaut

Differential Revision: D20528011

fbshipit-source-id: d9e04ed2c28b839eaeff24120162c4db4732fa55
2020-03-19 17:54:15 -07:00
Steven Troxler
13fa9a5f1f Deprecate rust-crypto in eden/mononoke/filestore
Summary:
The rust-crypto library appears to be unmaintained, switching
 - `crypto::digest::Digest` to `digest::Digest`
 - `crypto::sha1::Sha1` to `sha1::Sha1`
 - `crypto::sha2::Sha256` to `sha2::Sha256`

Reviewed By: jsgf

Differential Revision: D20456840

fbshipit-source-id: 90cc031ec5402b60b6eb06a301a3733bd92bbc69
2020-03-19 17:25:44 -07:00
Xavier Deguillard
bb68ce52ff remotefilelog: provide fast path for cmp, size and isbinary
Summary: For LFS blobs, these can be obtained very easily by querying the ContentStore.

Reviewed By: DurhamG

Differential Revision: D20504235

fbshipit-source-id: 937ef20184d6524b1355565f9ab81e40b56d7ab0
2020-03-19 16:36:41 -07:00
Steven Troxler
8e99cdbd34 Asyncify the loop in statistics_collector
Summary:
This diff asyncifies the `loop_fn` call in `run_statistics`.

I was unable to find an existing example of asyncifying an infinite
loop - my solution requires allowing the `Ok` around my `loop`
to be unreachable via the `#[allow(unreachable_code)]` annotation. There may be
a better solution.

We also swap out the `tokio-timer` dependency, which uses old-style
futures, for current-version `tokio` so we can use the new-style future
`tokio::time::delay_for`.

Reviewed By: farnz

Differential Revision: D20527530

fbshipit-source-id: 90d30ec9465402d06d3b4b30c1bbd5e340ac94b6
2020-03-19 15:39:18 -07:00
Xavier Deguillard
68edce4365 lfs: allow the LFS remote to be a local directory
Summary:
This is only intended for Mercurial .t tests and not in any production
environment.

Reviewed By: DurhamG

Differential Revision: D20504236

fbshipit-source-id: 618e17631b73afa650875cb7217ba7c55fb9f737
2020-03-19 14:36:19 -07:00
Xavier Deguillard
9995e95e06 pyrevisionstore: expose ContentDataStore methods to Python
Summary:
This will enables the fast-path for comparing LFS blobs without reading the
entire blob.

Reviewed By: DurhamG

Differential Revision: D20504233

fbshipit-source-id: 446cec57fba77e02cc7070203bd759d341fc01ab
2020-03-19 14:36:19 -07:00
Xavier Deguillard
092cfcec7d revisionstore: add a ContentDataStore trait
Summary:
For now, this is only used for LFS, as this is the only store that can
correctly answer both.

This API will be exposed to Python to be able to have cheap filectx comparison,
and other use cases.

Reviewed By: DurhamG

Differential Revision: D20504234

fbshipit-source-id: 0edb912ce479eb469d679b7df39ba80fceef05f2
2020-03-19 14:36:18 -07:00
Xavier Deguillard
632bd53a02 revisionstore: add a LFS remote store
Summary:
This enables fetching blobs from the LFS server. For now, this is limited to
fetching them, but the protocol specify ways to also upload. That second part
will matter for commit cloud and when pushing code to the server.

One caveat to this code is that the LFS server is not mocked in tests, and thus
requests are done directly to the server. I chose very small blobs to limit the
disruption to the server, by setting a test specific user-agent, we should be
able to monitor traffic due to tests and potentially rate limit it.

Reviewed By: DurhamG

Differential Revision: D20445628

fbshipit-source-id: beb3acb3f69dd27b54f8df7ccb95b04192deca30
2020-03-19 14:36:18 -07:00
svcscm
3a0c35a7b6 Updating submodules
Summary:
GitHub commits:

368451edbe
8c6cf3a291
e10553f2a6
17fecc692a

Reviewed By: wittgenst

fbshipit-source-id: bfce0c3da761dfcdc10dd0982269a35feaffcc16
2020-03-19 12:59:35 -07:00
Stanislau Hlebik
757fab414c mononoke: prefix ods key
Summary: Most of our keys are prefixed, let's prefix this as well

Differential Revision: D20536231

fbshipit-source-id: 9a2ffecfc7de46d109a9fba2444212735cacbebf
2020-03-19 12:28:54 -07:00
Aida Getoeva
4815913d9e mononoke/scs: use changeset info in changeset context
Summary:
Changeset info is less expensive to load than Bonsai, so we would like to use it in SCS as a source of commit info if possible.

This diff adds a method into the Repo object that checks `changeset_info` derivation is enabled for the repo in the `DerivedDataConfig`. If derivation is enabled, then SCS derives this info otherwise it awaits for bonsai and converts it into the changeset info. The bonsai fields aren't copied but moved to the `ChangesetInfo`.

Reviewed By: StanislavGlebik

Differential Revision: D20282403

fbshipit-source-id: b8ddad50dcd5c6de109728b2081ca5a13f440988
2020-03-19 12:16:40 -07:00
svcscm
17b95307b6 Updating submodules
Summary:
GitHub commits:

ced74147c3
33849b670b
63bf7655e4
d70eb504b7
442404558a
fbf509dcb5

Reviewed By: wittgenst

fbshipit-source-id: a3eb6b95a915e85e88719ca5870e5c34f4dfed7f
2020-03-19 11:17:05 -07:00
Steven Troxler
882c2c04d6 Push compat one layer down in statistics_collector
Summary:
This diff asyncifies the outermost layer of `statistics_collector`,
so that `main` doesn't need a `compat`, by extracting the
futures portion of `main` into an async function `run_statistics`
and using async futures for the outermost layers of `run_statistics`
logic (everything outside the `loop_fn` call)

Reviewed By: farnz

Differential Revision: D20527529

fbshipit-source-id: 00ad9033584360f45715719f2636dcfac1926004
2020-03-19 10:55:11 -07:00
Jun Wu
6ffdcebadf tracing: write some blackbox events as tracing events
Summary:
This is the start of migrating blackbox events to tracing events. The
motivation is to have a single data source for log processing (for simplicity)
and the tracing data seems a better fit, since it can represent a tree of
spans, instead of just a flat list. Eventually blackbox might be mostly
a wrapper for tracing data, with some minimal support for logging some indexed
events.

Reviewed By: DurhamG

Differential Revision: D19797710

fbshipit-source-id: 034f17fb5552242b60e759559a202fd26061f1f1
2020-03-19 10:23:24 -07:00
Jun Wu
609330486e smartlog: optimize --all with narrow-heads
Summary:
The `all()` revset is much slower with narrow-heads for correctness. Use an
alternative that is fast.

Reviewed By: markbt

Differential Revision: D20528063

fbshipit-source-id: c8ae35e67e60407406ca81d67878278392626e9a
2020-03-19 10:05:28 -07:00
Kostia Balytskyi
c058e72f48 mononoke: migrate filestore's rechunk API to async/await
Summary: A little step towards asyncifying the filestore. This is just mechanical, without removing clones. TBD: add a diff, which starts to actually use the benefits of new futures.

Reviewed By: farnz

Differential Revision: D20534272

fbshipit-source-id: a038e6f22b666f3f2c9782ee25c0c2582ddced6c
2020-03-19 09:24:30 -07:00
James Crooks
d2f5062182 Move fbcode/eden/mononoke/cmds/populate_healer.rs to async diff4
Summary:
Last diff. Fully migrates all of populate_healer.rs to async/await
futures.  This makes `put_resume_state()` async, with one `.compat()` call needed
for dealing with `manifold.put()`. Also changes `populate_healer_queue()` to
use the new async `put_resume_state()`. At this point, the only `.compat()`
calls remaining are for interop with ThrifManifoldBlob's interface, and can be
removed once ThriftManifoldBlob is updated or provides async replacement
functions. All explicit old-style future creation sites have been removed in
favor of 0.3 futures.

Reviewed By: krallin

Differential Revision: D20479264

fbshipit-source-id: baad535da3fc8b621d72de567454bcd64862977a
2020-03-19 09:16:25 -07:00
James Crooks
7ecd298e7b Move fbcode/eden/mononoke/cmds/populate_healer.rs to async diff3
Summary: Moves to using 0.3 futures inside of the populate_healer_queue() function. This leaves only one remaining source of `.compat()` calls inside of populate_healer.rs, which will be removed in the following diff.

Reviewed By: krallin

Differential Revision: D20473834

fbshipit-source-id: 6d76e0673b875fba15611a495d86b9ca0b1695db
2020-03-19 09:16:25 -07:00
Stanislau Hlebik
107d049cf9 mononoke: fix some of the suggestions from clippy
Summary:
Run buck build -c rust.clippy=true eden/mononoke/:mononoke#check and fix some
of them manually. I wasn't able to make rustfix to work - will try to see
what's wrong and run it.

The suggestions looks non-controversial

Reviewed By: krallin

Differential Revision: D20520123

fbshipit-source-id: 25d4eb493f2363c5aa77bdb3876da4378483f6cb
2020-03-19 06:06:10 -07:00
Kostia Balytskyi
95b17f1d4d mononole: migrate filestore's test_api to fbinit::compat_test
Summary: This makes thigs a little more readable.

Reviewed By: krallin

Differential Revision: D20515645

fbshipit-source-id: ae04e18b0f415353431a995ae22844f6e301780c
2020-03-19 05:20:45 -07:00
Kostia Balytskyi
04406a7e3c mononoke: fix a typo
Reviewed By: krallin

Differential Revision: D20470561

fbshipit-source-id: 3f8072570dc652df952f4e6c79b07dff3fa5fe2b
2020-03-19 05:20:44 -07:00
Kostia Balytskyi
96cba6e4dc mononoke: introduce rechunk_if_needed fn to the filestore
Summary:
This is going to be used in D20469131, but in a nutshell the idea is to
perform as many checks as possible before actually doing the rechunking.
This way we can avoid churning through the entire blobstore.

Reviewed By: krallin

Differential Revision: D20491189

fbshipit-source-id: 4f7c2a8e02c890db789d25aa819b5c91d08ea7be
2020-03-19 05:20:44 -07:00
Thomas Orozco
01c05f5925 mononoke/hgproto: zero copy-validation (120x faster on 70MiB Gettreepack)
Summary:
The way decoders work in Tokio is that they get repeatedly presented whatever
is on the wire right now, and they have to report whether the data being
presented is valid and they'd like to consume it (and otherwise expect Tokio to
provide more data).

It follows that decoders have to be pretty fast, because they will be presented
a bunch of data a bunch of times. Unfortunately, it turns out our SSH Protocol
decoder is everything but.

This hadn't really been a problem until now, because we had ad-hoc decoding for
things like Getpack that might have a large number of parameters, but for now
the designated nodes implementation is decoded in one go through the existing
Gettreepack decoder, so it is important ot make the parsing fast (not to
mention, right now, we buffer the entire request for Getpack as well ... so
maybe we could actually update it to this too!).

Unfortunately, as I mentioned, right now the parsing wasn't fast. The reason is
because it copies parameters to a `Vec<u8>` while it decodes them. So, if
you start decoding and copying, say, 50MB of arguments, before you find out
you're missing a few more bytes, then you just copied 50MB that you need to
throw away.

Unfortunately, the buffer size is 8KiB, so if we say "I need more data", we get
8KiB. That means that if we want to decode a 70MiB request, we're going to make
8960 ( = 70 * 1024 / 8) copies of the data (the first 8KiB, then the first 16,
and so on), which effectively means we are going to copy and throw away ~612GiB
of data (8960 * 70 / 2). That's a lot of work, and indeed it is slow.

Fortunately, our implementation is really close to doing the right thing. Since
everything is length delimited, we can parse pretty quick if we don't make
copies: all we need to do is read the first length, skip ahead, read the second
length, and so on.

This is what this patch does: it extracts the parsing into something that
operates over slices. Then, **assuming the parsing is successful** (and that is
the operative part here), it does the conversion to an owned Vec<u8>.

In O(X) terms .. this means the old parsing is O(N^2) and the new one is O(N).

I actually think we could take this one step further and do the conversion even
later (once we want to start decoding), but for now this is more than fast
enough.

After this patch, it takes < 1 second to parse a 70MiB Gettreepack request.
Before this patch, it took over 2 minutes (which is 3 times longer than it
takes to actually service it).

PS: While in there, I also moved the `gettreepack_directories` function to a
place that makes more sense, which I had introduced earlier in the wrong place
(`parse_star`, `parse_kv` and `params` are a group of things that go together,
it's a bit clowny to have `gettreepack_directories` in the middle of them!).

Reviewed By: kulshrax

Differential Revision: D20517072

fbshipit-source-id: 85b10e82768bf14530a1ddadff8f61a28fdcbcbe
2020-03-19 04:31:23 -07:00
svcscm
e69973e62d Updating submodules
Summary:
GitHub commits:

1b37794ff8

Reviewed By: wittgenst

fbshipit-source-id: ff8d72e6e8b3ff68a8c37ca867fc3236f4d18917
2020-03-19 04:31:22 -07:00
svcscm
d118dc85d4 Updating submodules
Summary:
GitHub commits:

ef157d4f41
d462322b1e
86727df12a

Reviewed By: wittgenst

fbshipit-source-id: 9fd53212430404c12ba07c954d3c142828d4167b
2020-03-19 01:58:42 -07:00
Arun Kulshreshtha
431a9c02b5 mercurial_types: rename Node to HgId
Summary: The `Node` type in Mercurial's Rust code was renamed to `HgId`, with an alias to `Node` to keep older code building. Let's rename the usages in Mononoke to `HgId` to reduce ambiguity and keep the terminology consistent with Mercurial.

Reviewed By: StanislavGlebik

Differential Revision: D20460543

fbshipit-source-id: f6d8e3aef42743370323cde79ec10b21de956313
2020-03-19 01:43:12 -07:00
Stanislau Hlebik
bf866d3a21 mononoke: log how many filenodes were inserted
Summary:
It was (or rather, might have been) useful during debugging of S197766.
Let's now count both "count" (i.e. how often the method was called)
and count how many filenodes were inserted

Reviewed By: krallin

Differential Revision: D20519701

fbshipit-source-id: f19f413171fcbcc300deffbe29baa946ebbe8dce
2020-03-19 01:22:23 -07:00
svcscm
ad42aee4cc Updating submodules
Summary:
GitHub commits:

7be4309f89
b331064b7c
1fb58e14c7

Reviewed By: wittgenst

fbshipit-source-id: a7a787dda67ed01744c7e76eeb6b94ab18c5a849
2020-03-19 01:22:23 -07:00
svcscm
cd854340a4 Updating submodules
Summary:
GitHub commits:

16e810d342
42e49bb262

Reviewed By: zpao

fbshipit-source-id: ed10e85c6f659b488aff2c7fbf21b0a34657cc18
2020-03-18 21:43:25 -07:00
Johann Steinbrecher
a2530a1bcb Deprecate rust-crypto in eden/mononoke/repo_client
Reviewed By: jsgf

Differential Revision: D20428696

fbshipit-source-id: 1d38512d1988ecb66a2b46f967737d8df3b6aabb
2020-03-18 19:34:38 -07:00
svcscm
45510e8302 Updating submodules
Summary:
GitHub commits:

c7d31e8210
20d785d777
217ce20021
259f7fc79e
4946218386

Reviewed By: zpao

fbshipit-source-id: 63075a64d5840e63c8a09170f2e56a6817a8bda0
2020-03-18 18:51:25 -07:00
Arun Kulshreshtha
1e698d4aaf treemanifest: add ondemandfetch parameter to _gettrees
Summary: Based on comments on D20382825, we need to make sure that `_gettrees()` knows for sure whether on-demand tree fetching is in use in order to properly identify missing nodes in the response.

Reviewed By: quark-zju

Differential Revision: D20520439

fbshipit-source-id: ffa6d62dbe8b6f641b1dacebcb6f94ceae714c1b
2020-03-18 18:24:41 -07:00
svcscm
1bbf120f49 Updating submodules
Summary:
GitHub commits:

00c84e07b5
c28e7deff2
bbf1e7a9d6

Reviewed By: zpao

fbshipit-source-id: 930e21c3c66a9f11ed1a5bebb72f7f2f9fecb7a0
2020-03-18 16:20:45 -07:00
Dan Forest
59c4761872 clean API naming + make fbwhoami refreshable
Summary: 'new' is not very explicit with the fact that things are not refreshed.

Reviewed By: dtolnay

Differential Revision: D20356129

fbshipit-source-id: ff4a8c6fe4c34e93729c902e4b41afbe3c9deca1
2020-03-18 15:52:18 -07:00
Jun Wu
8cc30ac302 dag: add Segment::new API
Summary:
Now Segment has no lifetime we can create it directly and return the ownership.

Performance of "building segments" does not seem to change:

  # before
  building segments                                 750.129 ms

  # after
  building segments                                 712.177 ms

Reviewed By: sfilipco

Differential Revision: D20505200

fbshipit-source-id: 2448814751ad1a754b90267e43262da072bf4a16
2020-03-18 15:05:58 -07:00
Jun Wu
1bd54a5971 dag: drop lifetime on Segment<'a>
Summary:
This allows structures like BTreeMap to own and store Segment.

It was not possible until D19818714, which adds minibytes::Bytes interface for
indexedlog.

In theory this hurts performance a little bit. But the perf difference does not
seem visible by `cargo bench --bench dag_ops`:

  # before
  building segments                                 714.420 ms
  ancestors                                          54.045 ms
  children                                          490.386 ms
  common_ancestors (spans)                            2.579 s
  descendants (small subset)                        406.374 ms
  gca_one (2 ids)                                   161.260 ms
  gca_one (spans)                                     2.731 s
  gca_all (2 ids)                                   287.857 ms
  gca_all (spans)                                     2.799 s
  heads                                             234.130 ms
  heads_ancestors                                    39.383 ms
  is_ancestor                                       113.847 ms
  parents                                           251.604 ms
  parent_ids                                         11.412 ms
  range (2 ids)                                     117.037 ms
  range (spans)                                     241.156 ms
  roots                                             507.328 ms

  # after
  building segments                                 750.129 ms
  ancestors                                          53.341 ms
  children                                          515.607 ms
  common_ancestors (spans)                            2.664 s
  descendants (small subset)                        411.556 ms
  gca_one (2 ids)                                   164.466 ms
  gca_one (spans)                                     2.701 s
  gca_all (2 ids)                                   290.516 ms
  gca_all (spans)                                     2.801 s
  heads                                             240.548 ms
  heads_ancestors                                    39.625 ms
  is_ancestor                                       115.735 ms
  parents                                           239.353 ms
  parent_ids                                         11.172 ms
  range (2 ids)                                     115.483 ms
  range (spans)                                     235.694 ms
  roots                                             506.861 ms

Reviewed By: sfilipco

Differential Revision: D20505201

fbshipit-source-id: c34d48f0216fc5b20a1d348a75ace89ace7c080b
2020-03-18 15:05:57 -07:00
Durham Goode
ba122de053 tests: remove platform condition in eolfilename
Summary: Now that we sort the errors, we don't need this condition anymore.

Reviewed By: xavierd

Differential Revision: D20517578

fbshipit-source-id: 7012de387ee8acee1c1b630991f3a289a3fa48d1
2020-03-18 13:59:35 -07:00
svcscm
a2eec0f3e7 Updating submodules
Summary:
GitHub commits:

59d4d94f07
658783cd67
186b9b0d1e
eeb7fb01e3

Reviewed By: zpao

fbshipit-source-id: 83036ae89d7e0377866ae2b551eac694a111b79d
2020-03-18 13:26:02 -07:00
Jun Wu
09e92a8d32 fscap: add osxfuse_eden
Summary:
EdenFS is reported as `osxfuse_eden` on OSX after D20313385.
Update the fscap table to avoid slow paths testing fs capabilities.

Without this diff, churns on edenfs OSX will trigger undesirable watchman
events.

Reported by: fanzeyi

Reviewed By: fanzeyi

Differential Revision: D20518902

fbshipit-source-id: 2e8e472df16d08b17834b2c966c065bbaad052fe
2020-03-18 13:14:19 -07:00
Thomas Orozco
956c768095 mononoke/repo_client: add telemetry for designated nodes
Summary:
Now that Arun is about to roll this out to the team, we should get some more
logging in place server side. This updates the designated nodes handling code
to report whether it was enabled (and log prior to the request as well).

Reviewed By: HarveyHunt

Differential Revision: D20514429

fbshipit-source-id: 76ce62a296fe27310af75c884a3efebc5f210a8a
2020-03-18 12:57:34 -07:00
svcscm
845b28e870 Updating submodules
Summary:
GitHub commits:

a83730bad7
1f4ffda4d8

Reviewed By: zpao

fbshipit-source-id: 844ea354e44b63f6f3a67555af381580dde2aa76
2020-03-18 12:49:09 -07:00
Xavier Deguillard
db310fc87f revisionstore: replace lazy_init with once_cell
Summary:
The later is what is now recommended, and no longer requires a macro to
initialize a lazy value, leading to nicer code.

Reviewed By: DurhamG

Differential Revision: D20491488

fbshipit-source-id: 2e0126c9c61d0885e5deee9dbf112a3cd64376d6
2020-03-18 12:20:12 -07:00
svcscm
12a1d1c761 Updating submodules
Summary:
GitHub commits:

5c4e6238a4
8ad4b32c5d

Reviewed By: zpao

fbshipit-source-id: 23d10c439f7a87d4e5c61798a94b4fe620596826
2020-03-18 12:20:11 -07:00
svcscm
21581c9301 Updating submodules
Summary:
GitHub commits:

daa5f0c1f5

Reviewed By: zpao

fbshipit-source-id: 048d4e62a491bf92b2fc9717f83d9c4b8df14b6f
2020-03-18 11:14:52 -07:00
Xavier Deguillard
9c8633bb0a revisionstore: address clippy warnings
Summary:
Lots of different warnings on this one. Main ones were:
 - One bug where .write was used instead of .write_all
 - Using .next instead of .nth(0) for iterators,
 - Using .cloned() instead of .map(|x| x.clone())
 - Using conditions as expressions instead of mut variables
 - Using .to_vec() on slices instead of .iter().cloned().collect().
 - Using .is_empty instead of comparing .len() against 0.

Reviewed By: DurhamG

Differential Revision: D20469894

fbshipit-source-id: 3666a44ad05e0fbfa68d490595703c022073af63
2020-03-18 10:16:39 -07:00
Xavier Deguillard
a760c0e672 edenapi: address clippy warnings
Reviewed By: DurhamG

Differential Revision: D20469646

fbshipit-source-id: 222f75196ef140c2e9bdfc0a0500f3fbcffb2309
2020-03-18 10:16:39 -07:00
Xavier Deguillard
121e524df9 blackbox: address clippy warnings
Reviewed By: DurhamG

Differential Revision: D20469649

fbshipit-source-id: 99b0e68259b5e2ed5b1c969d0a5fa8473e899f17
2020-03-18 10:16:39 -07:00
Xavier Deguillard
aae9075762 lz4-pyframe: address clippy warnings.
Reviewed By: DurhamG

Differential Revision: D20469648

fbshipit-source-id: 346c8a23ff2b4a895a066843ebe5341103956e76
2020-03-18 10:16:38 -07:00