Commit Graph

65413 Commits

Author SHA1 Message Date
Xavier Deguillard
76111d58c2 privhelper: override the fstype to EdenFS for our NFS mount
Summary:
In order to get Watchman to recognize EdenFS mounted as NFS, we previously set
the f_mntfromname to be "edenfs". Unfortunately, Apple decided that when the
NFS server is accessed via a unix socket it would overwrite that and instead
use the path to the socket.

Digging in the source code, I did find that the f_fstypename can be overwritten
by calling fsctl with the right set of arguments. Thus, let's do just that.

Reviewed By: kmancini

Differential Revision: D28270605

fbshipit-source-id: f6be4e394d814806aa03ec3e82b8bc2faf364ea7
2021-05-12 13:06:57 -07:00
Xavier Deguillard
f2e7099799 nfs: allow mountd and nfsd to bind to a unix socket on macOS
Summary:
Due to NFS being designed as a network filesystem, it default to binding on a
TCP socket. For EdenFS, since we're not expecting to mount an actual remote
filesystem, we bind these sockets to localhost. Unfortunately, TCP sockets have
some inherent overhead due to being designed to be reliable over a non-reliable
medium.

On macOS, Apple provides a way to mount an NFS server that is listening on a
unix domain socket. Thanks for unix socket being reliable, the TCP overhead
goes away leading to some higher throughput and lower latency for the NFS
server. For EdenFS, timing `rg foobar` over a directory containing 27k files gives:

NFS over TCP:
rg foobar > /dev/null  0.80s user 5.44s system 567% cpu 1.100 total

NFS over UDS:
rg foobar > /dev/null  0.77s user 5.27s system 679% cpu 0.888 total

osxfuse:
rg foobar > /dev/null  0.87s user 5.59s system 662% cpu 0.975 total

The main drawback of going through a unix socket is that D27717945 (bcf6aa465c) appears to
no longer be effective due to
8f02f2a044/bsd/nfs/nfs_vfsops.c (L3739)

Reviewed By: kmancini

Differential Revision: D28261422

fbshipit-source-id: 25dc1dc78cdb50d6c6550a86ef01ea2c894c110f
2021-05-12 13:06:57 -07:00
Xavier Deguillard
fdbedc4818 nfs: allow mountd and nfsd sockets to be non-inet on macOS
Summary:
macOS supports NFS servers that can be reached via a unix socket as a way to
improve performance by reducing the TCP cost. To support this, let's first
allow the socket to bind to to be passed to the RpcServer, and then pass it
through to the privhelper code.

Reviewed By: kmancini

Differential Revision: D28261423

fbshipit-source-id: 78c60aac26353d1da76a67897429b964332df8b3
2021-05-12 13:06:57 -07:00
svcscm svcscm
a22ed01bfe Updating submodules
Summary:
GitHub commits:

36a8e0f3ee
9203e66516
e9a0bc14dd
f065c670ec
52b653c3ec

Reviewed By: wittgenst

fbshipit-source-id: 97c1c721cc0674d3cdbbfe3136b85e1e886055e6
2021-05-12 12:33:19 -07:00
Xavier Deguillard
6de9b24cb0 Back out "checkout: keep InodeNumber constant during checkout"
Summary: Looks like this is causing files to not be immediately updated after an update.

Reviewed By: kmancini

Differential Revision: D28384151

fbshipit-source-id: 61159db64a9f3c9c1f9e54ee0462ca870ff2aecc
2021-05-12 12:26:53 -07:00
Jan Mazur
490cbbf0c3 mocking LFS in revisionstore tests
Summary: Mocking LFS server.

Reviewed By: krallin

Differential Revision: D28093406

fbshipit-source-id: fe6acb2e327ee26dd424d91b66ed725339f19431
2021-05-12 12:05:05 -07:00
Kostia Balytskyi
0a58fc0c46 megarepo_api: introduce a MegarepoApi struct to rule them all
Summary:
This struct is intended to be a single entry-point to the megarepo logic. It is also intended to be owned directly by scs_server without the `Mononoke` struct (from `mononoke_api`) intermediary. In effect, this means that mononoke server won't be affected by `MegarepoApi` at all.

