Commit Graph

68026 Commits

Author SHA1 Message Date
Xavier Deguillard
c3c63b697c privhelper: add some logging when mounting via NFS on macOS
Summary:
EdenFS would never log anything when mounting via NFS, let's make it more
visible and easier to grep.

Reviewed By: chadaustin

Differential Revision: D31022158

fbshipit-source-id: 99fd3a04c90526eedf9951ac7c2bcd9e18ef8953
2021-09-17 16:23:43 -07:00
Gus Wynn
c797db63a1 vendor tokio-console and console-subscriber
Summary:
this relies on local changes to make it so cargo metadata ACTUALLY finds this
binary: https://github.com/tokio-rs/console/pull/146 is where I try to upstream
it

Reviewed By: jsgf

Differential Revision: D30944630

fbshipit-source-id: 5d34a32a042f83eff7e7ae7445e23badf10fffe3
2021-09-17 16:23:43 -07:00
Bob Ren
2ce9908315 derive checksum from naming table
Summary: For the time being we don't have checksums in saved states. As a temporary workaround add the ability to derive the checksum from the naming table.

Differential Revision: D30967637

fbshipit-source-id: 4ac34d988d08c9af6f08f7ce46206f756cf1cf0c
2021-09-17 15:26:45 -07:00
svcscm svcscm
bc13aff3aa Updating submodules
Summary:
GitHub commits:

168e78f827
8e33e52643
b9f8b44662
4149d044cd
5b51ae6190
e993f17346
17b5db0795
949a695819
16b694b0ef
b8a856087d
dccc573661

Reviewed By: bigfootjon

fbshipit-source-id: bc001b53bbd156b6c93f8663ade9b386d188ae67
2021-09-17 15:26:45 -07:00
svcscm svcscm
e3af32b81a Updating submodules
Summary:
GitHub commits:

e698dfa1de
323ac799a1
65411b8d4e
63c6fd17ad
750fe5c15e
c74f764231
321db4dc17

Reviewed By: bigfootjon

fbshipit-source-id: bcf7c36b3467fc92e7bcc365af1863e6a3b50444
2021-09-17 12:23:18 -07:00
Chad Austin
7c3ef4fccf replace folly::Optional with std::optional
Summary: Watchman is a C++17 project now, so we can use std::optional.

Reviewed By: xavierd

Differential Revision: D30917549

fbshipit-source-id: 95d8ac15d4939a70347336ddfb120ab5025db993
2021-09-17 11:24:33 -07:00
Xavier Deguillard
4104f3d2ef service: move all glob booleans in a GlobOption structure
Summary:
Having tons of booleans in a function can be very error prone from a caller
perspective, using a structure to pass in the same information can mitigate
some of this issue.

Reviewed By: kmancini

Differential Revision: D30883743

fbshipit-source-id: dcf38d29bfe2cb5155879f7ae4eab5cea31f798a
2021-09-17 11:24:32 -07:00
Ilia Medianikov
1108dfa113 mononoke: add "source_repo" column to synced_commit_mapping
Summary: Without this bit of information we can't tell where the sync came from (i.e. from which of two repos) so we can't reliably find a commit "source" for a landed commit.

Reviewed By: StanislavGlebik

Differential Revision: D30902774

fbshipit-source-id: d85d0d028fbd6bfb2d64bce89bc7934bad2e242b
2021-09-17 09:23:42 -07:00
Xavier Deguillard
55d86a5557 cli: allow skipping chowning redirected directories
Summary:
During an `eden chown`, EdenFS will try to chown both the repository, and the
redirections. In some cases, chowning the redirection can both take a long time
and be unecessary. Consider the case where some automation temporarily chown a
repository to a service user that needs to access the repository, and then
chown it back to the owner of the repository. In that case, changing the
ownership of the redirection is superfluous and unecessary.

Reviewed By: mrkmndz

Differential Revision: D31010912

fbshipit-source-id: a882948005ac4fe29ff465088f196e0fc2bc10be
2021-09-17 09:23:42 -07:00
Mateusz Kwapich
403f9b0627 add show command to the async-requests
Summary:
This is a very basic commands that uses debug-printing to display all the
request details. In the future we might want to make it more ellaborate but
as-it-is it works.

