Commit Graph

13962 Commits

Author SHA1 Message Date
CodemodService Bot
eb60f03626 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D33972281

fbshipit-source-id: 3e1fd5ba826bc17e9b3245a5edb7890b6f33c935
2022-02-03 01:18:05 -08:00
Carolyn Busch
bf28410902 edenapi: fix hex conversion crash
Summary: Currently the edenapi client crashes trying to convert a headname to a hex string, when the headname is a string that's not in hex form. Check if the string is in hex form before attempting to look it up as a prefix.

Reviewed By: DurhamG

Differential Revision: D32894078

fbshipit-source-id: 1d2d8145aa3136a27e4bbe674a07e2aa8bca81ef
2022-02-02 17:52:31 -08:00
Muir Manders
d68bac7192 lfs: retry fetch requests on 503 response code
Summary:
Currently a single LFS 503 during clone/checkout aborts the operation and leaves the user in a situation that is difficult to recover from. Now we treat a 503 as any other 5XX server error and retry.

The 5XX retry count/backoff can be configured via the lfs.backofftimes config knob. It defaults in the code to [1, 4, 8], which is 3 retries with rand(1), rand(4) and rand(8) sleep in between.

503 can be served from proxygen indicating there are no live lfs servers, or from x2pagentd in cases of network failure.

Reviewed By: quark-zju

Differential Revision: D33804601

fbshipit-source-id: cbb3514051843d3517bb676cf7c83dce057e42b9
2022-02-02 17:37:32 -08:00
Saul Gutierrez
56742d0027 initrepo: add python binding for Rust repo
Summary: Adds a Python binding for the Rust `repo` crate. For now it only exposes the static `Repo::init` method.

Reviewed By: DurhamG

Differential Revision: D33796094

fbshipit-source-id: 9cf49bcdd24bbabead79902e64a49ec8dc6fac55
2022-02-02 17:31:43 -08:00
Saul Gutierrez
6c9f70da66 repo: add method for repo initialization
Summary:
Adds a method that will be used in the future for replacing the repo initialization done in Python.

More specifically, this method creates and populates the files required for a new repo in the same way as we currently do via the constructor of `localrepo` with the extensions and configs we have enabled by default.

Reviewed By: DurhamG

Differential Revision: D33901712

fbshipit-source-id: 0d12732f5c9d36fb115a97e53b356a88fd609b6c
2022-02-02 17:31:43 -08:00
Jun Wu
1c8e6aa573 git: support debugbundle
Summary: This command is used by jf to find commits in a bundle.

Reviewed By: DurhamG

Differential Revision: D33948840

fbshipit-source-id: 2b7b8c09cb2b30c192a00e83437d079010be5a41
2022-02-02 14:25:38 -08:00
Simon Farnsworth
d3d1f33470 Special-case linkfile src="."
Summary:
I am making it impossible to put "." or ".." as a path element in Mononoke's `MPath` abstraction, since Mononoke does not do path traversal, and canonicalization is a minefield.

However, `linkfile src="."` occurs in https://fburl.com/code/evq63pto as a special case. Treat it specially in our code, so that I can forbid path traversal type elements in an `MPath`.

Reviewed By: mojsarn

Differential Revision: D33952767

fbshipit-source-id: 0c4ce68014fb6877163035d1c7eb813616748dd2
2022-02-02 14:17:56 -08:00
Katie Mancini
aa18aba9c3 teach eden doctor to recognize stale NFS mounts
Summary:
`eden doctor` does not know how to detect or fix broken NFS mounts.

Let's teach it to recognize NFS mounts, recognize when those mounts are stale,
and fix it.

Recognizing a stale mount is a bit different on NFS and FUSE. FUSE is kind and
responds with errors when you try to read a stale mount. NFS is not so kind.
It just hangs. So instead of certain errors indicating stale mounts, hangs
will have to indicate them.

Reviewed By: chadaustin

Differential Revision: D33283361

fbshipit-source-id: 939c212db1dcb1904fc8bbf3bbf32cd39970a101
2022-02-02 13:16:41 -08:00
Yan Soares Couto
80517b6fda Default master-fastpath to True
Summary:
## Context
See D33771940 (d274a0f575)

