Commit Graph

10831 Commits

Author SHA1 Message Date
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
Durham Goode
d88b999faf Allow conflict editor prompts during arc pull
Summary:
Mercurial has gotten stricter about respecting interactive vs
non-interactive commands lately, and now is failing to automatically open the
editor for conflicts during arc pull. Let's force Mercurial to treat the
invocation as an interactive one.

Reviewed By: skotchvail

Differential Revision: D28358999

fbshipit-source-id: 551713a78abfe170f04e8e55318af6e157bae7da
2021-05-13 09:40:57 -07:00
Thomas Orozco
cd8efd8afa mononoke/connection_acceptor: prevent starving fwd out of CPU
Summary:
When you spawn a task, Tokio puts it on a "LIFO slot" associated with the
current thread. While the task is in the LIFO slot, it is not eligible to be
run by other threads.

If the thread that just spawned `fwd` above goes and does some expensive
synchronous work in `request_handler` (we'd like to avoid that but sometimes
that happens), then that will delay `fwd`.

This means that notably keepalives will not be sent (you can repro by putting a
`std:🧵:sleep` right after we spawn `fwd`). To mitigate this, we spawn
another dummy taks here. This task will take `fwd`'s place in the LIFO slot,
thus pushing `fwd` onto a task queue where other runtime threads can claim it.

This way, even if this thread goes do some expensive CPU-bound work, we won't
delay keepalives.

This doesn't solve the fact that we probably shouldn't be doing such CPU-bound
work to begin with, but at least it might mitigate the issue such that we don't
have I/O delayed even though the runtime isn't visibly overloaded.

Reviewed By: johansglock

Differential Revision: D28412114

fbshipit-source-id: b56c0156ac6cf991cc899a82e3d2a96c63216fda
2021-05-13 09:27:22 -07:00
Alex Hornby
475c12b197 mononoke: add write mostly store to scrub test cases
Summary: Add a write mostly store to the scrub test cases. This in preparation for next diff where the write mostly case has a new scrub option added.

Reviewed By: krallin

Differential Revision: D28393690

fbshipit-source-id: f7878f5e25814a7d327b1a80d4f96c0867944a14
2021-05-13 04:29:33 -07:00
Alex Hornby
2e5d3d7d25 mononoke: log the blobstore stack being used in manual scrub
Summary: Log the blobstore stack being used for the scrub

Reviewed By: farnz

Differential Revision: D28408340

fbshipit-source-id: 2299f7f7397f48d70b9a8295f0aa28c89bbf5809
2021-05-13 04:29:33 -07:00
Stanislau Hlebik
cbb6e47aa2 mononoke: add mononoke and megarepo_mapping to megarepo_api
Summary: These will be used in the next diffs, let's add initialization here.

Reviewed By: ikostia

Differential Revision: D28409734

fbshipit-source-id: f656db8259f28559df52562f0590382d89f1f0c0
2021-05-13 04:23:11 -07:00
Stanislau Hlebik
f029000974 mononoke: add repo_by_id to Mononoke struct
Summary:
This is an attempt to split D28357210 to make it a bit smaller, so this
new function will be used later.

Reviewed By: krallin

Differential Revision: D28386004

fbshipit-source-id: 42c9ead0668fb78747dcb0fc7c89b6f181f7d9e6
2021-05-13 04:23:11 -07:00
Thomas Orozco
1dfa6006f2 mononoke/connection_acceptor: log more details when clients hang up
Summary:
We have clients mysteriously timing out despite the fact that we should
normally be sending keepalives. To understand this, add some logging so that if
a client disconnects, we log a lot more detailed information to Scuba.

Reviewed By: mitrandir77

Differential Revision: D28383122

fbshipit-source-id: 0e49262bcc08c75f8e06eae17c882742b58ea51d
2021-05-13 01:57:19 -07:00
Thomas Orozco
2304cd1420 mononoke/connection_acceptor: defer ChannelConn construction until we have metadata
Summary:
I'd like to have some socket level logging, and it's good to capture the
metadata there so that we have client identities, session ids, etc.

But I can't do this if I don't have the metadata! This updates our code so that the
metadata is available where this logging will go.

This means we can't rely on loggers in `try_convert_preamble_to_metadata`, but
given this is now only used for hgcli, I don't think that matters, so I just removed it.

Reviewed By: mitrandir77

Differential Revision: D28383121

fbshipit-source-id: 27532f021a9082e74403bba73cad4fc6d0a6d97c
2021-05-13 01:57:19 -07:00
Thomas Orozco
94a1e412ab mononoke: use Arc<Metadata> in sessions
Summary:
I'd like to have some socket level logging, and it's good to capture the
metadata there so that we have client identities, session ids, etc.

To do so I need to not move it into the session. This does that.

Reviewed By: mitrandir77

Differential Revision: D28383123

fbshipit-source-id: 3fd10c3720465824dbcb2528227cbb3521d3068a
2021-05-13 01:57:19 -07:00
Andrey Chursin
b7ec4892d9 commitcloud: fix doctest
Summary: D28351849 (2c3edb0989) broke doctest, this diff attempts to fix it

Reviewed By: quark-zju

Differential Revision: D28392077

fbshipit-source-id: 7f1f7261d8996b2c808399954fc895eccc2c1c06
2021-05-12 18:21:10 -07:00
Katie Mancini
85942cfaad use portable version of gtest
Summary:
gtest includes some windows headers that will have conflicts with the
folly portability versions. This caused some issues in my in-memory tree
cache diffs (D27050310 (8a1a529fcc)).

We should probably generally be using the folly portable gtests so we can
avoid such issues in the future.

see here for more details: bd600cd4e8/folly/portability/GTest.h (L19)

I ran this with codemod yes to all

- convert all the includes with quotes:
`codemod -d eden/fs --extensions cpp,h '\#include\ "gtest/gtest\.h"' '#include <folly/portability/GTest.h>'`

- convert all the includes with brackets
`codemod -d eden/fs --extensions cpp,h '\#include\ <gtest/gtest\.h>' '#include <folly/portability/GTest.h>'`

- convert the test template
`codemod -d eden/facebook --extensions template '\#include\ <gtest/gtest\.h>' '#include <folly/portability/GTest.h>'`

then used `arc lint` to clean up all the targets files

Reviewed By: genevievehelsel, xavierd

Differential Revision: D28035146

