Commit Graph

10761 Commits

Author SHA1 Message Date
Carolyn Busch
411ed7adf5 infinitepush: use bookmark http api
Summary: Fetch bookmarks via the http edenapi protocol in the bookmark command with the --list-remote option when all bookmark patterns are full bookmark names (not prefixes).

Reviewed By: kulshrax

Differential Revision: D27331526

fbshipit-source-id: 4f4eda255c551c9b55c6966569755f493335b458
2021-05-18 11:10:33 -07:00
Thomas Orozco
9f9709fcd8 mononoke/gotham_ext: update away from deprecated async-compression stream module
Summary:
This is deprecated now: https://docs.rs/async-compression/0.3.8/async_compression/stream/index.html

Lets update as documented there.

Reviewed By: farnz

Differential Revision: D28509889

fbshipit-source-id: b28713fcad3b1b2ec3ff8bec766fe05c4edba200
2021-05-18 10:30:22 -07:00
Thomas Orozco
f5e024f889 mononoke/blobstore: don't use Buf::bytes() to get a slice
Summary:
This is currently calling `Buf::bytes()` in order to get a `&[u8]` out of
`Bytes`, but this method isn't actually guaranteed to return all data in the
`Buf`: https://docs.rs/bytes/0.5.6/bytes/trait.Buf.html#tymethod.bytes

> Note that this can return shorter slice (this allows non-continuous internal representation)

In practice this is fine because `Bytes` does in fact have a contiguous
internal representation (which is why we can call `as_ref()` on it), but let's
do the more correct thing here.

(I happened to spot this while looking into the feasibility of a Bytes 0.5 ->
Bytes 1.x upgrade, where this `bytes()` method was renamed to `chunk()`)

Reviewed By: farnz

Differential Revision: D28507885

fbshipit-source-id: 73e5f1ba587292f772c702127a3933ea76fceb9f
2021-05-18 10:30:22 -07:00
Mark Juggurnauth-Thomas
5dafb7333f commitcloud: support --workspace-version in hg cloud sl --history
Summary:
The --workspace-version option is currently ignored by interactive history.
Allow it to be used to specify the initial version.  This makes jumping back to
a much older version easier.

Reviewed By: liubov-dmitrieva

Differential Revision: D28478194

fbshipit-source-id: f4f121d919e89c298677256f227f2e96d63ef644
2021-05-18 09:16:15 -07:00
Xavier Deguillard
cdb6b9ca6d inodes: remove debug logs
Summary: For whatever reason some of my debug logs got landed :(

Reviewed By: fanzeyi

Differential Revision: D28510825

fbshipit-source-id: 65bd9165020bfe3afff54109a9f550a460266737
2021-05-18 09:08:21 -07:00
Thomas Orozco
aaf01dae8c mononoke/bookmarks: fix a flaky test
Summary:
This test is a bit flaky because its execution depends on the other in which 2
futures that are spawned execute, which isn't entirely deterministic (those
tests were using a multi-threaded runtime, I'm also fixing this here).

Reviewed By: ahornby

Differential Revision: D28507337

fbshipit-source-id: 3c33dc7ffe73de0c6696523ed49d3b30ceda82c0
2021-05-18 08:07:41 -07:00
Stanislau Hlebik
e9ec3955c5 mononoke: add a simple test for sync changeset
Summary:
Simple test that syncs a single commit from a source to a target.

A few notes
1) I want to use test Mononoke instance, but I can't initialize them in another
crate because of cfg(test). I removed cfg(test) to make it possible.
2) I initialized megarepo mapping in TestRepoFactory so that all tables
were in the same db. It's not strictly necessary, but makes initialization a bit simpler.

Reviewed By: mitrandir77

Differential Revision: D28444865

fbshipit-source-id: f39c917806709606ce8e5a1c1158f186d239d8b8
2021-05-18 07:37:56 -07:00
Stanislau Hlebik
3011aab0f8 mononoke: save latest synced changesets in blobstore instead of db
Summary:
In order to sync changesets we need to know what was the latest synced
changeset from a given source. Previously we wanted to store this data in sql,
however later we decided to store it in the file in the repo. The main reason
for doing that is that storing data inside the repo gives us both blame and
history, while database can't provide that.