## This diff
I move `pull.master-fastpath` to True.

Reviewed By: quark-zju

Differential Revision: D33892184

fbshipit-source-id: 105c587da85287915ce3963315d568bf65b798c9
2022-02-02 11:01:34 -08:00
Muir Manders
7bbc2e1517 lfs: only log hash mismatch if size matches expected
Summary: In production we do currently see some cases of lfs_read_hash_mismatch. I realized it may be due to missing chunks rather than bad chunk integrity. The new "skip_hash_on_read" path is still able to detect size mismatch, so tweak things to only log mismatch message if the sizes match.

Reviewed By: quark-zju

Differential Revision: D33928640

fbshipit-source-id: 5b63db2b05bc7b53779cdb5ae0041a7d22bb3962
2022-02-02 09:50:03 -08:00
Yan Soares Couto
2c677eb49c Default exchange.httpcommitlookup to True
Summary:
## Context
See D33771940 (d274a0f575)

## This diff
I move `exchange.httpcommitlookup` to True.

Reviewed By: quark-zju

Differential Revision: D33892116

fbshipit-source-id: 48a4b5b9effaeca0df62b56c173cb53ad231c497
2022-02-02 08:42:48 -08:00
Yan Soares Couto
4e25a7ef08 Default httpbookmarks to True
Summary:
## Context
See D33771940

## This diff
I move `pull.httpbookmarks` and `infinitepush.httpbookmarks` to True.

Reviewed By: quark-zju

Differential Revision: D33891956

fbshipit-source-id: cbc3d92aa7ac7ac9edf90b4f99ab9804e9d750be
2022-02-02 07:43:38 -08:00
Yan Soares Couto
d274a0f575 Default pull.httpmutations to true
Summary:
## Context

There are some config options that have been rolled out to 100% of users for some time, but they're still not used in tests by default, which makes our coverage worse.

The best way to change the behaviour of hg regarding config is to change the default value on `configitems.py`, and then (eventually, when this rolls out everywhere), delete them from the configerator overrides config.

The other option would be to leave them in configerator (or in eden/scm/lib/configparser/src/fb/mod.rs), but then they would also need to be replicated in all tests that want to use it, or at the very least duplicated in the base hgrc for integration tests, which is very prone to errors (or simply forgetting to do it, the state we are in today).

Notice that this still allows us to set them to false via configerator quickly, if necessary.

## This diff

This diff defaults `pull.httpmutations` to true: It was previously always set to true on configparser/src/fb/mod.rs

Reviewed By: quark-zju

Differential Revision: D33771940

fbshipit-source-id: 987db9cfaff720645eac4ad65edf560f875b3655
2022-02-02 07:43:38 -08:00
Yan Soares Couto
544f9d27f3 Make edenapi-e2e test less flaky
Summary:
This is already done in another `hg pull` in this test, but needed to be done in the clone as well, as the test is a bit flaky right now.

Ideally we need to fix this so we don't need to sleep anymore, but this will unblock us for now. I tried flushing WBC in another diff (D33771281) but it did not fix the whole issue, there might be more underneath.

Reviewed By: markbt

Differential Revision: D33917157

fbshipit-source-id: c78b3718cb4d32480d1dce8dc2c962928f3f79ad
2022-02-02 07:21:28 -08:00
Mark Juggurnauth-Thomas
e3b24a3725 testtool: add mononoke-testtool drawdag
Summary:
Add a command that lets us inject a dag of commits into a test repo.

This is based on the `drawdag` implementation for unit tests.  We
extend the specification format so we can call `CreateCommitContext`
methods from the integration test code.

Reviewed By: yancouto

Differential Revision: D33854929

fbshipit-source-id: 8c903adfc2caa87d24ad89744a4415619aa5ebad
2022-02-02 04:27:29 -08:00
Mark Juggurnauth-Thomas
2f338593de testtool: add tool for integration tests
Summary:
Add a new tool `mononoke-testtool`, which will be used for commands that make
integration tests easier to write.