Apart from adding this struct, this diff also adds instantiation of prod `AsyncMethodRequestQueue` and wires it up to the scs_server to enqueue and poll requests.

Reviewed By: StanislavGlebik

Differential Revision: D28356563

fbshipit-source-id: b67ee48387d794fd333d106d3ffd40124086c97e
2021-05-12 12:00:20 -07:00
svcscm svcscm
1c34efcfdb Updating submodules
Summary:
GitHub commits:

6224b9348a
0a43167ac4
b9054c5b81
46c67852fe
a6e425dc44
97089cb024
4adf4365c6
3abd78ed74
4b8aaad426

Reviewed By: wittgenst

fbshipit-source-id: b6edd87863b6c808b827a616577f2f66c1eebe80
2021-05-12 11:53:54 -07:00
svcscm svcscm
4b6bef1b78 Updating submodules
Summary:
GitHub commits:

a0fd7fbde5

Reviewed By: wittgenst

fbshipit-source-id: 8b9c94d7ccffe85eb58fceaebe43bccc36d8af5b
2021-05-12 09:17:04 -07:00
Ron Mordechai
77b7617d4b Add myparenttags
Summary: I use tags extensively and I love them to be supported as well.

Reviewed By: asm89

Differential Revision: D28348565

fbshipit-source-id: 7d94d048b734c91e7d74a1c3efeefc87943066ad
2021-05-12 08:20:53 -07:00
Kostia Balytskyi
f93404fb67 repo_factory: make clonable
Summary:
With `MegarepoApi` struct in play, there is a genuine need to have two repo
factories in a single process: this allows the structure to be self-sufficient
and instantiated without any references to `Mononoke` from `monooke_api`.

While this need could be solved by just wrapping a `RepoFactory` in an `Arc`,
it seems like most of it is already clonable, so let's just make it fully
clonable by fixing a few remaining places. (I prefer this over `Arc`, because
there's less refactoring of unrelated code). Given that there will likely be a
single digit of repo factories instantiated in a single process, the difference
between a single arc's clone (`Arc<RepoFactory>`) and ~10 arc clones (what I
did) is negligible.

Differential Revision: D28379860

fbshipit-source-id: fbddbdc913fedcd5846366344bc2f2c1ec4bd91e
2021-05-12 05:54:12 -07:00
Kostia Balytskyi
501246bbd4 repo_factory: teach it to open long_running_requests_queue
Summary: This way implementing MegarepoApi is more convenient.

Reviewed By: krallin

Differential Revision: D28355487

fbshipit-source-id: e7643e854ee46fe6cb9c4a882f6c677bf4e77262
2021-05-12 05:19:42 -07:00
Stanislau Hlebik
8a158fae83 mononoke: make sure partial getbundle optimization traverses the commits in generation number order
Summary:
Partial getbundle optimization didn't work correctly if one merge parent was an ancestor
of another - it might return a parent commit before a child commit. Say we had a graph like this

```
C
| \
| B
| /
A
```

Previously partial getbundle optimization could have visited A before it
visited B, and returned commits in the wrong order, which in turn would lead to
"hg pull" failures. The reason for that is that we don't order commits by generation number.

This diff fixes it by using UniqueHeap to sort commits by generation number
before returning them. Also note that as the name suggests UniqueHeap stores
only unique values in the heap, so we don't need to keep separate `visited`
hashset

Reviewed By: krallin

Differential Revision: D28378145

fbshipit-source-id: 9467fb7cfa8386e9e2725b80f386240b522ff3ee
2021-05-12 04:51:54 -07:00
Stanislau Hlebik
c189916f9b mononoke: move copy_file_contents to commit_transformation
Summary:
Just as with rewrite_commit function that I moved a to commit_transformation
not so long ago (D28259214 (df340221a0)), let's also move copy_file_contents. The motivation
is because we are going to use it in the next diff for sync_changeset method.

Reviewed By: ikostia

Differential Revision: D28352402

fbshipit-source-id: 12288a51540c9793d988e4063735bcbc1c3b1a7f
2021-05-12 04:44:34 -07:00
svcscm svcscm
f8c8fdd44d Updating submodules
Summary:
GitHub commits:

c9cc3f4f1c
2510c37a64
a8e126d4ab
d61a2278ea

Reviewed By: wittgenst