fbshipit-source-id: c3b88df5d4e7cdf4d1e51d9689987ce039f47fde
2021-05-12 15:58:27 -07:00
Katie Mancini
9dee7d6c40 nfs: run custom integration tests on nfs
Summary:
There are a few tests that we don't currently run on both git and hg,
this means we need a new decorator to run the tests on nfs.

Reviewed By: xavierd

Differential Revision: D27953136

fbshipit-source-id: f6e1fab1f763c9b878315336b2cdaa529d36ffe5
2021-05-12 15:01:08 -07:00
Durham Goode
1248a276fa build: use the appropriate python version for getdeps builds
Summary:
getdeps builds are failing on certain versions of Mac because they
choose a system python, which causes setup.py to use a hard coded library
location which isn't correct in our environment. Earlier I changed
pick_python.py to prefer the homebrew python, but it turns out getdeps doesn't
actually use pick_python. This diff fixes that and also instructs python3-sys to
use the correct version, by setting the PYTHON_SYS_EXECUTABLE environment
variable.

Reviewed By: quark-zju

Differential Revision: D28388150

fbshipit-source-id: 9b09e7472733f7a779c6212ae012116cad657b5d
2021-05-12 14:24:20 -07:00
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
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
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
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
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
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
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
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
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
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
Stanislau Hlebik
79561defed mononoke: support reading megarepo configs
Summary:
Previously it was possible to write configs only, now it's possible to read
them as well.

Reviewed By: ikostia

Differential Revision: D28326571

fbshipit-source-id: d946201a384cc3998d1c197b7eabb77b9f35129d
2021-05-11 02:54:01 -07:00
Stanislau Hlebik
4e232ea94d mononoke: add mapping for megarepo
Summary:
Adding mappng to keep track of two things:
1) keep track of the latest source commit that was synced into a given target - this will be used during sync_changeset() method to validate if a parent changeset of a given changeset was already synced
2) which source commit maps to what target commit

Reviewed By: ikostia

Differential Revision: D28319908

fbshipit-source-id: f776d294d779695e99d644bf5f0a5a331272cc14
2021-05-11 02:54:01 -07:00
Xavier Deguillard
1aa6e143e6 fuse: allow applexattr with macFUSE
Summary: This is the same change as D27137328 (a9a1b73418) but for macFUSE.

Reviewed By: kmancini

Differential Revision: D28328029

fbshipit-source-id: c58e146dba2e7e3bdb320f2b5e80946e4a7b3afe
2021-05-10 13:37:43 -07:00
Genevieve Helsel
728e643a48 use eden daemon background prefetch logic instead of python subprocesses
Summary: With the addition of the ability to "background" the prefetches in the daemon itself, we can remove the subprocess backgrounding in the python layer and just depend on the internal backgrounding.

Reviewed By: chadaustin

Differential Revision: D27825274

fbshipit-source-id: aa01dc24c870704272186476be34d668dfff6de5
2021-05-10 12:42:50 -07:00
Xavier Deguillard
29d003865f fuse: workaround macFUSE ABI change
Reviewed By: chadaustin

Differential Revision: D25505235

fbshipit-source-id: 31a2b3993801de4c8f084213e73f623dba820ef6
2021-05-10 12:39:33 -07:00
Chad Austin
d45b2711a2 remove the dead getTreeForManifest
Summary: getTreeForManifest is no longer called, so remove it.

Reviewed By: genevievehelsel

Differential Revision: D28306796

fbshipit-source-id: e51a32fa7d75c54b2e3525e88c162247b4496560
2021-05-10 11:53:30 -07:00
Stanislau Hlebik
df340221a0 mononoke: add commit_rewriting logic to megarepo_api
Summary:
This is going to be use to rewrite (or transform) commits from source to
target. This diff does a few tihngs:
1) adds a MultiMover type and a function that produces a mover given a config. This is similar to Mover type we used for fbsource<-> ovrsource megarepo sync, though this time it can produce a few target paths for a given source path.
2) Moves `rewrite_commit` function from cross_repo_sync to megarepo_api, and make it work with MultiMover.

Reviewed By: ikostia

Differential Revision: D28259214

fbshipit-source-id: 16ba106dc0c65cb606df10c1a210578621c62367
2021-05-10 11:48:23 -07:00
Jan Mazur
ceb03efb60 disable debuginfo stripping to work around eu-strip failing
Summary: Don't need this.

Reviewed By: HarveyHunt

Differential Revision: D28322229

fbshipit-source-id: 3743cb5f80488f33f1a00b4d0a665cd310f2a784
2021-05-10 08:35:16 -07:00
Kostia Balytskyi
f10ef62cba megarepo: basic version of async-requests crate
Summary:
This crate is a foundation for the async requests support in megarepo service.

The idea is to be able to store serialized parameters in the blobstore upon
request arrival, and to be able to query request results from the blobstore
while polling.

This diff manipulates the following classes of types:
- param types for async methods: self-explanatory
- response types: these contain only a resulting value of a completed successful execution
- stored result types: these contain a result value of a completed execution. It may either be successful or failed. These types exist for the purpose of preserving execution result in the blobstore.
- poll-response types: these contain and option of a response. If the optional value is empty, this means that the request is not yet ready
- polling tokens: these are used by the client to ask about the processing status for a submitted request

Apart from that, some of these types have both Rust and Thrift counterparts, mainly for the purposes of us being able to implement traits for Rust types.

Relationships between these types are encoded in various traits and their associated types.

The lifecycle of an async request is as follows therefore:
1. the request is submitted by the client, and enqueued
   1. params are serialized and saved into a blobstore
   1. an entry is created in the SQL table
   1. the key from that table is used to create a polling token
1. some external system processes a request [completely absent form this diff]
   1. it notices a new entry in the queue
   1. it reads request's params from the blobstore
   1. it processes the request
   1. it preserves either a success of a failure of the request into the blobstore
   1. it updates the SQL table to mention that the request is now ready to be polled
1. the client polls the request
   1. queue struct receives a polling token
   1. out of that token it constructs DB keys
   1. it looks up the request row and checks if it is in the ready state
   1. if that is the case, it reads the result_blobstore_key value and fetches serialized result object
   1. now it has to turn this serialized result into a poll response:
       1. if the result is absent, poll response is a success with an empty payload
       1. if the result is present and successful, poll response is a success with the result's successful variant as  a payload
       1. if the result is present and is a failure, the polling call throws a thrift exception with that failure

Note: Why is there yet another .thrift file introduced in this diff? I felt like these types aren't a part of the scs interface, so they don't belong in `source_control.thrift`. On the other hand, they wrap things defined in `source_control.thrift,` so I needed to include it.