Since this tool is expected to only be used for tests, it will detect
production configurations and refuse to run.

Reviewed By: yancouto

Differential Revision: D33854930

fbshipit-source-id: c07cb73c726c8c60ef7a94a704f485fe9fc2576d
2022-02-02 04:27:29 -08:00
Mark Juggurnauth-Thomas
d5d31930a1 tools/admin: add fetch command
Summary:
Add `fetch`, which will match the features of `bonsai-fetch` and
`content-fetch` in the old admin tool.

Reviewed By: kris1319

Differential Revision: D33829451

fbshipit-source-id: dd123e60b3bf168ad6cdf1b5c3e3e2f929da5ebb
2022-02-02 02:50:51 -08:00
Xavier Deguillard
9b3486480b inodes: update SNAPSHOT at the beginning of checkout
Summary:
During checkout, the overlay is updated from the leaf up to the root, and thus
halfway through the operation, the overlay contains hashes from both the old
commit and the new commit. When the operation finishes, this discrepency no
longer exist as the overlay has been fully updated to the destination commit.

However, if EdenFS either crashes, or is being killed during the checkout
operation, the overlay will be left in this half updated state. Restarting
EdenFS and running a status or checkout operation will walk the inodes
hierarchy and construct them from the overlay, forcing a large amount of blobs
and manifests to be fetched from the network. This can be disruptive and lead
to updates/status taking a very long time due to potentially having to fetch
the entirety of the repository.

Thankfully, EdenFS can recognize this situation by simply updating its SNAPSHOT
file at the beginning of the checkout operation. If EdenFS crashes or is
killed, Mercurial will send EdenFS its own parent commit, which EdenFS can
compare and disagree about, failing the operation instead of fetching large
parts of the repository.

Reviewed By: chadaustin

Differential Revision: D33591210

fbshipit-source-id: b724429bb848425d2b1684b160ad8e1bdfee252a
2022-02-01 20:47:05 -08:00
Xavier Deguillard
572b6d9a8f config: update SNAPSHOT with in progress checkout information
Summary:
If a checkout is interrupted midway, EdenFS is unable to recover without
fetching very large parts of the repository. This leads to a poor user
experience as Mercurial suddenly hangs when doing anything.

In order to solve this, let's introduce a new SNAPSHOT version that allows
tracking the ongoing checkout operation and the commit origin and destination.

Since there is no current way for EdenFS to recover from this, let's also ask
the user to reclone if EdenFS is killed/crashed during checkout.

Reviewed By: genevievehelsel

Differential Revision: D33859121

fbshipit-source-id: b7cc4d2bc7aade047a230f5b579d8461c8586451
2022-02-01 20:47:05 -08:00
Xavier Deguillard
8d63827a14 service: fix use after free in getAttributesFromFiles
Summary:
When write notifications are pending on Windows, waitForPendingNotification
would wait for some time. Unfortunately, this means that the mountPoint thrift
argument would get freed, and since the lambda only captured a piece of the
path, and not the path directly, the mount path would get used after the
underlying path has been freed. We need to copy the path to avoid this issue.

Reviewed By: MichaelCuevas

Differential Revision: D33927317

fbshipit-source-id: 790bcb26cb46cdac750826ebe13c56e0d1275c22
2022-02-01 17:03:04 -08:00
Jun Wu
472a1148b1 git: support bundle and unbundle
Summary: Delegate to git's own bundle implementation for bundle and unbundle.

Reviewed By: DurhamG

Differential Revision: D33895676

fbshipit-source-id: 3d17160c6f83c2f43ff41bcf3f74c00aecded630
2022-02-01 16:14:02 -08:00
Jun Wu
26d921b8c1 git: support older git by avoiding init -b
Summary:
The flag is not supported by git older than 2.28. There are still places
running older git. Change the command from `git init -b x` to
`git -c init.defaultBranch=x init` so it becomes compatibile with older
git.

We don't use the default branch. So set it to `_unused_branch` to
make it more explicit.

Reviewed By: DurhamG

Differential Revision: D33851129