fbshipit-source-id: dd69d91da66951d5d8b54b96dd1721e1a9186734
2021-05-12 02:33:24 -07:00
Thomas Orozco
3296132710 mononoke: ensure filestore chunks aren't zstd-encoded when cached
Summary:
Those blobs are designed to fit in cachelib, so we shouldn't attempt to
zstd-encoded them (not to mention that they don't usually compress very well
since many of those blobs come from binary files, though that's not true of
all).

However, we weren't actually doing this right now. There were a few reasons:

- Our threshold didn't allow enough headroom. I don't know when exactly this
  got introduced (of indeed if that has worked since we introduced cachelib
  compression).
- We serialize a bunch of extra metadata that we really don't need as it's a
  bit meaningless once it's gone through the cache (we notably don't serialize
  this in Memcache). This diff updates us to just store bytes here.

Differential Revision: D28350387

fbshipit-source-id: 4d684ab58cea137044e20951ec4cbb21240b8dfc
2021-05-12 02:23:16 -07:00
Thomas Orozco
9bd8e54a9f mononoke/virtually_sharded_blobstore: refactor for better testability
Summary: See the next diff for motivation: this makes it easier to implement.

Differential Revision: D28350388

fbshipit-source-id: 026605cf8296a945d6cc81b7f36d9198325bf13c
2021-05-12 02:23:16 -07:00
Jan Mazur
aa95a51112 lower assertion limit in 'throttle by qps' test due to flakiness
Summary:
Test is flaky: https://www.internalfb.com/intern/test/281474993296146?ref_report_id=0
I suppose this happens due to mechanics how we measure qps - with low volume, some averaging or bucketing might not work as precisely as with a lot of qps we have in normal, prod scenarios.
Lowering the threshold by 1 should fix this.

Reviewed By: ahornby

Differential Revision: D28350150

fbshipit-source-id: 694bfb8cce1935704e35b27f7d4455439d4bfffe
2021-05-12 02:20:49 -07:00
Kostia Balytskyi
7d06a54ff8 megarepo_api: turn tokens into target-containing structs
Summary:
I should've made them structs from the beginning, but of course I thought that
I know better and these tokens can definitely not be richer than just strings.

Well, it turns out we need them to be richer. Specific reason is that in theory
a single Mononoke (or scs_server) instance can run with multiple storage
configs. For us this means that one target's requests may be stored in one
db, while another target's requests - in another one. For blobstores this is
even used in practice, while for xdb it's just a theoretical thing, but we need
to support it nevertheless.

To do so, let's add the ability to query the target (and, correspondingly, the
Mononoke repo) from any king of params our async methods receive: ThriftParams
or Token implementors.

In addition, this diff really implements `AddScubaParams` and `AddScubaResponse` for more things than before, so there's that.

Finally, apart from making tokens structured, this diff also changes an interface in two more ways:
- it adds optional `message` fields to several params structs
- it adds `changesets_to_merge` to `MegarepoChangeTargetConfigParams`

Reviewed By: StanislavGlebik

Differential Revision: D28333999

fbshipit-source-id: 99bd19b040b59ee788ef661dda3171cc56254d33
2021-05-12 02:01:06 -07:00
svcscm svcscm
dee8e4f613 Updating submodules
Summary:
GitHub commits:

f4fd2eaccf
6546c2c423
57bfd7677f
30f25ea1bc
de2ededb1e
647b1d5756

Reviewed By: wittgenst

fbshipit-source-id: b5ba22d208628cb52e2e63e648c5355447b911b8
2021-05-12 01:35:08 -07:00
svcscm svcscm
e6ecebfee7 Updating submodules
Summary:
GitHub commits:

b850c81865
a14079e2e9
2d4f661dc1
7910562665
34bc71b4b4
68db09871d
3dd4c1d9e6
1c63b9c627
1f7704c9a2

Reviewed By: wittgenst

fbshipit-source-id: 9f06d005e194fed308a13ba085363c99057fd5c4
2021-05-12 01:00:14 -07:00
svcscm svcscm
05ca5260c0 Updating submodules
Summary:
GitHub commits:

73b7f275c1
4bd1d51836
3eeebbfa65
73d8e4e122
da0d0b1961
6d81feb0d3
0ae03e2422
bafe2fa14d
5b43b98c44
2ccee81665