Reviewed By: StanislavGlebik

Differential Revision: D27964822

fbshipit-source-id: fc1a33a799d01c908bbe18a5394eba034b780174
2021-05-10 06:51:37 -07:00
Alex Hornby
cce23856fc mononoke: sample size metadata for all component blobstores
Summary: Log the blobstore id as part of sampled pack info.  This is allows running the walker pack info logging directly agains a multiplex rather than invoke it for one component at a time.

Reviewed By: farnz

Differential Revision: D28264093

fbshipit-source-id: 0502175200190527b7cc1cf3c48b8154c8b27c90
2021-05-10 06:07:59 -07:00
Alex Hornby
a616a72e44 mononoke: add samplingblob variant with BlobstoreId
Summary:
When sampling multiplex stores its interesting to know which component of the store one is sampling.

This adds a new SamplingBlobstorePutOps struct with implements the BlobstorePutOps that multiplex blobstore requires.  Its connected up to blobstore factory in the next diff.

Reviewed By: farnz

Differential Revision: D28264444

fbshipit-source-id: 560de455854b6a6794b969d02046d67d372efd37
2021-05-10 06:07:59 -07:00
Kostia Balytskyi
0617e3489e move scm/service into eden/mononoke/scs
Reviewed By: ahornby

Differential Revision: D28286267

fbshipit-source-id: 349a2d94eca9cf563ee2bb4076e268917aaa4fd6
2021-05-10 05:53:38 -07:00
Thomas Orozco
b9b5e16dcf mononoke/multiplexedblob: retry is_present in the face of races
Summary: What we're trying to do here is all explained in the inline comments.

Reviewed By: farnz

Differential Revision: D28287486

fbshipit-source-id: 605c5272118b9d0b76f6284f4e81febe4b6f652e
2021-05-10 05:40:06 -07:00
CodemodService Bot
e2a64a3088 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D28319288

fbshipit-source-id: fc879fab6d7c2abd5184ccfbacf2aa2a8f3d8003
2021-05-10 05:06:45 -07:00
Thomas Orozco
58f7f50188 revisionstore: include version in user agent
Summary: Right now this is not very useful. Let's make it more useful.

Reviewed By: DurhamG

Differential Revision: D28281653

fbshipit-source-id: ef3d7acb61522549cca397048c841d1afb089b9b
2021-05-10 01:36:14 -07:00
Tianxiang Chen
59e5ae5c66 make Kerberos renewal command suggestions consistent
Summary: Change remediations to use `kdestroy && kinit`

Reviewed By: stepanhruda

Differential Revision: D28295440

fbshipit-source-id: 0e3348b2ad99870d275a84c482be02464b718102
2021-05-07 16:03:23 -07:00
Simon Farnsworth
bef3319996 Migrate the Rust Cachelib bindings to CXX
Summary:
These are undermaintained, and need an update for oncall support. Start by moving to CXX, which makes maintenance easier.

In the process, I've fixed a couple of oddities in the API that were either due to the age of the code, or due to misunderstandings propagating through bindgen that CXX blocks, and fixed up the users of those APIs.

Reviewed By: dtolnay

Differential Revision: D28264737

fbshipit-source-id: d18c3fc5bfce280bd69ea2a5205242607ef23f28
2021-05-07 12:24:22 -07:00
Simon Farnsworth
23cbacd701 Remove cachelib setup from segemented_changelog_tailer
Summary:
Because cachelib is not initialised at this point, it returns `None` unconditionally.

I'm refactoring the cachelib bindings so that this returns an error - take it out completely for now, leaving room to add it back in if caching is useful here

Reviewed By: sfilipco

Differential Revision: D28286986

fbshipit-source-id: cd9f43425a9ae8f0eef6fd32b8cd0615db9af5f6
2021-05-07 12:24:22 -07:00
CodemodService Bot
0462f803c0 Daily arc lint --take BLACK
Reviewed By: zertosh

Differential Revision: D28282435

fbshipit-source-id: 26037c582a35a958702b5d9f5c371e19664ba3c6
2021-05-07 05:16:05 -07:00
Thomas Orozco
87ae27b91b mononoke/segmented_changelog_tailer: add scuba args
Summary: This wants to use Scuba so it needs this.

Reviewed By: StanislavGlebik

Differential Revision: D28282511

fbshipit-source-id: 6d3a2b6316084f7e16f5a2f92cfae1d101a9c2d3
2021-05-07 02:07:09 -07:00
Jun Wu
9013d18a71 edenapi: debug log registered builder function
Summary:
This makes it easier to see what builder functions were registered:

  % EDENSCM_LOG=edenapi=debug lhg log -r .
  May 06 16:40:29.355 DEBUG edenapi::builder: registered eagerepo::api::edenapi_from_config to edenapi Builder

Reviewed By: DurhamG

Differential Revision: D28271366

fbshipit-source-id: f6c7c3aa9f29c3e47c2449e3d5fc16474aa338b0
2021-05-07 01:00:56 -07:00
Marc Fisher
9bdd73be2c Add stables template keyword to hg.
Summary:
Adding support for the stables template keyword in stablerev extension.

This keyword calls out to a script specified in the config stablerev.stables_cmd to get a list of stable aliases for a given revision.

Reviewed By: quark-zju

Differential Revision: D28204529

fbshipit-source-id: 3c5b21846ce6f686afddd00d3326a54b85be87dd
2021-05-06 23:52:32 -07:00
Jun Wu
647ee078d0 dag: actually test server1 in test_sparse_dag
Summary:
The server1 was not used after D27629318 (ba7e1c6952) while the test intentionally wants to
exercise graph isomorphism. So let's revive server1 in the test.

Reviewed By: andll

Differential Revision: D28269926

fbshipit-source-id: 0a04031415f559f8a6eb81f1e2f2530329a2a3bc
2021-05-06 21:15:22 -07:00
Alex Hornby
64f9a49751 mononoke: log repo name to the packinfo logs
Summary: This makes filtering and grouping easier

Differential Revision: D28258074

fbshipit-source-id: ef828852094544a1f0b5b56c0c3f54c6b3d6beb5
2021-05-06 13:58:30 -07:00
Alex Hornby
f8311f2887 mononoke: stop double wrapping blobstores in blobstore factory
Summary:
In blobstore factory we can end up with duplicate layers of wrapper blobstores like ReadOnlyBlobstore.

For the multiplex, its inner stores get throttling, readonly etc wrappers, and it itself only writes to its queue if an inner store succeeds, which it can't when inner store has ReadOnlyBlobstore wrapper.