fbshipit-source-id: 93534362b02353728d72d0ebef31c6a25737398f
2022-02-01 16:14:01 -08:00
Jun Wu
ed6b21bbce git: disable treemanifest prefetch
Summary:
With a local git store all trees are local. There is no need to prefetch.
Forcing prefetch trees would cause errors, since the protocol is incompatible.

Reviewed By: DurhamG

Differential Revision: D33837781

fbshipit-source-id: c41281ac96aff1501bd056901213b912a77f6c31
2022-02-01 16:14:01 -08:00
Jun Wu
d2e54864af git: update smartlog.repos config
Summary: It is a left-over from D33518822 (b897a19073).

Reviewed By: DurhamG

Differential Revision: D33837780

fbshipit-source-id: f42fb7f9099ab4cb388c7bd8f038839fd6976cbf
2022-02-01 16:14:01 -08:00
Jun Wu
0c883afe41 git: support clone --git
Summary:
Previously `clone` has to use git URLs with `git+` prefix in scheme such as
`git+ssh://...`, `git+file://...`, `git+https://...`. That was the same
behavior as the `hg-git` extension but is inconvenient for scp-like URLs
like `git@github.com:git/git.git` (provided by GitHub). That URL needs to be
translated to ssh form `git+ssh://git@github.com/git/git.git` manually,
which can be annoying.

Let's use a `--git` flag so `clone --git` can use the scp-like URL directly.
The `--git` flag also makes `clone` more consistent with `init`.

Reviewed By: DurhamG

Differential Revision: D33837782

fbshipit-source-id: 7fe11be6cf63932bde1f400cdfc2fc8120f5067a
2022-02-01 16:14:01 -08:00
Durham Goode
f88bf230ca rage: remove pack output from hg rage
Summary:
Packs are long dead. Let's remove the logging for hg rage. This logic
also doesn't work on Windows, due to depending on cmd commands, resulting in
some errors in the hg rage since we now use powershell.

Differential Revision: D33925868

fbshipit-source-id: c071f8f5685dbf7a9174cad31a0a8cd99a84cf88
2022-02-01 16:06:57 -08:00
Jun Wu
09d7d3785f eden: avoid slow linkrev scan paths
Summary: See the added comments and D33926639.

Differential Revision: D33927449

fbshipit-source-id: d60ff5410a6f878e3d0c85f7ad47072687e8e285
2022-02-01 15:37:47 -08:00
Muir Manders
17c76c1e4e nativecheckout: fix "-C" to always clear mergestate
Summary: There was an edge case where native checkout "up --clean" wasn't clearing the merge state if the working tree was clean. Add a check so we use fallback non-native code path if there is an active merge state.

Reviewed By: quark-zju

Differential Revision: D33893832

fbshipit-source-id: a0e4a8d23818a1e40582cede0afee62ac53cb680
2022-02-01 15:18:20 -08:00
Saul Gutierrez
a237ae47e7 repo: move the repo module to its own crate
Summary: Since `Repo` will soon contain more logic on its own not related to `clidispatcher`, we are moving its own crate.

Reviewed By: DurhamG

Differential Revision: D33883867

fbshipit-source-id: 94414e1e2692962bf491cc2abb4e1d3799cbcc03
2022-02-01 11:32:42 -08:00
Mark Juggurnauth-Thomas
5f31e6357d tools/admin: add blobstore-unlink command
Summary:
Copy the `blobstore-unlink` command into the new admin tool.

The blobstore-unlink command only works on SQLBlob, so keep it as a separate
command for now.  In the future we can integrate it with the main blobstore
command.

Reviewed By: kris1319

Differential Revision: D33791722

fbshipit-source-id: 83afc8d87dc1b96e91b7e96bdb1adf0106a822b9
2022-02-01 05:14:28 -08:00
Mark Juggurnauth-Thomas
175d61088b tools/admin: implement blobstore subcommand
Summary:
Implement the `blobstore` subcommand for examining and uploading to the
blobs in the blobstore.

This is an improvement over the existing `blobstore-fetch`, as we can now
interpret the data as more types, and hex-dump the data if we can't decode it
as a known type.

Not all types are implemented yet, but it should be easy to add them later.

Reviewed By: mitrandir77