Reviewed By: wittgenst

fbshipit-source-id: ffe509107a67e4ede54e381bc18d7968f1e0a14c
2021-05-12 00:16:49 -07:00
svcscm svcscm
c19233e74e Updating submodules
Summary:
GitHub commits:

40233942b5
582aefa66d

Reviewed By: wittgenst

fbshipit-source-id: f8d9d6007ead7481e397c34f6d02bc50cbb1717a
2021-05-11 23:21:43 -07:00
svcscm svcscm
014626bf3a Updating submodules
Summary:
GitHub commits:

4968806861
742081dab6
4fcab0b961
47a59de7e2
477ed51270

Reviewed By: wittgenst

fbshipit-source-id: b93bdb691c40c18d3c538f24fa106ecb5e656a85
2021-05-11 21:31:15 -07:00
svcscm svcscm
4e9362b380 Updating submodules
Summary:
GitHub commits:

127c65f57e

Reviewed By: wittgenst

fbshipit-source-id: a35686bb052e47e0061790bd3c1be170a0636183
2021-05-11 20:48:23 -07:00
svcscm svcscm
85d657068e Updating submodules
Summary:
GitHub commits:

16c8b3d57a
cfdd0d8103
944796b9f5
23076f0174

Reviewed By: wittgenst

fbshipit-source-id: ff8c537036615b6a3fd25dfa373a833fd24e8682
2021-05-11 20:08:40 -07:00
svcscm svcscm
a6f7b1dd82 Updating submodules
Summary:
GitHub commits:

d23486ff43
ca094fb15d
638e100d20
2dabd0ecc5
8e4b8099e2
c61c4936ef

Reviewed By: wittgenst

fbshipit-source-id: 48a4df8444dc305030a2fcdc9f3252e886e3c278
2021-05-11 19:38:40 -07:00
svcscm svcscm
645ca2d252 Updating submodules
Summary:
GitHub commits:

68c437e952
f3949783b7
876aea4031
894a3e1ead
ee18030709
f4cdc5fc28
866d59704a
85a924ada3
ca849b7edd

Reviewed By: wittgenst

fbshipit-source-id: 172a69a0bed00981e7a82ff35b3b7e381508cce8
2021-05-11 19:05:50 -07:00
Arun Kulshreshtha
5b759a2b52 http-client: pass certs to libcurl as in-memory blobs
Summary: Instead of passing a client certificate path to libcurl, load the certificate into memory and pass it to libcurl as a blob using `CURLOPT_SSLCERT_BLOB`. This allows us to convert the certificate format in-memory from PEM to PKCS#12, the latter of which is supported by the TLS engines on all platform (and notably SChannel on Windows, which does not support PEM certificate).

Reviewed By: quark-zju

Differential Revision: D27637069

fbshipit-source-id: f7f8eaafcd1498fabf2ee91c172e896a97ceba7e
2021-05-11 18:25:13 -07:00
Arun Kulshreshtha
356e56bd4f windows: copy OpenSSL DLLs alongside executable
Summary:
The Rust `openssl` crate will using dynamic linking by default when built with `cargo`. This is a problem on Windows, since we only support cargo-based builds on that platform, but OpenSSL is not present in the system's shared library search paths.

Since we already have a copy of OpenSSL uploaded to LFS, the simplest solution is to just copy the required DLLs right next to the Mercurial executable so that they will be found at launch.

A better solution would probably be to use static linking here. From reading the crate's documentation (and build script), it seems like setting `OPENSSL_STATIC=1` during the build should force static linking, but in practice I have not been able to get this to work.

Reviewed By: DurhamG

Differential Revision: D28368579

fbshipit-source-id: 3fceaa8d081650d60356bc45ebee9c91ef474319
2021-05-11 18:25:13 -07:00
svcscm svcscm
ba76b25c6f Updating submodules
Summary:
GitHub commits:

7a39d3d63c
696837c9da
d93eea7d9f
b90e322853
d51b1776e1
43b63d8f6b
b811a8a026
744e8c9b09
ab5d1375b3
5732b871d4
86c7e317d8

Reviewed By: wittgenst