Reviewed By: StanislavGlebik

Differential Revision: D30965076

fbshipit-source-id: 561c64597b94359843e575550be0ae6f39fad7bf
2021-09-17 09:23:42 -07:00
Mateusz Kwapich
63f37ff9c9 add async-requests subcommand
Summary:
This debug command will allow the user to see and interact with currently
running async requests.

Reviewed By: StanislavGlebik

Differential Revision: D30965077

fbshipit-source-id: 259f1af0eb6ade4a34f6004c7b1ad63cd5f0bc9f
2021-09-17 09:23:42 -07:00
Stanislau Hlebik
ee516928a1 mononoke: make some derived data mapping types comparable
Summary:
It makes it a bit hard to do experiments and compare derivation results.
It's easy to compare these types, so let's do it.

Reviewed By: mitrandir77

Differential Revision: D31017823

fbshipit-source-id: 6173bba53c7ee254198e023dde57564fe9c3efed
2021-09-17 08:25:29 -07:00
Stanislau Hlebik
66279b94a6 mononoke: make sender optional in create_leaf_unode
Summary:
This will be used in the next diffs to add batch derivations for unode.
Also it makes it symmetrical to create_manifest_unode

Reviewed By: mitrandir77

Differential Revision: D31015719

fbshipit-source-id: 65e12901c6a004375c7c0e3b07f1632ac9c6eaa8
2021-09-17 08:25:29 -07:00
svcscm svcscm
19f9a75fa1 Updating submodules
Summary:
GitHub commits:

81a4bc668c
20b3ad490c
2d282b5d80
bb619e6f7e

Reviewed By: bigfootjon

fbshipit-source-id: 0ebe3067562c97fb685f9959695214e675dcf24e
2021-09-17 04:23:35 -07:00
svcscm svcscm
755ea963ee Updating submodules
Summary:
GitHub commits:

d3a2727929
70948b54fd
dd9bd057f0
a15726d270
3e0d07e073
820689318f

Reviewed By: bigfootjon

fbshipit-source-id: 0e265988d0853547f5da452ac2595dd328810c5f
2021-09-17 03:23:46 -07:00
svcscm svcscm
06f500f77b Updating submodules
Summary:
GitHub commits:

06aa750d2a
bc06766791
5c39d8428e
3ccf7e8db3
2bdfc6553f
bdb8af6460
4470dc8ca1
8a5d1e710d
707cbf8d7d

Reviewed By: bigfootjon

fbshipit-source-id: 25d54c559586f4e2ce07f81abb2f606cb85a5205
2021-09-17 02:24:45 -07:00
svcscm svcscm
7db0a227c3 Updating submodules
Summary:
GitHub commits:

18f5de58e1
a49156eaae
5b7fe5a4ce
dcd2db09fb
b4f54830ca
e044ce7c05
9b758524f4
c07fd438c9
68dac5fad9
96654de20f
3c015a1cd8

Reviewed By: bigfootjon

fbshipit-source-id: 02fe50c541de4f37012113096b813fd365093378
2021-09-17 01:23:05 -07:00
Stanislau Hlebik
f951d8d84f mononoke: include additional bonsai changesets during segmented changelog seeder
Summary:
In some cases (e.g. when master bookmark moves backwards) there might be
commits in segmented changelog that are not ancestors of master. When reseeding
we still want to build segments for these chagnesets, and this is what this
diff does (see D30898955 for more details about why we want to build segments
for these changesets).

Reviewed By: quark-zju

Differential Revision: D30996484

fbshipit-source-id: 864aaaacfc04d6169afd3d04ebcb6096ae2514e5
2021-09-17 01:23:05 -07:00
svcscm svcscm
5a8b9b0c79 Updating submodules
Summary:
GitHub commits:

96d5498e39
1c7ef2ae28
51eb4a0566
ba2db8d9c3
a08dfd87ad
f5cd2814c0
e61e1a7ba6
8d8a39a15e
1c5a149e3b
3c03b090ba

Reviewed By: bigfootjon