This diff implements that - removes all the sql-related code for storing latest
synced changesets and instead puts the data inside the file in the repository.
Note that we still using sql to store mapping between (source, target)
changesets.

Reviewed By: mitrandir77

Differential Revision: D28470102

fbshipit-source-id: 996905b17ad4b0d5b0ea1e40c73d762850e113a8
2021-05-18 07:37:56 -07:00
Stanislau Hlebik
790cda7468 mononoke: make test megarepo configs a bit more useful
Summary: Now it's at least possible to add new configs

Reviewed By: mitrandir77

Differential Revision: D28444866

fbshipit-source-id: cf0e2e737a125bdbd3b7eff55e8ee3f1d5a193d2
2021-05-18 07:37:56 -07:00
Thomas Orozco
27b248c075 mononoke: track last updated log for bookmarks
Summary:
Like it says in the title, this updates bookmarks to track the log id of their last update.

This will let us do incremental queries from the WBC. See the design doc linked to the
task here for details.

Reviewed By: farnz

Differential Revision: D28444852

fbshipit-source-id: e966ced8e136ad6c4306e977e21670caa457ea71
2021-05-18 05:34:31 -07:00
Liubov Dmitrieva
add020c9f3 increase commit cloud history limit for 12 weeks by default
Summary: increase commit cloud history limit for 12 weeks by default

Reviewed By: markbt

Differential Revision: D28476878

fbshipit-source-id: d66d2bd672232932b698fece143eeac82d426886
2021-05-18 02:11:53 -07:00
Zeyi (Rice) Fan
847e9d597d introduce basic fsck test cases
Summary: This diff introduces some currently failing test case to demonstrate the issue of files being created when EdenFS is not running on Windows. The tests are disabled for now since they are still failing. Later diffs should fix the issue this demonstrated and we can enable these tests on Windows at then.

Reviewed By: chadaustin

Differential Revision: D25285548

fbshipit-source-id: f0738bca05cfc82e5bf7b8238d009dc59bce93ca
2021-05-17 23:38:03 -07:00
Zeyi (Rice) Fan
1ad184455b inodes: implement FSCK for Windows Tree Overlay
Summary:
This diff implements FSCK for EdenFS Windows.

On Windows, users can still modify EdenFS mounts even when EdenFS is not
running, which may cause mismatch between EdenFS state and on-disk view. This
subsequently may cause issues when EdenFS is running again (such as permission
error, not seeing added entries in `hg status`, etc..).

This diff adds FSCK to EdenFS Windows. It is not exactly same as what fsck
traditionally do on *NIX systems. We are still dubbing it as FSCK since it
works at the same place as eden fsck.

At startup, FSCK will crawl the EdenFS mount to compare the overlay state with
disk state. It then synchronizes the overlay view with what the user has on
disk. Note Windows does not always permit user to modify the mount, it only
allows changes in certain situation. In particular, when the directory is in
Full state, this diff takes advantage of that so we can finish the scanning by
only scans such directories.

One limitation of Windows FSCK is that, it cannot reliably tell if the user
deleted a directory or file from dirty placeholder directories. This is because
ProjectedFS will hide untouched entries under dirty placeholder directory when
EdenFS is not running, and there is no way we can tell if the entry is gone
because of user deletion or hid by ProjectedFS.

This is not perfect but acceptable to some extent. One possible failure scenario is:

1. User creates a directory named `foo`.
2. User writes a file to that directory (`foo/bar`).
3. EdenFS then stops running.
4. User then deletes the entire `foo` directory on disk.
5. EdenFS starts again, `foo` will be recrated with an empty `bar` file. This
   will still correctly show in `hg status`, and the user is able to delete
   them again.

Reviewed By: xavierd

Differential Revision: D27872753

fbshipit-source-id: c553db568379062ff4504204c1a1785664f87c00
2021-05-17 23:38:02 -07:00
Manish Rajpal
604ec1da74 relax version mismatch check
Summary:
We want eden doctor to report a problem about mismatched running and installed version only if the running version is more than 2 weeks older than installed.

Please see task for more context

Reviewed By: fanzeyi

Differential Revision: D28464491

fbshipit-source-id: 34b9b4cf533482f3006100bbf675c89ea7ee6fff
2021-05-17 19:36:05 -07:00
Zeyi (Rice) Fan
d78264f594 windows: build Rust fbclone with Mercurial
Reviewed By: genevievehelsel