Differential Revision: D28250832

fbshipit-source-id: 5a3f85584b9cce17ca7ce4b83cdb2117644850db
2021-05-06 13:58:30 -07:00
Alex Hornby
e5b76645df mononoke: log multiplex blobstore component types
Summary: Add support for logging the inner parts of a multiplex blobstore stack.  This helps understand what wrappers have been applied.

Differential Revision: D28230927

fbshipit-source-id: 873ee30ec00fdc2dfc79b47e5831231c51e2ce0d
2021-05-06 13:58:30 -07:00
Alex Hornby
8579f85892 mononoke: load bulkops in large fetch size from walker
Summary:
Fixing the bulkops fetch size to MAX_FETCH_STEP means we can use the chunk size option to control how many changesets are walked together without affecting query performance.

This will allow more accurate first referencing commit time lookup for files and manifests, as all commits in a chunk could possibly discover them,  with smaller chunks the discovered mtime becomes less approximate, at the possible cost of some walk rate performance if one was to run with very small chunk sizes.

Differential Revision: D28120030

fbshipit-source-id: 0010d0672288c6cc4e19f5e51fd8b543a087a74a
2021-05-06 13:58:30 -07:00
Alex Hornby
6b108df9ed mononoke: return id from bulkops fetch_ids
Summary: Knowing the numeric changeset id is useful in next diff when chunking in walker is loading from bulkops in large chunks, but then walking commits in smaller chunks.

Differential Revision: D28127581

fbshipit-source-id: c5b3e6c2a94e33833d701540428e1ff4f8898225
2021-05-06 13:58:30 -07:00
Alex Hornby
5b3dfbb59b mononoke: log which blobstore stack walker is sampling from
Summary: Found this useful while debugging the pack sampling

Differential Revision: D28118243

fbshipit-source-id: d94b0b87125a9863f56f72029c484909a3696329
2021-05-06 13:58:30 -07:00
Thomas Orozco
ea8332c47d mononokepeer: increment mononoke_read_bytes on read()
Summary:
We were only incrementing this on `readline`, which resulted in very low
numbers. While in there, I also removed `self._totalbytes` as that was unused.

Reviewed By: johansglock

Differential Revision: D28260141

fbshipit-source-id: 6d9008f9342adaf75eecc8ed8c872f64212cd1f7
2021-05-06 13:41:52 -07:00
Xavier Deguillard
c79ff7602a checkout: keep InodeNumber constant during checkout
Summary:
In an NFS mount, the InodeNumber are sent to the client as the unique
identifier for a file. For caching purposes, the client will issue a GETATTR
call on that InodeNumber prior to opening it, to see if the file changed and
thus whether its cache needs to be invalidated.

In EdenFS, the checkout process does unfortunately replace file inodes
entirely, causing new InodeNumber to be created, and thus after an update, an
NFS client would not realize that the content changed, and would thus return
the old content to the application. To solve this, we could approach it in 2
different ways:
 - Build a different kind of handle to hand over to the NFS client
 - Keep InodeNumber constant during checkout.

After trying the first option, it became clear that this would effectively need
to duplicate a lot of functionality from the InodeMap, but with added memory
consumption. This diff attempts to do the second one.

Reviewed By: chadaustin

Differential Revision: D28132721

fbshipit-source-id: 94d470e33174bb9ffd7db00e1b37924096aac8e9
2021-05-06 13:28:44 -07:00
Jun Wu
f36574ef0f test-eager-exchange: test treemanifest reading
Summary:
Add a subtree to exercise treemanifest logic. Blobs in EagerRepo are verified
so we need to disable flatcompat.

Reviewed By: DurhamG

Differential Revision: D28006550

fbshipit-source-id: ac7157a9c01ed99f703601613fb3cf06add69003
2021-05-06 12:13:17 -07:00
Jun Wu
b6d24fc969 eagerepo: support "test:name" repo URLs
Summary: This makes it easier to use it in tests.

Reviewed By: DurhamG

Differential Revision: D28006549

fbshipit-source-id: 90e29b220453a3d7a260d0a62d697d64363d9a6c
2021-05-06 12:13:17 -07:00
Jun Wu
f23f112dc8 test-eager-exchange: add test showing file content can be read after clone
Summary:
With remotefilelog force enabled, it's now possible to read the file content after
clone. Add a test for it.

Reviewed By: DurhamG

Differential Revision: D28006547

fbshipit-source-id: 5be93e162f352b1264a6c52852c2230726652f9d
2021-05-06 12:13:17 -07:00
Jun Wu
d9b901b22c extensions: always enable remotefilelog
Summary:
This makes it easier to get rid of revlog stores.

`debugindexdot` is no longer supported since it reads revlogs.
Two tests use flat manifest bundles. They are no longer supported
due to remotefilelog today has some assumptions that treemanifest
extension is also being used.

Reviewed By: DurhamG

Differential Revision: D27971126

fbshipit-source-id: fdb992a8d72bbcf562b5cb95b3f29051dd1c9464
2021-05-06 12:13:17 -07:00
Jun Wu
05ae4dd6f8 tests: stop disabling treemanifest for some tests
Summary:
Disabling treemanifest is a tech debt that causes problems, especially when
enabling remotefilelog.

Reviewed By: andll

Differential Revision: D27971120

fbshipit-source-id: 1a50acc23564c2d6bad79a2e99469850b5a7d1f9
2021-05-06 12:13:17 -07:00
Jun Wu
4c214bca8c dag: move some tracing logs from dag::namedag to dag::protocol
Summary:
This makes it easier to filter logs related to remote fetching.

The `DEBUG dag::protocol: resolve ids [0] remotely` means the lazy hash resolution is working.

Reviewed By: kulshrax

Differential Revision: D27971117

fbshipit-source-id: f2492204c70d793997d0c3865e500bbad56b1953
2021-05-06 12:13:17 -07:00
Jun Wu
e0b6773019 eagerepo: write commits to master group
Summary:
Write commit to master group. This provides proper "CloneData" and allows us to
actually test lazy commit hash backend (since only commits in the master group
can have lazy hashes).

Reviewed By: DurhamG

Differential Revision: D27971123

fbshipit-source-id: 4e19486007ddc89de7468be65445559f34d796f5
2021-05-06 12:13:17 -07:00
Jun Wu
6763719506 eagerpeer: add clone support
Summary:
Add clone endpoint so we can clone from an eager test repo.

Note: the master group is empty and "cloneata" does not quite work yet due to
EagerRepo not writing to the master group. It will be fixed later.

