Commit Graph

60352 Commits

Author SHA1 Message Date
Arun Kulshreshtha
25af6e81d7 edenapi_server: add HandlerInfo
Summary:
Add a new `HandlerInfo` struct that can be inserted into the request's `State` by each handler to provide information about the handler to post-request middleware. (This includes things like which handler ran, which repo was queried, etc.)

A note on design: I did consider adding these fields to `RequestContext` (similar to how it's done in the LFS server), but that proved somewhat problematic in that it would require using interior mutability to avoid forcing each handler to borrow the `RequestContext` mutably (and therefore prevent it from borrowing other state data). The current approach seems preferable to adding a `Mutex` inside of `RequestContext`.

Reviewed By: krallin

Differential Revision: D23619077

fbshipit-source-id: 911806b60126d41e2132d1ca62ba863c929d4dc9
2020-09-10 20:57:12 -07:00
svcscm
f8be541a28 Updating submodules
Summary:
GitHub commits:

10b33d4cfc
03a8f4de26
ed1e12a906

Reviewed By: wittgenst

fbshipit-source-id: 7a1c4b4b5fb89000b040152993adacc2d5d9d812
2020-09-10 20:57:12 -07:00
svcscm
24f8677feb Updating submodules
Summary:
GitHub commits:

d276c470b2
3c68d6745f
783ed3d75a
90607a2574
e7069f6853
3a6fd09cee
1963e76163
93079baef8
e4b829f729
dc14845a82
21753a22db
ea3faa0653
1e13918f2c

Reviewed By: wittgenst

fbshipit-source-id: b30254e0b54be1d1f986a12031880b8e2beb78b5
2020-09-10 19:46:05 -07:00
Durham Goode
474b043a34 grep: fix biggrep integration when corpus rev is not present
Summary:
The corpus rev that biggrep has indexed may not be available in the
local client. Later on in the function it will pull that revision, but earlier
in the function the new logic I added a few weeks ago is just crashing.

That logic was trying to diff against the earlier revision, but that's pretty
arbitrary. Let's just diff against one of the revs at random
(deterministically) and get rid of the need for the hash to exist in the repo
early in the command.

Reviewed By: sfilipco

Differential Revision: D23635801

fbshipit-source-id: 1c284d710b8df9539a696e900183bc10d5d71869
2020-09-10 18:01:38 -07:00
Xavier Deguillard
45854b5ba0 cli: fix eden top
Summary:
The AccessCount fields were recently renamed to start with fsChannel instead of
fuse to be more platform independant. This broke edenfsctl due to it using the
old names.

Reviewed By: wez

Differential Revision: D23633574

fbshipit-source-id: 2a5fc73c47d2f0a6db407ecfeaf85992b7932c10
2020-09-10 16:07:30 -07:00
svcscm
5d2ac9142a Updating submodules
Summary:
GitHub commits:

c179d691d2
74f244dfd9
e4a48c847f
325a6465ec

Reviewed By: wittgenst

fbshipit-source-id: 34a07307cf5fb7585131a4789c562680120810c4
2020-09-10 16:07:30 -07:00
svcscm
82e11f48bd Updating submodules
Summary:
GitHub commits:

3bfd1f47d3
704c7ec4a6
71c7065dc0

Reviewed By: wittgenst

fbshipit-source-id: f5b4f90803ce2c781065920f8c17205e236c5bd1
2020-09-10 13:54:23 -07:00
Katie Mancini
2d6fd038e9 Make TreeInode::prefetch metadata prefetching aware
Summary:
Readdir tries to be smart and prefetch the metadata for each of the children.
But this uses the old path to read metadata for files which can cause eden to
download the blob. When metadata prefetching is turned on in the backing store
it is better to leave this to metadata prefetching to the backing store.

Reviewed By: wez

Differential Revision: D23476876

fbshipit-source-id: 41cc5e6f423f19adb18581564c069c12621b6c1b
2020-09-10 13:29:36 -07:00
Zeyi (Rice) Fan
dec1cc3fb2 handle non-empty directory when creating redirections
Summary:
This diff fixes a bug on Windows when the redirection target is a non-empty directory. As seen in P141872812

This doesn't make the exception go away but generate a more meaningful error message so the user can act on it.

Reviewed By: xavierd

Differential Revision: D23605233

fbshipit-source-id: 2d2bde0e9cd94323a6537ebcec29a4c15868806d
2020-09-10 09:20:03 -07:00
svcscm
c180d940a2 Updating submodules
Summary:
GitHub commits:

8049f9705a
3f19ef0ec5
ec5bf9749c

Reviewed By: wittgenst

fbshipit-source-id: 4a73f4331e8a910731f110914ee14ad497084792
2020-09-10 06:54:55 -07:00
Viet Hung Nguyen
4a6351c8a2 mononoke/repo_import: check dependent systems for small repo,
Summary: Once we start to move the bookmark for the large repo commits, small repo commits should also start to appear for the dependent systems (e.g. Phabricator) through back-syncing. This diff adds this functionality to see if the commits have been recognised by the tools.

Reviewed By: StanislavGlebik

Differential Revision: D23566994

fbshipit-source-id: 2f6f3b9099bb864fec6a488064abe1abe7f06813
2020-09-10 05:46:35 -07:00
svcscm
215c5e78e3 Updating submodules
Summary:
GitHub commits:

10ee4469c1
983c38d949
041de5a486

Reviewed By: wittgenst

fbshipit-source-id: 72a629da9a0c3d2a640c9ff8db0667cd81efb738
2020-09-10 04:56:24 -07:00
Lukasz Piatkowski
1d2340782a mononoke/integration: exclude the most flaky tests (#55)
Summary: Pull Request resolved: https://github.com/facebookexperimental/eden/pull/55

Reviewed By: farnz

Differential Revision: D23622449

Pulled By: lukaspiatkowski

fbshipit-source-id: 79e1895f2c6191a2968d0cff226a38ba47188431
2020-09-10 03:26:09 -07:00
Simon Farnsworth
1f7d61a04f Teach mononoke_admin blobstore-fetch to save the raw contents to a file
Summary: Useful when looking into blobstore corruption - you can compare all the blobstore versions by manual fetchees.

Reviewed By: krallin

Differential Revision: D23604436

fbshipit-source-id: 7b56947b0188536499514bae6615c6e81b9106c3
2020-09-10 02:29:48 -07:00
Simon Farnsworth
4754357f62 Asyncify more of blobstore_fetch admin command
Summary: Going to add more features, so simplify by asyncifying first

Reviewed By: krallin

Differential Revision: D23604437

fbshipit-source-id: 52b2b372e4d3fbf1d59168c6c11311d9edf4ff0f
2020-09-10 02:29:48 -07:00
Simon Farnsworth
89e30973ff Report write errors when scrubbing
Summary: When we're scrubbing blobstores, it's not actually a success state if a scrub fails to write. Report this back to the caller - no-one will usually be scrubbing unless they expect repair writes to succeed, and a failure is a sign that we need to investigate further

Reviewed By: mitrandir77

Differential Revision: D23601541

fbshipit-source-id: d328935af9999c944719a6b863d0c86b28c54f59
2020-09-10 02:29:47 -07:00
Lukasz Piatkowski
c044f1669a mononoke/integration tests: deal with bash issues on tests (#50)
Summary:
One test was fixed earlier by switching MacOS to use modern version of bash, the other is fixed here by installing "nmap" and using "ncat" from within it on both linux and mac.

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

Reviewed By: krallin

Differential Revision: D23599695

Pulled By: lukaspiatkowski

fbshipit-source-id: e2736cee62e82d1e9da6eaf16ef0f2c65d3d8930
2020-09-10 01:56:54 -07:00
svcscm
86c4677d04 Updating submodules
Summary:
GitHub commits:

77553efbe0

Reviewed By: wittgenst

fbshipit-source-id: e1232bd6c2f219acbccb527e4bcecbae87ea51cf
2020-09-09 23:44:13 -07:00
Arun Kulshreshtha
54641e8d1b edenapi_server: remove extraneous fields/methods from RequestContext
Summary: Remove unused fields and superfluous methods from `RequestContext`.

Reviewed By: singhsrb

Differential Revision: D23619076

fbshipit-source-id: 0fc42d6c29a8bb5c197d3559baa497a9e6e9c825
2020-09-09 22:43:31 -07:00
svcscm
d60b0e41cb Updating submodules
Summary:
GitHub commits:

da9e73228c
15d2fa399f

Reviewed By: wittgenst

fbshipit-source-id: 71ae569b7ca833c3815695be3824bc695dc1e727
2020-09-09 22:43:30 -07:00
svcscm
beb8e1245b Updating submodules
Summary:
GitHub commits:

031e6b5752
3d69f701b8
7c364fc2ce
bfde457b0d
eb39d85eb8
2e62befa55
276c78c18b
3636fa1cfc
5be6845c54
ce52ea3cee
e17b2c12d1
fd85675c65

Reviewed By: wittgenst

fbshipit-source-id: 980755322648b08d3d4c9a45a2ec6d3469e8c5f3
2020-09-09 20:22:36 -07:00
Durham Goode
f5a2347fbb py3: fix Mononoke Python 3 test failures
Summary:
Fixes a few issues with Mononoke tests in Python 3.

1. We need to use different APIs to account for the unicode vs bytes difference
for path hash encoding.
2. We need to set the language environment for tests that create utf8 file
paths.
3. We need the redaction message and marker to be bytes.  Oddly this test still
fails with jq CLI errors, but it makes it past the original error.

Reviewed By: quark-zju

Differential Revision: D23582976

fbshipit-source-id: 44959903aedc5dc9c492ec09a17b9c8e3bdf9457
2020-09-09 18:31:04 -07:00
Xavier Deguillard
ed4021b8e3 revisionstore: disallow reading LFS pointers from packfiles
Summary:
For repositories that have the old-style LFS extension enabled, the pointers
are stored in packfiles/indexedlog alongside with a flag that signify to the
upper layers that the blob is externally stored. With the new way of doing LFS,
pointers are stored separately.

When both are enabled, we are observing some interesting behavior where
different get and get_meta calls may return different blobs/metadata for the
same filenode. This may happen if a filenode is stored in both a packfile as an
LFS pointers, and in the LFS store. Guaranteeing that the revisionstore code is
deterministic in this situation is unfortunately way too costly (a get_meta
call would for instance have to fully validate the sha256 of the blob, and this
wouldn't guarantee that it wouldn't become corrupted on disk before calling
get).

The solution take here is to simply ignore all the lfs pointers from
packfiles/indexedlog when remotefilelog.lfs is enabled. This way, there is no
risk of reading the metadata from the packfiles, and the blob from the
LFSStore. This brings however another complication for the user created blobs:
these are stored in packfiles and would thus become unreadable, the solution is
to simply perform a one-time full repack of the local store to make sure that
all the pointers are moved from the packfiles to to LFSStore.

In the code, the Python bindings are using ExtStoredPolicy::Ignore directly as
these are only used in the treemanifest code where no LFS pointers should be
present, the repack code uses ExtStoredPolicy::Use to be able to read the
pointers, it wouldn't be able to otherwise.

Reviewed By: DurhamG

Differential Revision: D22951598

fbshipit-source-id: 0e929708ba5a3bb2a02c0891fd62dae1ccf18204
2020-09-09 18:27:42 -07:00
svcscm
fe3a517f64 Updating submodules
Summary:
GitHub commits:

2fa25ce308
2367f1d177
205af2075e
c26af9db86
1cd317da0b
c92296e4d7
157235b455
a9a1d4ff45
8b7287a1bc
4ba717e14c
fb8717c966
a934e82bf1

Reviewed By: wittgenst

fbshipit-source-id: 0614ce6361ff2a6d451933233dfc8d7ea43abb99
2020-09-09 18:00:23 -07:00
Stefan Filip
1c172c9008 lfs: use hg-http built client for network requests
Summary: This client provides automatic metrics collection.

Reviewed By: kulshrax

Differential Revision: D23577871

fbshipit-source-id: 137299222a20bc8e4d52c3321febbb91d861b236
2020-09-09 17:35:49 -07:00
Stefan Filip
046db98222 edenapi: use hg-http built client for network requests
Summary:
hg-http's built client should provide integration with Mercurial's stats
collection mechanisms.

Reviewed By: kulshrax

Differential Revision: D23577867

fbshipit-source-id: 93c777021bc347511322269d678d6879710eed3e
2020-09-09 17:35:48 -07:00
Stefan Filip
c1ab6a4e92 http-client: add stats reporting hook
Summary:
Add `with_stats_reporting` to HttpClient. It takes a closure that will be
called with all `Stats` objects generated. We then use this function in
the hg-http crate to integrate with the metrics backend used in Mercurial.

Reviewed By: kulshrax

Differential Revision: D23577869

fbshipit-source-id: 5ac23f00183f3c3d956627a869393cd4b27610d4
2020-09-09 17:35:48 -07:00
Stefan Filip
008d0c82df metrics: use the hgmetrics bindings for incrementing counters
Summary: Rust based metrics so that even Rust libraries can write metrics.

Reviewed By: quark-zju

Differential Revision: D23577870

fbshipit-source-id: b19904968d9372c8ce19775fb37c7af53a370ea5
2020-09-09 17:35:48 -07:00
Stefan Filip
de9b34e83a bindings: add pyhgmetrics to bind the hg-metrics crate
Summary: Exposing the hg-metrics crate to the Python application.

Reviewed By: quark-zju

Differential Revision: D23577875

fbshipit-source-id: 1d919160f8514ae8bfcb0171a0c9d1d9d0de80e6
2020-09-09 17:35:48 -07:00
Stefan Filip
7f72a04c0e metrics: crate for collecting metrics
Summary:
We start off simple here. Python only really has counters so we only implement
counters. There are a lot of options on how to improve this and things get
slightly complicated when we look at the how ecosystem and fb303. Anyway,
simple start.

Reviewed By: quark-zju

Differential Revision: D23577874

fbshipit-source-id: d50f5b2ba302d900b254200308bff7446121ae1d
2020-09-09 17:35:48 -07:00
Stefan Filip
ead17552cf metrics: treat slash '/' as metric delimiter
Summary:
Slash is probably the standard metric delimiter nowadays. Since we don't have
that many metrics I think that it makes sense to look at slash as the
standard metric delimiter going forward.
This diff updates parsing of metric names to treat both '_' and '/' as
delimiters.

Reviewed By: quark-zju

Differential Revision: D23577876

fbshipit-source-id: 03997b1285df9c52d6e2837b5af5372deb69b133
2020-09-09 17:35:48 -07:00
Stefan Filip
4ad9091598 thrift: update thrift types
Summary: autogenerated by `make local`

Reviewed By: quark-zju

Differential Revision: D23577872

fbshipit-source-id: 6ca98fd865c3b3bc3a00d8126ce20b59110f8118
2020-09-09 17:35:48 -07:00
Adam Simpkins
3daaba6d43 update fbcode_builder README to document getdeps.py
Summary:
Update the `README.md` file in the fbcode_builder subdirectory to document the
current getdeps.py build system rather than the older fbcode_builder scripts
that required each project to keep their own python-based build files in their
project directory.

Reviewed By: chadaustin, wez

Differential Revision: D23591356

fbshipit-source-id: 75a099a10793e68a2b59696682010c4dff47ec69
2020-09-09 15:40:21 -07:00
svcscm
f7ec482b93 Updating submodules
Summary:
GitHub commits:

7458897e79
dc139ddeda
d850433df4
c9993790d2
8862b6a526
127c7bd1c7
ae914c6997
44f0efc82b
3ca1a33174
07cd92bf57
c94d450ddb
c24305b353
abfe1a24aa

Reviewed By: wittgenst

fbshipit-source-id: c826f988278f1db86b63baf03c161fe8916d0bff
2020-09-09 15:40:21 -07:00
Liubov Dmitrieva
321f4dfb31 add hg cloud switch command to simplify switching between
Summary:
The command is easier to use than `hg cloud join --switch`.

Also highlight the workspace name in the output of `hg cloud status`

Reviewed By: mitrandir77

Differential Revision: D23601507

fbshipit-source-id: 74eb17c9366a9dbe96881c8e3e0705619fadb3d6
2020-09-09 14:04:57 -07:00
svcscm
6f46efb3d4 Updating submodules
Summary:
GitHub commits:

6a9d5130b4
ca7bf9c6c3
efd116e7b8
7187a3af01
0771fbb403
ec5add398c
8e5fd0bb04
1f375c89fb
abeace0f70
8343c51659
603a001df6
8e36e47f14
18970b528d

Reviewed By: wittgenst

fbshipit-source-id: a5918f10d1daf27d14a950749471aaf5a80d9ee2
2020-09-09 13:38:10 -07:00
Adam Simpkins
367dce62df update FindGflags.cmake to work on CentOS 8.x (#1409)
Summary:
Update FindGflags.cmake to work on recent CentOS and RedHat distributions.

On these distributions the CMake package configuration installed by the
gflags-devel RPM is slightly broken, and sets `gflags_INCLUDE_DIR` to a
directory that does not exist.  This happens because `/lib64` is symlinked to
`/usr/lib64`, and CMake ends up searching `/lib64` before `/usr/lib64` by
default when searching for packages.  Therefore it finds `gflags-config.cmake`
via the `/lib64` symlink.  However, `gflags-config.cmake` computes the include
directory relative to where its config file was found, and this relative path
computation only works when using the actual `/usr/lib64` path where it was
installed.  When found via `/lib64` it returns a bogus `//include` path that
does not exist.

This updates `FindGflags.cmake` to verify if the `gflags_INCLUDE_DIR` path
actually exists, and set it to a sane location instead.

This also updates the code to use the `gflags-shared` target that is exported
by the default gflags package configuration if it was only built as a shared
library.

Pull Request resolved: https://github.com/facebook/folly/pull/1409

Reviewed By: yfeldblum

Differential Revision: D23588288

fbshipit-source-id: b68a717953ae0521f568d7bcfd05ca33cd6dc578
2020-09-09 12:44:54 -07:00
svcscm
d6d36903a8 Updating submodules
Summary:
GitHub commits:

617c2e9a10
2a41679be5
70ceaf4fc5
8329208ff8
160f0da4ea
5c39d8df69
a4b5590888
d1d6b628e4
2b4b33a8d4
8823a93f10
e7dcdc41a8
91525d80bf
e69e2583fd
1fff6f82c1

Reviewed By: wittgenst

fbshipit-source-id: 0629accfe55535bc1f423f6006eda55e8635a561
2020-09-09 12:41:25 -07:00
Viet Hung Nguyen
0c84fb7a2b mononoke/mononoke_types: implement deserialize for typed_hashes
Summary:
typed_hash only implements serialize. Because of this, if we want to serialize a struct that contains e.g changesetid(s), we can't deserialize it later. This diff adds deserialize implementation for typed_hashes.
Implementation is similar to HgNodeHash's: https://fburl.com/diffusion/r3df5iga

Reviewed By: krallin

Differential Revision: D23598925

fbshipit-source-id: 4d48b75eb8a01028e6e2d9bcc1ae20051a97b7fb
2020-09-09 11:35:38 -07:00
Pavel Aslanov
897ec3d6d8 verify that received files have the correct size
Summary:
Streaming clone implementation did not check that received files have the corrects. This change addresses it.

Before this change if connection was interrupted for whatever reason client would treat fetch of changeset as successful and proceed with cloning operations, but later checks would report corruption of internal state of hg data. This is based on user [report](https://fb.workplace.com/groups/scm/permalink/3177150312334567/)

Reviewed By: quark-zju, krallin

Differential Revision: D23572058

fbshipit-source-id: d740b45ca217cd6db0a65e01aabc2ba9a4835221
2020-09-09 11:32:38 -07:00
Saurabh Singh
384c4f61fa fix the Windows build
Reviewed By: sfilipco

Differential Revision: D23601358

fbshipit-source-id: c5a33286b7468882bbedb3e8fe85f66a8f9db0e2
2020-09-09 10:39:35 -07:00
Arun Kulshreshtha
de7f7ab4fe http-client: rename crate
Summary: The Mercurial codebase uses hyphens in crate names rather than underscores. This is similar to the convention favored by the larger Rust community, though it is different from Mononoke, which uses underscores. While we'll probably need to eventually settle on a consistent convention for all of projects in the Eden SCM repo, for now, `http_client` should be made consistent with the adjacent crates.

Reviewed By: sfilipco

Differential Revision: D23585721

fbshipit-source-id: d2e690d86815be02d7b8d645198bcd28e8cbd6e0
2020-09-09 10:12:50 -07:00
Xavier Deguillard
99a1771351 notifications: compile on Windows
Summary:
While it's unlikely to work properly (it uses /bin/sh), it compiles properly on
Windows, so let's include it in the build.

Reviewed By: wez

Differential Revision: D23520368

fbshipit-source-id: 267ba04f98f5dacc81e1772f86f5ad43c846815d
2020-09-09 09:33:35 -07:00
Stanislau Hlebik
b5f1e53cd6 mononoke: use logical number of cpus in our runtime
Summary:
We are using older version of tokio which spawns as many threads as we have
physical cores instead of the number of logical cores. It was fixed in
https://github.com/tokio-rs/tokio/issues/2269 but we can't use it yet because
we are waiting for another fix to be released -
https://github.com/rust-lang/futures-rs/pull/2154.

For now let's hardcode it in mononoke

Reviewed By: krallin

Differential Revision: D23599140

fbshipit-source-id: 80685651a7a29ba8938d9aa59770f191f7c42b8b
2020-09-09 09:25:40 -07:00
Pavel Aslanov
f87db3eecf move existing changeset derivation logic to mercurial_derived_data
Summary:
This change move logic associated with mercurial changeset derivation to `mercurial_derived_data` crate.

NOTE: it is not converted to derived data infrastructure at this point, it is a preparation step to actually do this

Reviewed By: farnz

Differential Revision: D23573610

fbshipit-source-id: 6e8cbf7d53ab5dbd39d5bf5e06c3f0fc5a8305c8
2020-09-09 07:56:32 -07:00
David Tolnay
e83e05ff25 Update formatter to rustfmt 2.0
Reviewed By: zertosh

Differential Revision: D23591028

fbshipit-source-id: f458503fc2b9c25023fa1643eca5e166882a4811
2020-09-09 07:52:34 -07:00
David Tolnay
0cb8a052f5 Update formatter to rustfmt 2.0
Reviewed By: zertosh

Differential Revision: D23591021

fbshipit-source-id: e664aa2fdd3aaa457796a59080be6b94f604a112
2020-09-09 07:52:33 -07:00
Lukasz Piatkowski
c983dc96fe mononoke/integration tests: fix using private certs during Mac tests with hg (#53)
Summary:
The Mac integration test workflow already installs a modern curl that fixes https://github.com/curl/curl/issues/4801, but it does so after "hg" is built, so "hg" uses the system curl libraries, which fails when used with a certificate not present in keychain.

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

Reviewed By: krallin

Differential Revision: D23597285

Pulled By: lukaspiatkowski

fbshipit-source-id: a7b8b6ae55ce338bfb9946a852cbb6b929e73203
2020-09-09 07:28:09 -07:00
Simon Farnsworth
9b9607b02e Have manual_scrub continue on errors, writing out files to let you retry instead
Summary:
There are blobs that fail to scrub and terminate the process early for a variety of reasons; when this is running as a background task, it'd be nice to get the remaining keys scrubbed, so that you don't have a large number of keys to fix up later.

Instead of simply outputting to stdout, write keys to one of three files in the format accepted on stdin:

1. Success; you can use `sort` and `comm -3` to remove these keys from the input dat, thus ensuring that you can continue scrubbing.
2. Missing; you can look at these keys to determine which blobs are genuinely lost from all blobstores, and fix up.
3. Error; these will need running through scrub again to determine what's broken.

Reviewed By: krallin

Differential Revision: D23574855

fbshipit-source-id: a613e93a38dc7c3465550963c3b1c757b7371a3b
2020-09-09 07:25:13 -07:00
Simon Farnsworth
aa2df38491 Improve errors on scrub failure
Summary:
With three blobstores in play, we have issues working out exactly what's wrong during a manual scrub. Make the error handling better:

1. Manual scrub adds the key as context for the failure.
2. Scrub error groups blobstores by content, so that you can see which blobstore is most likely to be wrong.

Reviewed By: ahornby, krallin

Differential Revision: D23565906

fbshipit-source-id: a199e9f08c41b8e967d418bc4bc09cb586bbb94b
2020-09-09 07:25:13 -07:00