Differential Revision: D28299629

fbshipit-source-id: 8420054c848fc50e52db1c90ffc4022a858beb43
2021-05-17 15:45:34 -07:00
Xavier Deguillard
02a10e17ad fs: shave 136 bytes off FileInode
Summary:
While looking at the previous diff, I noticed that a significant amount of
memory was used by the loading promise. Since this loading promise is only used
when an inode is being loaded, its usage is the uncommon case: there should be
significantly more inodes being loaded or unloaded than loading at any given
time in EdenFS's lifetime.

Reviewed By: chadaustin

Differential Revision: D28477391

fbshipit-source-id: e80269506b980d7f217f6bdf59034ef003c4b3fc
2021-05-17 14:10:40 -07:00
Xavier Deguillard
9c73da76f9 fuse: use ImmediateFuture in the Fuse dispatcher
Summary:
Similarly to the NFS change, this moves all the folly::Future handling in the
FuseChannel itself instead of inside the dispatcher. This should allow the
inode code to be converted to using ImmediateFuture instead of folly::Future.

Reviewed By: genevievehelsel

Differential Revision: D28372252

fbshipit-source-id: 7aae29d4a32500513c0062dfa42b2c7a3be038db
2021-05-17 14:07:29 -07:00
Xavier Deguillard
de6ca0c970 utils: handle void lambda in ImmediateFuture
Summary:
Lambda returning no values would cause the compiler to try to instantiate an
ImmediateFuture<void>, which doesn't compile. We could try special casing the
void type, but it's easier if we simply consider these lambda to return unit.

Reviewed By: genevievehelsel

Differential Revision: D28372253

fbshipit-source-id: 1368ae5dc5e2d4d6a5c3e31bc87ed7d230027c3a
2021-05-17 14:07:29 -07:00
Xavier Deguillard
3eb9e86b61 inodes: convert InodeMap to ImmediateFuture
Summary:
The InodeMap can be extremely hot when issuing tons of requests to EdenFS.
Unfortunately, it still needs to do memory allocation due to its use of
folly::Future. By switching to ImmediateFuture we can avoid the memory
allocation, speeding it up slightly.

For the NFS dispatcher, this moves the call to `semi()` inward, allowing us to
target specific inode methods to convert next. For the Fuse dispatcher, I've
simply converted the ImmediateFuture into a Future directly, keeping the rest
of the code unchanged, a subsequent change will convert the dispatcher code to
ImmediateFuture.

Reviewed By: chadaustin

Differential Revision: D28302480

fbshipit-source-id: 4e097a721443f0d52f34a337a96f8a63a9a7cd7c
2021-05-17 14:07:29 -07:00
Xavier Deguillard
3863a8972a utils: add a timeout to ImmediateFuture::{get,getTry}
Summary:
This is to mimic the folly::Future API which allows the `get` and `getTry` to
throw if the Future isn't ready. One difference is that the ImmediateFuture API
has a default argument of a max duration instead of having a separate method.
Since chrono durations are expressed as intmax_t (64-bits on systems supported
by EdenFS) a max duration is virtually infinite.

Reviewed By: chadaustin

Differential Revision: D28424053

fbshipit-source-id: 319493174f31367184dbe0aa811a97145b0310cf
2021-05-17 14:07:28 -07:00
Chad Austin
c5b895d7f2 allow 1000 background FUSE requests
Summary:
DurhamG discovered that setting max_background in fuse_init_out allows
a larger number of concurrent FUSE requests. The documentation
indicates it's intended to affect background requests like readahead,
but empirically you can observe increased live FUSE requests with `rg
-j200` and `eden top`. Default to 1000 because EdenFS can handle a
large amount of concurrency and we want to avoid blob and tree fetches
to block FUSE IO when not necessary.

Reviewed By: xavierd

Differential Revision: D27526032

fbshipit-source-id: 0d3fa383772f719524a9be84b73fa2eb599580d7
2021-05-17 12:48:03 -07:00
Chad Austin
48b35a0a5e differentiate EdenConfig and CheckoutConfig in EdenMount
Summary:
`getConfig` was ambiguous, so differentiate EdenConfig and
CheckoutConfig across the implementation.

Reviewed By: genevievehelsel