Reviewed By: DurhamG

Differential Revision: D27971121

fbshipit-source-id: 0cc35136c6987673c2c4fbbd892c344c3586fcb7
2021-05-06 12:13:17 -07:00
Stefan Filip
5b2ee8ccbf segmented_changelog: update version logging to obey context discard
Summary: This update makes it so that we don't log versions to scuba from tests.

Reviewed By: krallin

Differential Revision: D27449808

fbshipit-source-id: 9c79e83fbfdf3d9a02c2cfc8b6a8255edb4241fe
2021-05-06 11:40:09 -07:00
Stefan Filip
2a088f664d repo_factory: update the CoreContext used for segmented changelog
Summary: This enables scuba logging for segmented changelog background updates.

Reviewed By: quark-zju

Differential Revision: D28210010

fbshipit-source-id: aa485e4416a70540df0facc2290ebbb95aed6b9b
2021-05-06 11:40:08 -07:00
Stefan Filip
ea5251e0db cmdlib: add scuba sample builder to environment
Summary:
This is going to enable the background update in SegmentedChangelog to log
entries to Scuba.

The scuba sample builder is not fundamentally different than other elements of
the environment. It is used slightly differently to, for example, Logger,
because it has to cloned in all places that want to log rows but otherwise it
has the same characteristics.

Reviewed By: krallin

Differential Revision: D28210008

fbshipit-source-id: 68468868d13f29dddf21095bd7526cb4ff690786
2021-05-06 11:40:08 -07:00
Kostia Balytskyi
390605bf1e megarepo: intial impl of async requests table
Summary:
This is where async requests are logged to be processed, and from where they
are polled later.

It will acquire more functionality when the actual request processing business
logic is implemented.

Reviewed By: StanislavGlebik

Differential Revision: D28092910

fbshipit-source-id: 00e45229aa2db73fa0ae5a1cf99b8f2d3a162006
2021-05-06 11:33:39 -07:00
Xavier Deguillard
b7ab05edc5 utils: add an ImmediateFuture type
Summary:
In very hot code path, EdenFS is spending a very large amount of time creating
and destroying folly::Future objects. This is due to the required memory
allocation, as well as the handful of atomics that are happening at creation
time, and these are showing up in EdenFS profiles.

In the steady state, EdenFS actually doesn't need futures, as it often times is
able to service requests from its in-memory caches, in which case we should
ideally just return the value itself and not wrap it in a folly::Future. The
added ImmediateFuture is a step in this direction, as it can hold either an
immediate value, or a folly::SemiFuture, and allow the same API to be used
transparently between these 2.

Reviewed By: genevievehelsel

Differential Revision: D28006802

fbshipit-source-id: 89eaa32e7fa82c44844c4b23c4cb30dbeea46ca8
2021-05-06 10:54:03 -07:00
Alex Hornby
41b069036e mononoke: log sizing metadata to walker pack info logs
Summary:
Log the sizing metadata about keys that scrub has seen to the pack info logs.

This uses the sampling blobstore to see all blobstore gets and captures info from them.

Also updates relatedness_key fieldname to mtime as that way its less easily confused with similarity_key

Differential Revision: D28115620

fbshipit-source-id: 666a444c2d91b0ca5bb225cea971f9b183e6a48d
2021-05-06 10:22:23 -07:00
Alex Hornby
46bd65e89b mononoke: update SamplingHandler::sample_get to take BlobstoreGetData
Summary:
Pass BlobstoreGetData to the sampler so that it has a chance to sample the BlobstoreMetadata as well as the BlobstoreBytes.

This is used in the next diff for sampling the sizing information.

Reviewed By: markbt

Differential Revision: D28115619

fbshipit-source-id: 7a79d482c9ba1ed8b08afab5f1c1b8fe7c4f257a
2021-05-06 10:22:23 -07:00
Alex Hornby
6dd1bd8ecc mononoke: add metadata about compressed blob sizes
Summary: When reading from packblob we'd like to see metadata about sizes so that can log it for the packer later in this stack.

Reviewed By: markbt

Differential Revision: D28101971

fbshipit-source-id: 96dd0d5497c2bb5c27231709dbd19d00168e1a77
2021-05-06 10:22:22 -07:00
Kostia Balytskyi
c238f12d44 types: make macros usable outside mononoke_types
Summary:
This diff prepares some macros to be usable by external crates. Next diff uses
them in `megarepo_api:async_requests`.

The way it makes macros usable externally is by:
1) using abs paths for std types outside of prelude
2) importing necessary traits in methods which need them
3) re-exporting important `mononoke_types`-defined types and third-party
dependencies via `mononoke_types::private` and using `$crate::private` in macro
to access them.

This way someone needs only to depend on `mononoke_types` and only to import
the macro, not any other re-exported definitions.

Reviewed By: krallin

Differential Revision: D28033196

fbshipit-source-id: 3f5fa34388a4f6466969d06c5739c5282f007e68
2021-05-06 09:34:56 -07:00
Stefan Filip
8faf9b07c5 edenapi_service: use custom_cbor_stream for trees
Summary:
The trees endpoint is another example where we try to send errors to the
client.  As it was done previously we would fail to log any errors on the
server side.  This diff corrects that by using custom_cbor_stream.

Reviewed By: kulshrax

Differential Revision: D28111102

fbshipit-source-id: 468095d024647f472b8ad9a9e17ca8364605ff98
2021-05-06 09:14:10 -07:00
Stefan Filip
1852d28c38 edenapi_service: add CustomCborStream
Summary:
Some EdenapiEndpoints serialize their error and send them to the client. This
robs the gotham framework from the change of seeing those errors. This custom
stream takes care of counting those errors and reporting them to gotham for
logging.

There is a slight worry in the back of my head that if we start getting errors,
CPU utilization will increase because we construct so many extra strings.

Reviewed By: kulshrax

Differential Revision: D28109314

fbshipit-source-id: ab39a05227e0f8be9205d6036d32523cb1e45ca4
2021-05-06 09:14:10 -07:00
Thomas Orozco
246d5009c0 mononoke: sample harder in the walker
Summary:
The walker does about 50% of our traffic, but it also has fairly predictable
access patterns. It seems unlikely that we really benefit from logging all
scrub activity with the same precision as we do other traffic.

So, let's sample it. This should make a lot of space in our Scuba table and
make us more resilient to sudden changes in activity.

Reviewed By: StanislavGlebik

Differential Revision: D28254057