fbshipit-source-id: 5f3b57ae8f8a74e4c7c02e9ab45aef5539b5b046
2021-05-11 17:33:42 -07:00
svcscm svcscm
82c6629c06 Updating submodules
Summary:
GitHub commits:

7987df2c1e
fef5912901
78a309bf86

Reviewed By: wittgenst

fbshipit-source-id: 12802654bf567b82e824867a2835ad8c94fcd3e6
2021-05-11 17:05:01 -07:00
svcscm svcscm
2486c63082 Updating submodules
Summary:
GitHub commits:

c94fb0887a
e3a8286a33
fa572b7150
ee78417a84

Reviewed By: wittgenst

fbshipit-source-id: 18b9b3112e9910210f98068647b14aa90426aad0
2021-05-11 14:18:45 -07:00
Liubov Dmitrieva
297ab79a2a split full sync into 3 passes
Summary:
split full sync into 3 steps

Commit cloud by default pulls only 30 days of commits.

Users often see some of their commits are missing in their smartlog.

I discovered that most of the users know the '--full' option (`hg cloud sync --full`) but not the 'max_sync_age' config option.

So, they try --full option but it could fail due to very very old commits we haven't migrated to Mononoke.

Users often don't really need those commits but it's not nice that the whole sync run failed.

We know that at least latest 2 years of commits are present in Mononoke.

So if we split a bit how we sync with --full option works, it would at least result in partially successfully sync for the latest 2/3 years of commits.

Reviewed By: mitrandir77

Differential Revision: D28352355

fbshipit-source-id: b5bacd7d5256191528613e3c0bcbb21b0104ac3c
2021-05-11 14:00:16 -07:00
svcscm svcscm
6e9934c4a9 Updating submodules
Summary:
GitHub commits:

6cd5a7840b
4ebd097b9d
acfbf29ae7
6eb91be1fb
de1fbafac7
02e3f72543

Reviewed By: wittgenst

fbshipit-source-id: 737e68316c4b6a37a1b7b5220ec1a04053f2cc48
2021-05-11 13:46:20 -07:00
svcscm svcscm
ed82971f52 Updating submodules
Summary:
GitHub commits:

ecd2214099
f82c257e26
975b399bfa
300032813e
a662ec9750
ccf2a09dff
0a4d21fb29
d8da1b8449
525369dd73

Reviewed By: wittgenst

fbshipit-source-id: 516968241b13901f693132a60b9e3af610fc8a1c
2021-05-11 13:12:54 -07:00
Liubov Dmitrieva
2c3edb0989 deprecate 4 commits at a time limitation for unhydrated pulls
Summary:
deprecate 4 commits at a time limitation for unhydrated pulls

This could speedify cloud join commands significantly (by many X times) and hg cloud sync --full command.

Reviewed By: farnz

Differential Revision: D28351849

fbshipit-source-id: f9f3d7a5c07d61cb51a5bb6284afaad963662c94
2021-05-11 12:40:39 -07:00
svcscm svcscm
dd72cd4c2d Updating submodules
Summary:
GitHub commits:

0413061967
8f8eddc3be
141bd6c69a
a98ea5aac8
0f44b8ca7e
a75fdc0b4e
322a7a67fc
2e835c837a
f2c420a601
c0d8037e09

Reviewed By: wittgenst

fbshipit-source-id: 6b8b2393e563c8cf7a251de8c7a0eea93b3ae958
2021-05-11 12:36:43 -07:00
svcscm svcscm
a7287a086d Updating submodules
Summary:
GitHub commits:

ec4de25428
6f38b23125
89b8387362
11d1deaa7b
ba6477a5d8

Reviewed By: wittgenst

fbshipit-source-id: b435a345d7bbb8efaf16b2db2044fcb3cef6273b
2021-05-11 12:03:33 -07:00
svcscm svcscm
7ab264a908 Updating submodules
Summary:
GitHub commits:

4e927e71d0
eaaeb35b7b

Reviewed By: wittgenst

fbshipit-source-id: 42ccb768cc2bc4f3eabe98d0ac13da22e8c42cca
2021-05-11 11:17:51 -07:00
Kostia Balytskyi
75fcc34629 megarepo_api: add target-extracting method to ThriftParams
Summary: This is going to be used in the next diffs.