fbshipit-source-id: 87f79e0704f8411cf04c27ca44cf6e81455ac948
2021-09-17 00:24:13 -07:00
svcscm svcscm
c2efb6c69d Updating submodules
Summary:
GitHub commits:

28e30941a5
41d925070f
62783db6bd
c3de919339
a1753e69f2
95707c0101
f5cb522ca7
199ea90f5e
b2a644b28b
43b5497581
25b71846c5

Reviewed By: bigfootjon

fbshipit-source-id: bfe711cb64cca80aaeb39ad43abf6c98ac3fbcbd
2021-09-16 23:22:53 -07:00
David Tolnay
6ce5dce1be Update to Rust 1.55.0
Summary: Release notes: https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html

Reviewed By: jsgf

Differential Revision: D30859665

fbshipit-source-id: 89db9befd805babe3405522842864500550d5c8c
2021-09-16 22:24:04 -07:00
svcscm svcscm
2b5baba6f9 Updating submodules
Summary:
GitHub commits:

61f4d245e5
eda263174e
06e4b1aa40
5c475457da
e442ab8bd6

Reviewed By: bigfootjon

fbshipit-source-id: 4379a3043adbc410b16c9268cf99da2e842bc086
2021-09-16 22:24:04 -07:00
svcscm svcscm
6239c0f315 Updating submodules
Summary:
GitHub commits:

321b458243
1a37725b23
c41bdf29d2
3d9ebbe51a
fb82fa3b9c
8fa5e966d1
03902c05fe

Reviewed By: bigfootjon

fbshipit-source-id: 43f2f3d3b3a5ab15292fac7bd3e56331dd0e34a7
2021-09-16 21:22:54 -07:00
Katie Mancini
2671e5a4bb fix a python type error in redirect
Summary:
In D29940980 (2e2b9755cf) we used shlex for a redirect subprocess command line.
The list does not always contain strings tho, which is a requirement to use
shlex.quote my guess is that they are paths. We should still str things
before we shlex.quote them.

Differential Revision: D31001622

fbshipit-source-id: 2a270781d7f2d84ad7a9a2f9975500b29306cfa8
2021-09-16 20:23:45 -07:00
svcscm svcscm
54ba1a3429 Updating submodules
Summary:
GitHub commits:

b3fc868ffc
d4c5dc4f62
b709943478
65f2e3ea93
86714dc0ee
431751b503
ddad467674
9565749490
3d2fd8b8a8
536d5cef3d

Reviewed By: bigfootjon

fbshipit-source-id: a7b08ce3555e7894cb4e06eb5478f82e7d2046b9
2021-09-16 20:23:45 -07:00
svcscm svcscm
1aeac521d1 Updating submodules
Summary:
GitHub commits:

401a90fdd5
7e607be5b0
d88c8e08eb
ca2b0f70fa
90abc80c33
aa06398dc2
d6aa8c49f8
59b3a891eb
d237337395
2722812493
6072bd98e8
9cbc2134cd
c615b89417
656db0bfd6
c16ccbaff5

Reviewed By: bigfootjon

fbshipit-source-id: a79831c0097eec8ad05ee4faa3f778d1d9ff87ed
2021-09-16 19:26:07 -07:00
svcscm svcscm
95a104cdae Updating submodules
Summary:
GitHub commits:

366cd1ecd0
2e3a4ffe38
0f4627160d
4875411673
dd32f3accf

Reviewed By: bigfootjon

fbshipit-source-id: 19f4d117934c102aebd6b4d03824eabff30a82c8
2021-09-16 18:23:08 -07:00
svcscm svcscm
55d63e0a85 Updating submodules
Summary:
GitHub commits:

a669f7e8b2
3f4f4a32a3
cc95f7c4ca
1456b13dde
e7225ed083
44c9b05917
1269e00b44
f4a1d10668
5d4bdb2468
5c007dec0d
a96eaf564b
35e40d16af
e601d8337a
dbdcdcdf0c
7f1dd90133
ce39ca504f

Reviewed By: bigfootjon

fbshipit-source-id: 422a48871606ab8d33164886d0ead308ea65ea6e
2021-09-16 18:23:08 -07:00
svcscm svcscm
d9f6c513bc Updating submodules
Summary:
GitHub commits:

6a6749ef3e
90abc80c33
d6aa8c49f8
c16ccbaff5

Reviewed By: bigfootjon

fbshipit-source-id: 6f064c4b852442d908dbda0ed8224206649ef52d
2021-09-16 18:23:08 -07:00
svcscm svcscm
ea0990df1c Updating submodules
Summary:
GitHub commits:

8436fce431
0d934c0029
18f33129dc
41d2601706
f8a88a1836

Reviewed By: bigfootjon

fbshipit-source-id: 1ecb66924473f482d807d03a41851e9cee540b2a
2021-09-16 15:55:23 -07:00
Xavier Deguillard
7f4cde5bf9 revisionstore: reduce default auto_sync_threshold
Summary:
One of the largest contributor to EdenFS memory usage are the internal
IndexedLog buffers to hold data in memory until a threshold is reached. Since
the main benefit of these buffers is to utilize the disk bandwidth, very large
buffers aren't necessary and much smaller ones will be able to achieve similar
results.

A default 50MB buffer is used which will cap the memory usage to 50MB * 3:
 - File IndexedLogDataStore
 - Tree IndexedLogDataStore
 - File LFS

The aux and history stores are also reduced down to 10MB.

Reviewed By: DurhamG

Differential Revision: D30948343

fbshipit-source-id: 74e789856ac995a5672b6aefe8a68c9580f69613
2021-09-16 15:52:57 -07:00
svcscm svcscm
7cfa286e80 Updating submodules
Summary:
GitHub commits:

f9d4807dd3
ca2b0f70fa
b97c53b629

Reviewed By: bigfootjon

fbshipit-source-id: 38f9f223007a320ccbd52ebfd000983f45be3606
2021-09-16 15:24:25 -07:00
Jan Mazur
479e662c65 set x-x2pagentd-ws-over-h1 when using x2pagentd with http proxy
Summary: As in the title

Reviewed By: ngoyal

Differential Revision: D30994761

fbshipit-source-id: d93af0d522dcfc8eb2be8f3984e90b75f309e1a9
2021-09-16 14:48:18 -07:00
svcscm svcscm
79700378a8 Updating submodules
Summary:
GitHub commits:

3034a2cca0
15425322e0
7c99cca266
0945c49960

Reviewed By: bigfootjon

fbshipit-source-id: 5f3ed5de781b99dd10bfb507aeac0c524f104744
2021-09-16 14:45:17 -07:00
Katie Mancini
41029bf3d7 unknown inodes are not a bug on NFS mounts.
Summary:
We periodically need to dereference inodes on NFS because we get no other info
from the kernel on when should dereference them.

This means the NFS kernel might have references to inodes after we delete them.

An unknown inode number is not a bug on NFS. It's just stale, so the error should
reflect that.

Reviewed By: xavierd

Differential Revision: D30144898

fbshipit-source-id: 3d448e94aea5acb02908ea443bcf3adae80eb975
2021-09-16 14:35:04 -07:00
Katie Mancini
7a1f3b6eb2 add a config knob to control how long to delay inode unloading
Summary:
We periodically need to dereference inodes on NFS because we get no other info
from the kernel on when should dereference them.

It can be disruptive to a users workflow because an open files that were rm'ed
or removed on checkout will no longer have their old content. (on a native
filesystem or fuse applications that had the file open propr to the removal
would still be able to access files.) For most editors this is not a problem
because they read the file on open (seems fine for vim and vscode from testing).
However folks could theoretically have a workflow this does not jive with.

Let's make it configurable how often this runs, so users can control how
much we distupt their workflow.

Reviewed By: xavierd

Differential Revision: D30144899

fbshipit-source-id: 59cf5faea70b3aea216ca2bcb45b96e34f5e72b5
2021-09-16 14:35:04 -07:00
Katie Mancini
ffa558bf84 implement inode unloading after checkout
Summary:
NFSv3 has no inode invalidation flow built into the procall. The kernel does not
send us forget messages like we get in FUSE. The kernel also does not send us
notifications when a file is closed. Thus EdenFS can not easily tell when
all handles to a file have been closed.