Differential Revision: D28398762

fbshipit-source-id: 9490e4b31c5d1b0570ee5615e5a3197400397993
2021-05-17 12:48:03 -07:00
Chad Austin
9a41e85d45 add validation to config key names and standardize on hyphens instead of underscores
Summary: To avoid inconsistency on an unimportant degree of freedom, disallow configs with underscores.

Reviewed By: genevievehelsel

Differential Revision: D28398510

fbshipit-source-id: 7720bd79129102d668d229979733a90547e275da
2021-05-17 12:48:03 -07:00
Chad Austin
c46b27d505 remove the dead mononoke configs
Summary:
EdenFS doesn't have a mononoke backend anymore, so the configs are no
longer necessary.

Reviewed By: genevievehelsel

Differential Revision: D28398369

fbshipit-source-id: 63f352bd82bc14b745535c227cb213e01f15afe8
2021-05-17 12:48:03 -07:00
Chad Austin
c35829ff15 organize EdenConfig layout
Summary:
As EdenConfig grows more knobs, some structure is warranted. I'd
prefer something like anonymous structs or maybe even an
EdenSettingGroup type, but for now add some comments and at least put
them near each other.

Reviewed By: genevievehelsel

Differential Revision: D28398306

fbshipit-source-id: 169c4d2e0eeeb36d1812cdb73c9ac61d11652e09
2021-05-17 12:48:03 -07:00
Xavier Deguillard
13f9edb209 inodes: shave 8 byte off of the size of InodeBase
Summary:
The structure had 2 padding of 4 bytes each due to the alignment requirement of
the EdenMount pointer and of the location_ field. Moving the EdenMount pointer
allows the padding to go away.

Reviewed By: fanzeyi

Differential Revision: D28476945

fbshipit-source-id: b521b4184d3924480ef54f840389156faab3988d
2021-05-17 11:54:52 -07:00
Liubov Dmitrieva
4fb70336da add an option to show remote bookmarks in commit cloud smartlogs
Summary: if this option is enabled, the server will be asked to add them

Reviewed By: markbt

Differential Revision: D28412810

fbshipit-source-id: d1531ecf97615cdb5e32d72c8c31598e6a406956
2021-05-17 08:39:31 -07:00
Thomas Orozco
bcc532d126 mononoke: yield periodically on repo client streams
Summary:
Like it says in the title. This updates various streams so that they yield
after 10+ ms on CPU, thus ensuring that they don't starve other tasks of
runtime.

Reviewed By: johansglock

Differential Revision: D28441879

fbshipit-source-id: 78a8cdaefbe37d4768211dfa8a87c045ed898d57
2021-05-17 04:17:40 -07:00
Alex Hornby
ce923a0f33 mononoke: simplify manifoldblob construction
Summary: The new and new_with_ttl constructors were causing duplication.  Combine them.

Reviewed By: farnz

Differential Revision: D28471162

fbshipit-source-id: c7095a9a337d0ccbf5cd15ac3650cd5b361aaebf
2021-05-17 04:00:58 -07:00
Alex Hornby
6c96b7f1f4 mononoke: switch manual_scrub to buffered_unordered
Summary:
manual_scrub was using the ordered form of buffered so that checkpoint was written correctly.

This diff switches to buffered_unordered which can give better throughput. To do so checkpoint uses a tracker to know what keys have completed, so it can save the latest done key which has no preceding keys still executing.

Reviewed By: farnz

Differential Revision: D28438371

fbshipit-source-id: 274aa371a0c33d37d0dc7779b04daec2b5e1bc15
2021-05-17 01:13:57 -07:00
Durham Goode
dcc9895392 http-client: backout "pass certs to libcurl as in-memory blobs"
Summary: This diff breaks edenapi tls on Mac.

Reviewed By: kulshrax

Differential Revision: D28451036

fbshipit-source-id: b5451bc1e174aa40acce1e42ef6c130b02f0fb58
2021-05-14 14:01:52 -07:00
Robert Grosse
83eac5322b Remove unnecessary setters
Summary: There isn't much point to having a trivial setter method for a public field.

Reviewed By: krallin

Differential Revision: D28427464