Differential Revision: D33791723

fbshipit-source-id: bb2ea6c76986fcdd34b3d7be773c5c8168e41be8
2022-02-01 05:14:27 -08:00
Jan Mazur
c9e0a0bc1b remove x-x2pagentd-ws-over-h1=1 header
Summary: Due to a bug in the x2pagent with websocket connection polling in h2 we had to force h1. Now it's fixed and the new version of the agent with the fix should be rolled out to (almost - it's corp) 100% of users.

Reviewed By: quark-zju

Differential Revision: D33842574

fbshipit-source-id: aaf5c66143806a900253120a9f750e37ebe55b80
2022-02-01 03:13:47 -08:00
CodemodService Bot
68e2c741a6 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D33911946

fbshipit-source-id: 8c2d18ba678a166e13c800fbf6a1baa50d236c0f
2022-02-01 02:47:59 -08:00
Muir Manders
dd78f808fb sigtrace: allow manually sigtracing long running commands
Summary: On Windows we apparently can't send a USR1 to trigger a trace on an eden helper process. This commit makes it possible to touch a file to trigger a particular long running process to write out its sigtrace.

Reviewed By: DurhamG

Differential Revision: D33904056

fbshipit-source-id: d42f6c071bcfaa8dfc352f65df31bdc5ea201823
2022-01-31 17:30:13 -08:00
Katie Mancini
8eeadf70de Update takeover documentation for recent updates
Summary: Updating the takeover documentation since I have made a lot of changes.

Reviewed By: genevievehelsel

Differential Revision: D33852007

fbshipit-source-id: 665dcbb0745edf2a3e91f04ddeb69be6efb46d6e
2022-01-31 13:13:10 -08:00
Muir Manders
c7761fb8cd sparse: accept relative sparse profile names
Summary: Make "sparse enable" normalize profile names. It is not clear it wants a canonical path from the root of the repo, so now it makes some attempts to convert the given path(s) to that form. It now works with paths relative from cwd, and normalizes the path separator.

Reviewed By: quark-zju

Differential Revision: D33851998

fbshipit-source-id: 91a3d59b91266bb8941408d23d5021fa1f9e7025
2022-01-31 12:21:43 -08:00
Alex Hornby
2613ad5742 remove generated code for hgclientconf
Summary:
Point the thrift-types at the rust target, no need for the checked in generated code anymore

Saves generation, gives quicker signal on thrift changes (no codegen step), and stops thrift lib vs generated thrift code mismatches

Reviewed By: yancouto

Differential Revision: D33843588

fbshipit-source-id: 856faeb16dc0a2a42f2f07fd3005079a01b6e7bd
2022-01-31 10:34:32 -08:00
Jan Mazur
eda968ebe4 remove Priority from metadata
Summary: we were always running with Priority::Default. On the http path it wasn't even possible to set it to something different. I guess we don't need it then.

Reviewed By: yancouto

Differential Revision: D33842396

fbshipit-source-id: f2b18b47149e1c15df2fba0010718dd56030a29f
2022-01-31 09:07:49 -08:00
Jan Mazur
fdfff57b73 remove hgcli code path from mononoke server
Summary:
No hgcli requests: https://fburl.com/ods/vkr7tjs7

Hgcli was a small binary that was running on hg servers. Its purpose was to proxy users' ssh traffic landing on hg servers to mononoke. It was sending a custom Preamble to mononoke with users' info parsed on hg servers from ssh environment, and after that it was proxying wireproto traffic that mononoke understands.

Now no client connects to hg servers. Everyone connects to mononoke using http (either http with upgrade to wireproto (only push) or edenapi). Hgcli is not even installed on hg servers. There is on need to have that code path around.

Reviewed By: yancouto

Differential Revision: D33841713

fbshipit-source-id: 682594210789ba5669660c53634f2f8111f39e41
2022-01-31 09:07:48 -08:00
Andres Suarez
20675f6fc9 Update indexmap to 1.8.0
Summary: Non-breaking changes. https://github.com/bluss/indexmap/blob/1.8.0/RELEASES.rst

Reviewed By: Imxset21