As is now we never clean up inodes. This is bad for memory & disk usage.
We will never unload an inode so we always keep it in memory once it's created.
Additonally, we never remove a materialized inode from the overlay. This means
we have unbounded memory and disk usage :/

We need to clean up these inodes at somepoint. There are a couple high level
options:
1. Support nfsv4. NFSv4 sends us close message when a file handle is closed.
This would allow us to actually keep track of reference coundts on an inode.
However, This is a lot of work. There is a lot of other things we would have to
support before we can move to nfsv4.
2. Run background inode cleanups.

nfsv4 is probably the right long term solution. But for now we should be able to
get by with periodic unloads.

I considered a couple of options for unloads:
1. Unload inodes immediatly when files are removed.
2. Delay cleaning up inodes until a while after they are removed. (i.e. clean
up inodes n seconds after an `unlink`, `rename`, `rmdir`, or checkout)
3. Run periodic inode unloading. (i.e. once a day unload inodes).

Option 1. feels a bit too hostile to applications that hold files open.
Option 3. means we will build up a lot of cruft over the course of the day. But is
probably the most application friendly.

I decided to try out option 2 first and see if it works well with the common
developer tools. Its seems to work (see below) so I am going with it.

This diff only does inode cleanup after checkout. we might want to run inode
clean up after unlink/remove dir as well, but this would be more expensive.
Batch unloading feels better on checkout seems better to me and should happen
frequently enough to clean up space for people.

There is one known "broken" behavior in this diff. We unload all unlinked
inodes which means we will erase more inodes than we should. Sometimes EdenFS
crashes or bugs and unlinks legit inodes. Normally we let those live in the
overlay so we could go in an recover them. My plan to fix this is to mark inodes
for unloading instead of just unloading all unlinked inodes.

Reviewed By: xavierd

Differential Revision: D30144901

fbshipit-source-id: 345d0c04aa386e9fb2bd40906d6f8c41569c1d05
2021-09-16 14:35:04 -07:00
svcscm svcscm
b8eee29acd Updating submodules
Summary:
GitHub commits:

92d4151e31
9af7e402ce
adda38ce8b
200578ad4c
2f87229263
aea6062c0f

Reviewed By: bigfootjon

fbshipit-source-id: c065d2766c8ebc6e5e63b67b97704379ff3ba518
2021-09-16 14:18:41 -07:00
Stanislau Hlebik
19d23c70cb mononoke: add a test that shows a weird behaviour of derive_manifest
Summary:
Delete a non-existing file is fine, and also deleting a file when a directory
with the same name just ignores the delete.

This diff adds tests to cover these cases. Overall it seems like a bug, but I'm
not sure it worth fixing - who knows if we have bonsai changesets that rely on
that!

Reviewed By: yancouto

Differential Revision: D30990826

fbshipit-source-id: b04992817469abe2fa82056c4fddac3689559855
2021-09-16 13:58:03 -07:00
Stanislau Hlebik
e4d2d8a0e4 mononoke: add new PathTree insert_and_merge method
Summary:
This method allows to append a value instead of just replacing it.

It will be used in the next diff when we derive manifest for a stack of commits
in one go.

Reviewed By: yancouto

Differential Revision: D30989889

fbshipit-source-id: dd9a574609b4d289c01d6eebcc6f5c76a973a96b
2021-09-16 13:58:03 -07:00
svcscm svcscm
3ee3cf9b9d Updating submodules
Summary:
GitHub commits:

9e26866b64
93fbb7e8e1
228bb046cc
5275915730
c0184bba0e
554e9739d1
43ec660cb1
eaeca03313
8afe8bb2ff

Reviewed By: bigfootjon

fbshipit-source-id: e7b3952bfebe9ade34ae2d01407cf53c7541fd53
2021-09-16 13:35:56 -07:00
svcscm svcscm
729f0cf9ff Updating submodules
Summary:
GitHub commits:

f342f4ae2d
9b6e1aaab8
7f0e5edd5b
b20d825454
8254e116de
8c840254b9
763c76bdfa
6a033433f5
70492a0cc9
57eea2b567