fbshipit-source-id: e0800fae6f635612e72945e570ce4de692dfb7bb
2021-05-14 09:40:25 -07:00
Jan Mazur
effef3a2c3 removing revisionstore tests
Summary:
These tests were hitting prod LFS. I have fixed them in our post-fork codebase here:  D28093406 (490cbbf0c3)

We don't need them on hg servers so just delete them.

Reviewed By: krallin

Differential Revision: D28438295

fbshipit-source-id: 49961a4bb5965bd350d97b946c8c9fbeeefdebcc
2021-05-14 08:16:24 -07:00
Kostia Balytskyi
67d2f365d3 megarepo: guard against known bad classes of configs being added
Summary: Let's verify what we know can go wrong.

Reviewed By: StanislavGlebik

Differential Revision: D28419082

fbshipit-source-id: f1f50de7bff4cf3dc1469ecfbd3744624f26c08d
2021-05-14 07:59:52 -07:00
Stanislau Hlebik
f86c61714d mononoke: kick off sync_changeset in scs using FAKE_TOKEN
Summary:
This adds the ability to spawn sync_changeset() request using scs. We don't
have async reqeusts implementation, so it's quite hacky - it doesn't return the
actual synced changeset id. we'll add it later once async queue is implemneted

Reviewed By: ikostia

Differential Revision: D28441052

fbshipit-source-id: 5dd32c1638246442c6a9b1e21d7a8d73bfe762ab
2021-05-14 07:36:06 -07:00
Stanislau Hlebik
cc697dc11b mononoke: yield after warn_expensive_getbundle to mitigate S231752
Summary:
One more attempt to mitigate S231752.
From the debugging we did locally it seems that warning about expensive
getbundle might prevent keep alives from being send to the client.
adding yield seem to mitigate the issue locally.
We are not 100% sure it will actually mitigate the sev, but it seems like a
cheap and safe thing to try.

Reviewed By: krallin

Differential Revision: D28438570

fbshipit-source-id: 14f613222e8f69c4cbe490d8fa608d79c30b1a4d
2021-05-14 04:55:48 -07:00
Alex Hornby
4b21b339b6 mononoke: add bytes count to manual_scrub progress
Summary: This is useful to get an idea of what the scrub is doing

Reviewed By: farnz

Differential Revision: D28417785

fbshipit-source-id: 1421e0aae13f43371d4c0d066c08aee80b17e9c0
2021-05-14 02:55:00 -07:00
Harvey Hunt
a58a9e805e mononoke: lfs server: Disable compression dynamically
Summary:
During S231236 the LFS servers were using a lot of CPU and were
compressing blobs sent to clients.  Thomas hotfixed the servers to disable
compression in order to save some CPU. Instead of having to rebuild and
redeploy the LFS server, update it to be able to disable compression using
configerator.

The `disable_compression` option will disable compression of downloads
globally. The `disable_compression_identities` allows us to disable compression
for some group of identities.

I also refactored some of the shared code from `download` and `download_sha256`
into a new function, `download_inner`.

Reviewed By: krallin

Differential Revision: D28382405

fbshipit-source-id: 792f10a9e3bb32b56ef87aa8e0b2c4b098567579
2021-05-14 02:39:00 -07:00
Alex Hornby
61f27b77b2 mononoke: make scrubbing of write mostly stores optional
Summary: Write mostly stores are often in the process of being populated.  Add an option to control whether scrub errors are raised for missing values in write mostly stores.

Differential Revision: D28393689

fbshipit-source-id: dfc371dcc3b591beadead82608a747958b53f580
2021-05-14 02:37:20 -07:00
Alex Hornby
ef8256b9a7 mononoke: minor refactor to multiplex scrub
Summary:
Couple of small changes I originally did during next diff split out on their own.

Save a loop over the scrub stores if there are relevant entries on the queue and remove unnecessary repetition of type.

Reviewed By: farnz

Differential Revision: D28411617

fbshipit-source-id: 2015b5b1d68f870b09fbd8929a59c21fe4f57c87
2021-05-14 01:46:34 -07:00
Durham Goode
d54ca67554 tests: fix test-merge-tools.t
Summary:
This was broken by my recent change to have mergetools respect HGPLAIN
instead of ui.formatted.

Reviewed By: andll

Differential Revision: D28423783