Reviewed By: StanislavGlebik

Differential Revision: D28333977

fbshipit-source-id: ad52d307e13ae9bd662209ef7ec6afdcf0ee24c7
2021-05-11 10:53:51 -07:00
svcscm svcscm
3125fbf967 Updating submodules
Summary:
GitHub commits:

51eaa36f56
fefe8c9177
1df0c7f940
8f1f6aec1d
be0741c9c3
026568e692

Reviewed By: wittgenst

fbshipit-source-id: 758cb2186e1dfc89428cc20ea74afeee184d68d4
2021-05-11 08:47:32 -07:00
Xavier Deguillard
935791590a utils: add a semi() method to ImmediateFuture
Summary:
While ImmediateFuture are expected to be used on values that are mostly
immediate, there are cases where it won't be. In these cases we need a way to
wait for the computation/IO to complete. In order to achieve this, we need to
transform an ImmediateFuture onto a SemiFuture.

Reviewed By: fanzeyi

Differential Revision: D28293941

fbshipit-source-id: 227c0acf1e22e4f23a948ca03f2c92ccc160c862
2021-05-11 08:05:11 -07:00
Xavier Deguillard
be1aeaf5be utils: add default constructor to ImmediateFuture
Summary:
When a T can be default constructed, make an ImmediateFuture default
constructible.

Reviewed By: fanzeyi

Differential Revision: D28292874

fbshipit-source-id: 4c239cc9c3f448652b2bcdc103ea1a81ace46402
2021-05-11 08:05:11 -07:00
Xavier Deguillard
f331a0c3f9 utils: add noexcept qualifier to ImmediateFuture
Summary: This should help the compiler generate even better code.

Reviewed By: chadaustin

Differential Revision: D28153979

fbshipit-source-id: b1d84c92af4fa760c92624c53d7f57330d7706fa
2021-05-11 08:05:11 -07:00
svcscm svcscm
3575f87d39 Updating submodules
Summary:
GitHub commits:

ed1888aece
eb758b534d
1f7e7d09cb
b10b837705
87a66df608
295491fdb5

Reviewed By: wittgenst

fbshipit-source-id: 47e39bd9475b4008aa5db0a1ab626c80367a8d9e
2021-05-11 07:58:53 -07:00
svcscm svcscm
310b1f7f6c Updating submodules
Summary:
GitHub commits:

683d9799e5
7f714b5c79
072fb27dc1
2ab5be3132
e2666566f3
9f2d255aed
a28117bd6f
9fd4484449
0354f157c4
afe1b20a52
426539be50

Reviewed By: wittgenst

fbshipit-source-id: 010284b07aa7b54be90d949666eb8038191ebb44
2021-05-11 07:20:21 -07:00
Thomas Orozco
baaf300c12 mononoke/edenapi: don't discard ctx.scuba() logs
Summary:
This has been here for a little while, but it's worth changing. Currently, we
entirely discard logs coming via a CoreContext in EdenAPI.

We don't typically log many of those anywhere in Mononoke, but when we do they
tend to be for error conditions, warnings, or aggregated reporting, and can be
quite meaningful as a result.

So, let's update to not discard them. To make it easy to differentiate those
logs from EdenAPI request-level logs (even though they'll both have `service` =
`edenapi`), let's give the latter a Log Tag (which is consistent with what
we do in repo client).

Differential Revision: D28350733

fbshipit-source-id: 3b12a4b56f28435460186e1f7578163ca7bdaebc
2021-05-11 06:45:37 -07:00
svcscm svcscm
212cd894ca Updating submodules
Summary:
GitHub commits:

77e9fa1666
c7ead10786
1f3358c979
859cdc5ee1
e270045a55
3369c46c36
af3ff85a9d
c482427e93
e2020d2eca
0852c0a13a

Reviewed By: wittgenst

fbshipit-source-id: 16d98e3a2aaae8d9ea2b884582c4d174a0dd3fe5
2021-05-11 05:34:44 -07:00
svcscm svcscm
79dc7cfbed Updating submodules
Summary:
GitHub commits:

956885e913

Reviewed By: wittgenst

fbshipit-source-id: cfcf403de6bd69785505366d0c7971735a815265
2021-05-11 05:02:34 -07:00