Differential Revision: D33887730

fbshipit-source-id: 60e016f1f4429407b1f8232f3e5eefe5f89965fd
2022-01-31 07:48:41 -08:00
Yan Soares Couto
6866997a01 Add retries to streaming_clone sql queries
Summary: This is an attempt to mitigate T110506843. Tasks have been crashing with SQL errors, this diff adds some retries to those calls.

Reviewed By: farnz

Differential Revision: D33791829

fbshipit-source-id: 8c5d54e7513d3526f3878285d8a684b391ef8b0d
2022-01-31 04:50:45 -08:00
Yan Soares Couto
dcedc9f63b Extract retry function from hg_sync_job to common lib
Summary:
This diff extracts the `retry` function to a more common place. This is used to retry arbitrary functions, and from a quick search you can find multiple implementations of this throughout mononoke ([1]() [2]() [3]()), with different level of features (logging, exponential backoffs, splaying).

I made it slightly more generic, by using `FnMut` and templating the error type, so it's more future proof.

This seems to be the most generic one, so I'm extracting it to reuse it in a future diff, and avoid adding yet another implementation.

Reviewed By: ahornby

Differential Revision: D33791605

fbshipit-source-id: 6a09093a3334d41491ecab779a90b23b459d7db3
2022-01-31 04:50:45 -08:00
Alex Hornby
9e4c168806 rust: remove mockall patch
Summary: The mentioned PR https://github.com/asomers/mockall/pull/330 was superceded by https://github.com/asomers/mockall/pull/333 and is part of 0.11 release

Reviewed By: dtolnay

Differential Revision: D33881560

fbshipit-source-id: 1676f725739939695e4b7b2b8eb14b08ad27e6c1
2022-01-31 02:09:13 -08:00
Muir Manders
06eb4d9977 pipe "fb" cargo feature down to clientinfo
Summary: I moved some stuff around and am having trouble getting everything to be happy. One thing I forgot was to actually pipe the "fb" feature down from the entry point crates (hgcommands and backingstore).

Reviewed By: xavierd

Differential Revision: D33852732

fbshipit-source-id: aabdd145452e66435e130fcbab0ba8a80f9d943a
2022-01-31 02:09:09 -08:00
Alex Hornby
cee3195431 rust: run autocargo
Summary: Run autocargo.  Much of this will probably rebase away

Reviewed By: farnz

Differential Revision: D33840309

fbshipit-source-id: d0b5f5b0290f2d9703c57a36921d95952550c80f
2022-01-31 02:09:08 -08:00
Brian Chen
17b5f621da Run autocargo
Summary: Run autocargo.

Reviewed By: davide125

Differential Revision: D33851831

fbshipit-source-id: ad049eeb76a0e010b10374190301573aa165f2a4
2022-01-31 02:09:08 -08:00
Robert Grosse
f9db3e0691 fix typo
Summary: fix typo

Reviewed By: farnz

Differential Revision: D33849793

fbshipit-source-id: 6a99ece265f2128f30b68249e84927db2bc65f5e
2022-01-31 02:09:07 -08:00
Ilia Medianikov
f29f4fb675 segmented_changelog/tailer: remove boilerplate code from logging
Summary: Writing `repo: {}` everywhere is quite annoying when we can just set a value in the logger instead.

Reviewed By: farnz

Differential Revision: D33845555

fbshipit-source-id: 0e6773549c3913df68719362fa1c926f205802fe
2022-01-31 02:09:07 -08:00
Muir Manders
57d6b8787e nativecheckout: add total to "recording" progress bar
Summary: Replace "recording" spinner with a true progress bar.

Reviewed By: quark-zju

Differential Revision: D33796497

fbshipit-source-id: 2399b20af3c65ec91031b417413010d36d7a6101
2022-01-31 02:09:07 -08:00
Alex Hornby
b39d4ea2d1 updated expected config hash
Summary: Update the expected hash

Reviewed By: HarveyHunt

Differential Revision: D33843474

fbshipit-source-id: 4a14744e1d6ed15042b12f62f45634fa75591ffe
2022-01-31 02:09:07 -08:00