fbshipit-source-id: da748a565954c31c2d9e087b7b07747a435427bf
2021-05-06 07:07:02 -07:00
Digant Kasundra
be43635087 Update rust-ini to 0.17.0
Summary: Updated rust-ini from 0.13.0 to 0.17.0

Differential Revision: D28242794

fbshipit-source-id: 249fc7d2ffdc46c4bfb4b575fb7aa8f5858a6e12
2021-05-06 06:50:28 -07:00
Mark Juggurnauth-Thomas
9d6a583988 admin: add blame-v2 to blame compute
Summary:
Add `--blame-v2` to `mononoke_admin blame compute`.  This can be used to compute
blames in the new format and validate that they are correct.

Reviewed By: mitrandir77

Differential Revision: D28183160

fbshipit-source-id: f698a77c109bfce05aeb66cd405c6f20bf158801
2021-05-06 05:45:49 -07:00
Mark Juggurnauth-Thomas
5fe6d54116 blame_v2: add blame_v2 types and implementation
Summary:
Add types and an implementation for blame_v2.  This differs from the existing
blame definition as follows:

* Changeset IDs and paths are always stored as indexes into a mapping.

* The Changeset ID index is stable for the p1-parent chain of commits.  Although only
  the changeset IDs that are used in the blame are present, the index for a particular
  changeset ID doesn't change, unless it is added in a merged-in parent.

* The notion of rejection is merged into the blame definition.  This makes it more
  explicit that rejected parents are simply ignored by the blame algorithm.

Some bugs in the original blame algorithm are also fixed:

* Initially empty files don't cause a zero-length blame range that can never be deleted.

* Merges correctly recalculate origin offsets.

This blame implementation is not used yet.  It will be introduced in subsequent commits.

Reviewed By: StanislavGlebik

Differential Revision: D28183161

fbshipit-source-id: 3604ff7ff393220e13a69d0ad51247d7bfd80926
2021-05-06 05:45:49 -07:00
Mark Juggurnauth-Thomas
3d0ce2769d mononoke_types: add definition for blame_v2 thrift types
Summary:
Add thrift definitions for blame_v2.  This uses a map from integer id to
changeset id to avoid repeating 32-byte hashes in files with many blame ranges,
and to provide a stable integer index for changesets that can be used to
provide a more human-readable id for each blamed changeset.

Reviewed By: StanislavGlebik

Differential Revision: D28183163

fbshipit-source-id: a6ae01d92c3d3c022a1d412f2ba0046f08c2d9f1
2021-05-06 05:45:49 -07:00
Johan Schuijt-Li
e57f819b6e rage/debug output for schemes
Summary:
Add debug output to rage to make sure we have the relevant information in case
we need to debug issues with schemes.

Reviewed By: quark-zju

Differential Revision: D28222910

fbshipit-source-id: 9499c736d61b2c0e4568e05a3afc0ae9730acedf
2021-05-06 04:39:19 -07:00
Johan Schuijt-Li
c120560edf integrate hgext schemes into fb mercurial
Reviewed By: liubov-dmitrieva

Differential Revision: D28185505

fbshipit-source-id: 1eed74bf492c5f22abb7d616b9492eb2a549aead
2021-05-06 04:39:19 -07:00
Johan Schuijt-Li
395d04cecc import schemes hgext
Summary:
Import from upstream:
https://www.mercurial-scm.org/repo/hg/file/tip/hgext/schemes.py

at revision 47060:fde5bb5d1acf

Reviewed By: mitrandir77

Differential Revision: D28185506

fbshipit-source-id: 651398fb76adf0e05fcd22afd8f39e8f941919d5
2021-05-06 04:39:19 -07:00
Stanislau Hlebik
25bea26213 mononoke: allow duplicate filenodes to be sent
Reviewed By: krallin

Differential Revision: D28249888

fbshipit-source-id: 57e9976dba936c1fae4e3176ec9ea4d4b355c6fa
2021-05-06 03:31:19 -07:00
Stanislau Hlebik
d17de2cdb2 mononoke: avoid duplicates in get_manifests_and_filenodes
Reviewed By: krallin

Differential Revision: D28249720

fbshipit-source-id: b07cc51afdb174a4ff6f00473cf823a02f4e4d4e
2021-05-06 03:31:19 -07:00
Zeyi (Rice) Fan
dfc5480620 cli: disable edenfsctl top for Windows
Summary:
Currently running `edenfsctl top` will crash on Windows:

```
Traceback (most recent call last):
  File "C:\Python38\Lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python38\Lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\tools\eden\bin\edenfsctl.exe\__main__.py", line 3, in <module>
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 2253, in zipapp_main
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 2236, in main
  File "C:\Python38\Lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "C:\Python38\Lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 2212, in async_main
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 1059, in run
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\top.py", line 395, in __init__
  File "C:\Python38\Lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'
```

This diff will let it prints an error message.

Reviewed By: xavierd

Differential Revision: D28207330

fbshipit-source-id: a465fe5941b469f4a1ef964f1d4dc8a593639e7c
2021-05-05 18:24:12 -07:00
Zeyi (Rice) Fan
bd08aac957 cli: parse command line args outside asyncio
Summary:
It looks like argparse's exit was not able to handle asyncio event loop well,
causing edenfsctl to generate a long ugly stack trace when the command line
flag does not parse.

Let's just move the arguments parsing outside the asyncio runloop to avoid this
problem as a whole. In theory it should improve our `--help` time a little bit.

Reviewed By: chadaustin

Differential Revision: D28206622

fbshipit-source-id: 881eefaea73b244eadff0165965085e64dad935f
2021-05-05 18:24:12 -07:00
Zeyi (Rice) Fan
70f7b5151b cli: do not call os.getuid on Windows
Summary:
Some user reported to see `edenfsctl restart` crashes due to this call to
os.getuid() since it does not available on Windows. P410914264

https://docs.python.org/3.9/library/os.html#os.getuid

Reviewed By: chadaustin

Differential Revision: D28204262

fbshipit-source-id: 077bf207d8b1b6c014fface63ea93e66057629cd
2021-05-05 18:24:12 -07:00
Jun Wu
7a0765ab25 edenapi: do not dependent on eagerepo
Summary:
eagerepo -> metalog -> git2 -> libgit2-sys -> libgit2 conflicts with edenfs'
non-Rust libgit2 dependency. Rust git2 crate does not seem to provide a way to
depend on specified libgit2.

Quote https://github.com/rust-lang/git2-rs/issues/263#issuecomment-450934287:

> It's expected that git2-rs builds its own copy of libgit2 and doesn't use the
> system version, as the system version is likely incompatible