fbshipit-source-id: 00831a6cc47acc11574fcf67462a1dccdde21fda
2021-05-13 17:44:14 -07:00
Xavier Deguillard
288a56327b utils: EDEN_BUG_FUTURE returns a Try<T>
Summary:
This allows the macro to be used for both folly::Future, but also with
ImmediateFuture, reducing the cost of migrating to the latter.

Reviewed By: chadaustin

Differential Revision: D28302478

fbshipit-source-id: d8470428ecaa6aaccf2aa884437ca97d4b45806f
2021-05-13 16:51:34 -07:00
Xavier Deguillard
b525114769 nfs: switch RpcServerProcessor::dispatchRpc to ImmediateFuture
Summary:
Now that both implementation are using ImmediateFuture, we can move the
ImmediateFuture one layer up.

Reviewed By: kmancini

Differential Revision: D28302479

fbshipit-source-id: 3c2c164a90ffb42a0e7da8528f976af34fc87315
2021-05-13 16:51:34 -07:00
Xavier Deguillard
65d00fff9f nfs: convert Nfsd3 to ImmediateFuture
Summary:
With the Mountd code being converted to ImmediateFuture, we can now convert
Nfsd3 to use ImmediateFuture too. For now, this isn't expected to perform
better due to the InodeMap still using on folly::Future, which forces the
ImmediateFuture code to store a SemiFuture. A future change will look at
switching the InodeMap to ImmediateFuture to solve this.

Reviewed By: kmancini

Differential Revision: D28297422

fbshipit-source-id: 8b85103657e877b0f102130f2117bbe60598ed52
2021-05-13 16:51:34 -07:00
Xavier Deguillard
189934f9ac utils: allow mutable lambda to be passed to ImmediateFuture::thenValue
Summary:
Since lambda are default capturing by const, Func was also captured that way,
which made it impossible to call if Func was actually a mutable lambda.

Reviewed By: chadaustin

Differential Revision: D28297423

fbshipit-source-id: b9c6bdcf024c2e219ec0f8f5be2379e51df24db0
2021-05-13 16:51:34 -07:00
Xavier Deguillard
472e67081c nfs: convert Mountd to use ImmediateFuture
Summary:
As a first towards converting the code to use ImmediateFuture more broadly,
let's start with a small self contained part of the code.

This is mostly a sed except for the dispatchRpc method that needs to call
.semi().via().

Reviewed By: kmancini

Differential Revision: D28297421

fbshipit-source-id: e706e91fc8f132d4ef742ae98af9bb8304e0bf36
2021-05-13 16:51:34 -07:00
Xavier Deguillard
5ee950f5e0 utils: also call func when an ImmediateFuture holds an exception
Summary:
This code initially was for thenValue, but when I converted it for thenTry I
forgot to also remove the hasException case. We were never calling the callback
on a Try that had an exception.

Reviewed By: chadaustin

Differential Revision: D28302477

fbshipit-source-id: 755fb2c8928627fbe1883f3863cafc360e34a038
2021-05-13 16:51:34 -07:00
Xavier Deguillard
7d48df9938 utils: coerce a SemiFuture<ImmediateFuture<T>> to a SemiFuture<T>
Summary:
When the passed in callback returns an ImmediateFuture, the code had a small
typing bug where we would try to return an ImmediateFuture<ImmediateFuture<T>>
while the function signature expected an ImmediateFuture<T>. This is due to the
SemiFuture code not coalescing a SemiFuture<ImmediatureFuture<T>> into a
SemiFuture<T>.

Reviewed By: chadaustin

Differential Revision: D28293942

fbshipit-source-id: 1bc8f58d387766f29e573499fb37402ff9b49c83
2021-05-13 16:51:34 -07:00
Robin Håkanson
cdc908959c Make gitimport concurrency configurable
Summary: Make Mononoke-gitimport concurrency configurable

Differential Revision: D28412978

fbshipit-source-id: 3d1670515980cfd64201271199a94d6ea55b7e59
2021-05-13 12:47:39 -07:00
Stanislau Hlebik
eab97b6123 mononoke: sync changeset implementation for megarepo
Summary: First stab at implementing sync changeset functionality for megarepo.

Reviewed By: ikostia

Differential Revision: D28357210

fbshipit-source-id: 660e3f9914737929391ab1b29f891b3b5dd47638
2021-05-13 10:04:21 -07:00