Reviewed By: bigfootjon

fbshipit-source-id: e89c4217be2a5c4a7499c54079a43c2f88019ac1
2021-09-16 13:06:07 -07:00
svcscm svcscm
1c3f87c72a Updating submodules
Summary:
GitHub commits:

366cd1ecd0
fcd261d3af
0f4627160d
e1db39d47f
4bd93f1d3b
dd32f3accf

Reviewed By: bigfootjon

fbshipit-source-id: 83b1b361cc63a2c7bd5383f0cb5fcb3e11f04802
2021-09-16 12:39:47 -07:00
Xavier Deguillard
1ebf805e18 inodes: return an eof flag from FileInode::read
Summary:
The NFS protocol needs to know if a read reached the end-of-file to avoid a
subsequent read and thus reduce the chattyness of the protocol.

On top of avoiding RPC calls, this should also halve the amount of data read
from Mercurial due to the BlobCache freeing the in-memory cached blob when the
FS has read the file in its entirety. This meant that the second READ would
always force the blob to be reloaded from the Mercurial store, which would also
force that blob to be kept in memory until being evicted (due to it not being
fully read).

Reviewed By: kmancini

Differential Revision: D30871422

fbshipit-source-id: 8acf4e21ea22b2dfd7f81d2fdd1b137a6e90cc8f
2021-09-16 10:34:36 -07:00
Robin Håkanson
b562bb0344 GitPool updates to handle heavy imports better.
Summary:
Changes:
- Limit simultainous open git-repo objects by amount of CPUs.
- Put a semaphore limit so we wait inside tokio::task domain instead of tokio::blocking domain (later is more expensive and has a hard upper limit).

Reviewed By: mitrandir77

Differential Revision: D30976034

fbshipit-source-id: 3432983b5650bac6aa5178d98d8fd241398aa682
2021-09-16 09:02:22 -07:00
Mateusz Kwapich
cfb0ec6085 make skiplists optional in mononoke
Summary:
This allows the mononoke_api user to choose whether the skiplists
should be used to spped up the ancestry checks or not.

The skiplists crate is already prepared for the situation where skiplist
entries are missing and traverses the graph then.

Reviewed By: yancouto

Differential Revision: D30958909

fbshipit-source-id: 7773487b78ac6641fa2a427c55f679b49f99ac8d
2021-09-16 07:20:01 -07:00
Mateusz Kwapich
515d178024 make WBC optional
Summary:
Allow the mononoke_api user to choose whether they want
oprerations to be sped up using WBC or not.

Reviewed By: yancouto

Differential Revision: D30958908

fbshipit-source-id: 038cf77735e7c655f6801d714762e316b6817df5
2021-09-16 07:20:01 -07:00
Mateusz Kwapich
b6f48e94a4 turn wbc into a trait and add noop implementation
Summary:
Some crates like mononoke_api depend on warm bookmark cache to speed up the
bookmark operations. This prevents them from being used in cases requiring
quick and low overhead startup like CLIs.

This diff makes it possible to swap out the warm bookmark cache to a
implementation that doesn't cache anything. (See next diffs to see how it's
used in mononoke_api crate).

Reviewed By: yancouto

Differential Revision: D30958910

fbshipit-source-id: 4d09367217a66f59539b566e48c8d271b8cc8c8e
2021-09-16 07:20:01 -07:00
Mateusz Kwapich
bc77707fdd remove get_all from warm bookmark cache
Summary:
This method was added before the more generic list method was added. Let's get
rid of it for simplicity and to discourage listing all the bookmarks.

Reviewed By: yancouto

Differential Revision: D30958911

fbshipit-source-id: f4518da3f34591c313657161f69af96d15482e6c
2021-09-16 07:20:01 -07:00
svcscm svcscm
f0bbefce6b Updating submodules
Summary:
GitHub commits:

a669f7e8b2
cc95f7c4ca
5c007dec0d
a96eaf564b
91fc1226f3

Reviewed By: bigfootjon

fbshipit-source-id: 826f347fb43ea0aa4b7fff2c5492f6a3058e378a
2021-09-16 02:09:10 -07:00