It also seems non-trivial to make buck C++ use the libgit2 frm `libgit2-sys` crate.

Let's just avoid depending on eagerepo from edenapi directly for now to solve the
issue. This basically revives D27948369 and D27951632.

Reviewed By: xavierd

Differential Revision: D28243784

fbshipit-source-id: 0c38c20c2d3a80c550732129da572fe26a229799
2021-05-05 18:21:00 -07:00
Jun Wu
2cf4957de0 runtests: expand $TESTTMP in hgrc
Summary:
This makes it easier to use `--keep` to investigate tests by using
`--configfile`.

Reviewed By: kulshrax

Differential Revision: D27971122

fbshipit-source-id: 8adcbeab825155858499c24ca74c2979049adeda
2021-05-05 17:53:39 -07:00
Stefan Filip
f6c588a7a0 context: rename CoreContext's base constructor
Summary:
Rename `new_with_containers` to `new`. `new` the standard name for
what the fuction does.

Reviewed By: krallin

Differential Revision: D28210005

fbshipit-source-id: 9ad0dad5e8afd89d7538fd32d93de10837e26f9d
2021-05-05 15:29:26 -07:00
Stefan Filip
0eabd94e5f context: remove CoreContext::test_mock_class
Summary:
Refactoring the construction logic for CoreContext.
`test_mock_class` is used in only one place. That usage can be replaced with
`test_mock_session`.

Reviewed By: krallin

Differential Revision: D28210007

fbshipit-source-id: c81ca31cb7255ef640fe641e9b38f239cfb69267
2021-05-05 15:29:26 -07:00
Stefan Filip
86ef0755d4 context: rename CoreContext contructor for bulk processing
Summary:
Refactoring CoreContext construction to express purpose. We will have
a constructor for request processing, for background processing.
Bulk processing is another category that has it's own constructor
already. Renaming it to make it more prominent.

Reviewed By: krallin

Differential Revision: D28210006

fbshipit-source-id: 2bb74d97e2f3588aa539e58c3d6dd6842f898121
2021-05-05 15:29:26 -07:00
Zeyi (Rice) Fan
9d64cd399d backingstore: fix winhttp linkage issue
Summary:
We have a linker issue on Windows when building EdenFS with CMake:

```
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpSetStatusCallback referenced in function winhttp_connect
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpOpen referenced in function winhttp_connect
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpCloseHandle referenced in function winhttp_close_connection
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpConnect referenced in function winhttp_connect
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpReadData referenced in function winhttp_stream_read
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpWriteData referenced in function winhttp_stream_read
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpQueryOption referenced in function certificate_check
```

This fixes that.

Reviewed By: xavierd

Differential Revision: D28230163

fbshipit-source-id: f74e42ee30ec8f3b81c1f80b7cf63a21ea97732c
2021-05-05 15:01:01 -07:00
Zeyi (Rice) Fan
a500f985d3 integration: fix test failure on Windows
Summary: This should fix the test failure introduced in D28203778 (9bee308885) where fsck tests were not skipped on Windows.

Reviewed By: genevievehelsel

Differential Revision: D28227230

fbshipit-source-id: 97ef5717fbda567b48f02a60e1906e374fdc6766
2021-05-05 15:01:01 -07:00
Jun Wu
f347dc94f9 remotefilelog: do not use f strings
Summary: The syntax is not supported by Python 2.

Reviewed By: DurhamG

Differential Revision: D28233280

fbshipit-source-id: 9f882827b1357cb339e60180acadb38842c3cf8d
2021-05-05 13:30:11 -07:00
Jun Wu
2e07267f2d remotefilelog: do not use **kwargs,
Summary: The syntax is not supported by Python 2.

Reviewed By: DurhamG

Differential Revision: D28232995

fbshipit-source-id: 62058751b4f00b78a2bd56908100a7bb7a3adfde
2021-05-05 13:22:30 -07:00
Alex Hornby
da5dac311b rust: remove patch for async-compression
Summary: Upstream crate has landed my PR for zstd 1.4.9 support and made a release, so can remove this patch now.

Reviewed By: ikostia

Differential Revision: D28221163

fbshipit-source-id: b95a6bee4f0c8d11f495dc17b2737c9ac9142b36
2021-05-05 12:20:34 -07:00
Jun Wu
60e240b17e eagerepo: fix Windows compatibility
Summary: Windows path like `eagerepo:///C:\foo\bar` needs special handling.

Reviewed By: kulshrax

Differential Revision: D27971119

fbshipit-source-id: 9d4b87782eca2734b708565f0ee22a7495253cff
2021-05-05 12:01:50 -07:00
Stanislau Hlebik
bc9fefff5b mononoke: remove tunables for skeleton manifest create changeset rollout
Summary: We needed only for the initial rollout, we can delete it now

Reviewed By: krallin

Differential Revision: D28226715

fbshipit-source-id: 20349e9775b71292604a4054162f026087511db8
2021-05-05 11:58:06 -07:00
Genevieve Helsel
100fccc193 retire hg gc
Summary: `hg gc` does not do anything anymore, so in order to reduce confusion, let's just print a message that says it is no longer supported and provide a manual remediation.

Reviewed By: xavierd

Differential Revision: D28164614

fbshipit-source-id: 7ed2392cdb0091cd604a15b4c2382632706981f2
2021-05-05 11:48:58 -07:00
Thomas Orozco
16fa5d1bdf mononoke: sample logging from Quicksand
Summary:
Quicksand is about 60% of our logging, but we don't really need to log
everything it does because the workload is pretty much the same across all
hosts.

Reviewed By: HarveyHunt

Differential Revision: D28225416

fbshipit-source-id: 68c0f68c4da73e0f7543754c917d7efa4bbf374e
2021-05-05 11:02:50 -07:00
Toan Mai
410f7c5c61 Imported a mysql_common patch to support FromRow for tuples up to arity 16 (#23)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/23

Pull Request resolved: https://github.com/facebookincubator/resctl/pull/8081

Pull Request resolved: https://github.com/facebookexperimental/eden/pull/82

Imported a mysql_common patch to support FromRow for tuples upto arity 16
Context: https://fburl.com/zfnw7r86

Followed the guide: https://www.internalfb.com/intern/wiki/Rust-at-facebook/Managing_fbsource_third-party_with_Reindeer/#maintaining-local-change

Reviewed By: marcelogomez

Differential Revision: D28094262

fbshipit-source-id: fed48e3950e8a3ba3d7a15407522167e5ae41a98
2021-05-05 10:32:48 -07:00
Alex Hornby
394ff15823 mononoke: make phases take iterator get_public_raw
Summary: It was requesting a slice but always converted it to an Iterator anyway.  Receiving an iterator saves constructing a temporary Vec both here and later in the stack

Reviewed By: krallin

Differential Revision: D28127582

fbshipit-source-id: 625c1f17f1ded973f8b2aa13566928af0df83aec
2021-05-05 09:52:36 -07:00
Jun Wu
c793852fba treemanifest: do not bundle trees present on server
Summary:
This avoids issues where the tree is stored without p1, p2. It is similar to
what we do for public commits (in createtreepackpart):

  if sendtrees == shallowbundle.AllTrees or ctx.phase() != phases.public:
      ...

Note: the trees API actually provides p1, p2, but p1, p2 are dropped when
writing to the current data store implementation.

Reviewed By: liubov-dmitrieva

Differential Revision: D28200388

fbshipit-source-id: e1fe93d8ae8576e691077d6db432d55f7b9d498d
2021-05-05 09:48:29 -07:00
Jun Wu
e0f02950ea pyedenapi: add trees API unrelated to store
Summary: Add a way to fetch tree content without going through store.

Reviewed By: liubov-dmitrieva

Differential Revision: D28200387

fbshipit-source-id: 8f5b2214aafba39c7674f0f6b27af0c985f0ea72
2021-05-05 09:48:29 -07:00
Jun Wu
e687a92d10 pyedenapi: rename trees to storetrees
Summary:
The `trees` API is coupled with a store. We're going to add another API that is
not coupled with a store so let's rename `trees` to `storetrees`.

Reviewed By: liubov-dmitrieva

Differential Revision: D28200389

fbshipit-source-id: 826116f0b461873b2f5df07e7fd35e6d1018f929
2021-05-05 09:48:29 -07:00
Andrey Chursin
eec8e784f5 tests: do not test native checkout debug output in test-update-reverse.t
Summary:
This output is non-determenistic, and it does not seem to be important in this test
We could replace HashMap with BTreeMap to make it deterministic, as an alternative, but it is probably not justified for this test

Reviewed By: quark-zju

Differential Revision: D28204050

fbshipit-source-id: 50000671520e3bbf41849dc53c420ccab496dca0
2021-05-05 09:40:29 -07:00
Alex Hornby
74f5e21506 mononoke: add a cmdlib option for manifold weak consistency
Reviewed By: farnz

Differential Revision: D28217480

fbshipit-source-id: c520650cbf0a34bc042e711ddb7e09063e0eea47
2021-05-05 05:51:03 -07:00
Filipe Mourao Leite
4f0890d93c Remove unused import
Summary: This import is not used anywhere (since D28007850 (bb3d207e33)) and could be removed (currently it throws a warning whenever someone attempts to do a cargo check)

Reviewed By: sandeepkumarpani888

Differential Revision: D28220436

fbshipit-source-id: a7fc0fe84d485d37fe86476011a853df57a6bc03
2021-05-05 04:45:39 -07:00
CodemodService Bot
b4afda3890 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D28216338

fbshipit-source-id: 2384a332505881bbc8cd621694496cf9f37c3bea
2021-05-05 04:03:47 -07:00
Stanislau Hlebik
f4c799dffa mononoke: record how long saving the raw bundle took
Reviewed By: krallin

Differential Revision: D28215994

fbshipit-source-id: 5be23dd10eeb483cd17926cb064ecfe9f566cad4
2021-05-05 03:03:47 -07:00
Liubov Dmitrieva
b506eeea0c do not perform syncing for public commits
Summary: we display incorrectly 'local changes' for public commits

Reviewed By: DurhamG

Differential Revision: D28000088

fbshipit-source-id: 81bb8926dd7e96bf283eabe2b0aca84a9155fea3
2021-05-05 02:48:19 -07:00
Liubov Dmitrieva
f74c212472 remove dead code
Summary: the option has been deprecated and is not used anywhere

Reviewed By: krallin

Differential Revision: D28191314

fbshipit-source-id: f5f092b93a9644c8249628520d8d707b60854aac
2021-05-05 02:45:45 -07:00
Durham Goode
27d58bbd42 configs: delete applydynamicconfig
Summary: This is no longer used.

Reviewed By: quark-zju

Differential Revision: D26676518

fbshipit-source-id: 1cc9c32e2a95d6db78160f33ab5423338ea82e04
2021-05-04 22:18:55 -07:00
John Reese
9fd86a4fae apply upgraded black 21.4b2 formatting to fbsource
Summary:
This applies the formatting changes from black v21.4b2 to all covered
projects in fbsource. Most changes are to single line docstrings, as black
will now remove leading and trailing whitespace to match PEP8. Any other
formatting changes are likely due to files that landed without formatting,
or files that previously triggered errors in black.

Any changes to code should be AST identical. Any test failures are likely
due to bad tests, or testing against the output of pyfmt.

Reviewed By: thatch

Differential Revision: D28204910

fbshipit-source-id: 804725bcd14f763e90c5ddff1d0418117c15809a
2021-05-04 22:16:51 -07:00
Zeyi (Rice) Fan
9bee308885 cli: disable edenfsctl fsck on Windows
Summary:
Context: https://fb.workplace.com/groups/edenfswindows/permalink/828914994691047/

Even with D27872753 it doesn't really make sense to have `eden fsck` running on Windows since it requires EdenFS repository to **be unmounted**.

This diff changes it to generate a warning to redirect users to run `eden doctor` instead (which is likely what they need).

Reviewed By: kmancini

Differential Revision: D28203778

fbshipit-source-id: ae105678876903bcf6514252bf07189775f9b187
2021-05-04 21:25:00 -07:00
Jun Wu
2400e5c960 pydag: add importclonedata
Summary:
This will consume `CloneData` from EdenApi and write to the graph.

Note `CloneData<Vertex>` and `CloneData<HgId>` has the same mincode
serialization result so there is no need to do extra type conversion.

This can be used like:

  In [1]: v=api.clonedata('fbsource');
  In [6]: d=bindings.dag.commits.openhybrid(None, '/tmp/seg', '/tmp/msg', repo
     ...: .edenapi, repo.name, lazyhash=True)

  In [7]: d.importclonedata(v)

Reviewed By: kulshrax

Differential Revision: D27971125

fbshipit-source-id: 4d420c6ff0495dc184e7c9618b866a69f0a00002
2021-05-04 18:28:45 -07:00