Commit Graph

57767 Commits

Author SHA1 Message Date
Arun Kulshreshtha
4af81d590e edenapi_server: add trees endpoint
Summary: Add an endpoint that serves trees. Uses the same underlying logic as the files endpoint, and returns the requested nodes in a CBOR DataResponse.

Reviewed By: krallin

Differential Revision: D21412987

fbshipit-source-id: a9bcc169644a5889c3118a3207130228a5246b2f
2020-05-12 16:26:20 -07:00
Arun Kulshreshtha
40928f027c make_req: take array instead of object as input for data requests
Summary: Change `make_req` to take a JSON array as input when constructing `DataRequest`s instead of a JSON object. This is more correct because DataRequests can include multiple `Key`s with the same path; this cannot be represented as an object since an object is effectively a hash map wherein we would have duplicate keys.

Reviewed By: quark-zju

Differential Revision: D21412989

fbshipit-source-id: 07a092a15372d86f3198bea2aa07b973b1a8449d
2020-05-12 16:26:20 -07:00
Arun Kulshreshtha
b3fe7c5a3a edenapi_server: make data fetching code generic
Summary: EdenAPI data responses can contain data for either files or trees. As such, the implementation of both the files and trees endpoints is almost identical. To allow the logic to be shared between both, this diff makes the handler code generic.

Reviewed By: krallin

Differential Revision: D21412986

fbshipit-source-id: 89501915b0401214b373ed1db2eb09e59de2e5b7
2020-05-12 16:26:20 -07:00
Arun Kulshreshtha
2fcf4c4901 mononoke_api: add HgDataContext and HgDataId traits
Summary: In order to allow writing code that is generic over files and trees, move the functionality common between the two to a separate trait. This will allow for a significant amount of code sharing in the EdenAPI server. (This diff does not introduce any new functionality; it's mostly just moving existing code into the new traits.)

Reviewed By: krallin

Differential Revision: D21412988

fbshipit-source-id: 31b55904f62ccb965b0f9425de875fc069e10b5a
2020-05-12 16:26:19 -07:00
Arun Kulshreshtha
955a057e8f edenapi_server: add files endpoint
Summary:
Add an endpoint that serves Mercurial file data.

The data for all files involved is fetched concurrently from Mononoke's backend but in this initial version the results are first buffered in memory before the response is returned; I plan to change this to stream the results in a later diff.

For now this version demonstrates the basic functionality as well as things like ACL enforcement (a valid client identity header with appropriate access permissions must be present for requests to succeed).

Reviewed By: krallin

Differential Revision: D21330777

fbshipit-source-id: c02a70dff1f646d02d75b9fc50c19e79ad2823e6
2020-05-12 16:26:19 -07:00
Genevieve Helsel
234383d086 remove version check from redirect fixup
Summary: Nothing should be running with this version, so this check is not needed anymore!

Reviewed By: chadaustin, wez

Differential Revision: D21513269

fbshipit-source-id: 698c9d84e87461cd0484ef997f44dc9169e87a25
2020-05-12 15:43:31 -07:00
svcscm
11f55ea8be Updating submodules
Summary:
GitHub commits:

5a74dde371
07cfe45cd9
71650d5d67
2b81847227
8ed576f96b
8a4ba8a17f
f30ca63d3b
20021f0396
67355d562e
2f0b01b165

Reviewed By: zpao

fbshipit-source-id: 04350da1e88206c9029aee4c1da9393d75cbbac8
2020-05-12 14:58:20 -07:00
Xavier Deguillard
9ffc383307 mount: enable registerStats for Windows
Summary:
While not all stats are supported on Windows, most of them can, let's enable
them. This is a first step in unifying the mount path for Windows and Unices.

Reviewed By: chadaustin

Differential Revision: D21514732

fbshipit-source-id: 00fd89b7499f8ae18c089f98bc18cd43f68538fa
2020-05-12 13:04:27 -07:00
svcscm
58060eb2e4 Updating submodules
Summary:
GitHub commits:

32ca978520
7c0d945b4b
659b3d2c8f
18d7d53dc9
c384c08a4f

Reviewed By: zpao

fbshipit-source-id: 700e5fec8ac6b26e506fed916b06d320f8be2ffc
2020-05-12 13:00:34 -07:00
Jun Wu
fe3bd0e090 tracing: replace blackbox.logblocked with tracing events
Summary: Migrate those "blocked" events from blackbox to tracing data.

Reviewed By: DurhamG

Differential Revision: D19797704

fbshipit-source-id: 401c1434e1d148956bb572d236d8998d59dfbf39
2020-05-12 10:48:43 -07:00
Jun Wu
dd1ee71afc tracing: write a few more events to tracing data
Summary:
Write commit cloud sync and clienttelemetry blackbox logs to tracing data.
Note: since metalog can answer head changes, I didn't add head changes of
commit cloud sync to the tracing data.

Reviewed By: DurhamG

Differential Revision: D19797700

fbshipit-source-id: b89924a7aa5e6027cad5c8138e8988f6b0ea4b2a
2020-05-12 10:48:43 -07:00
Jun Wu
cb9d8cde50 watchmanclient: write watchman commands to tracing data
Summary: This allows us to query tracing data for watchman commands.

Reviewed By: DurhamG

Differential Revision: D19797711

fbshipit-source-id: 4dfd50fff820da70888faa0fe8f53af25f205137
2020-05-12 10:48:42 -07:00
Jun Wu
1e64eb89b9 pull: skip listkeys bookmarks using the modern pull API
Summary:
The repo.pull API updates remote bookmarks on its own. Therefore do not even
ask the server to listkey (all) bookmarks.

This also removes the need of listkeys(bookmarks) for the new clone API.

Reviewed By: DurhamG

Differential Revision: D21011393

fbshipit-source-id: b10bdbc82563c32626bdcb2632170fd56819e904
2020-05-12 10:23:24 -07:00
Jun Wu
1863edef57 remotenames: disable exclone if core clone.streamclone is used
Summary:
The core `clone.streamclone` is the new clean way to do a streaming clone with
selectivepull. Detect the use of it and skip remotenames' own exclone logic.

Reviewed By: DurhamG

Differential Revision: D21011396

fbshipit-source-id: 50fdbf4c2761a96c50e23f21a87ef636fac74afb
2020-05-12 10:23:24 -07:00
Jun Wu
219554305e clone: add a new clone function with less tech-debt
Summary:
The current `clone --shallow` command has some issues:
- It fetches *all* remote bookmarks, since selectivepull does not work with
  streamclone, then remove most remote bookmarks in a second transaction.
- It goes through remotenames, which is racy, and D20703268 does not fix the
  clone case. Possible cause of T65349853.
- Too many wrappers (ex. in remotefilelog, remotenames, fastdiscovery) wtih
  many configurations (ex. narrow-heads on/off) makes it hard to reason about.

Instead of bandaidding the clone function, this diff adds a new clone implementation
that aims to solve the issues:
- Use streamclone, but do not pull all remote names.
- Pull selectivepull names explicitly with a working "discovery" strategy
  (repo heads should be non-empty with narrow-heads on or off).
- Do clone in one transaction. Outside world won't see an incomplete state.
- Use `repo.pull` API, which is not subject to race conditions.
- Eventually, this might be the only supported "clone" after Mononoke becoming
  the single source of truth.

Note: the code path still goes through bookmarks.py and remotenames.py.
They will be cleaned up in upcoming diffs.

Reviewed By: DurhamG

Differential Revision: D21011401

fbshipit-source-id: d8751ac9bd643e9661e58c87b683be285f0dc925
2020-05-12 10:23:23 -07:00
Jun Wu
1535e0774e changelog: expose rawheadrevs() API
Summary:
In the past we hide the revlog headrevs API with the idea that calculating
heads in the DAG is not going to scale, and heads should be based on references
(remotenames, visible heads). Practically calculating heads in the DAG based
on segmented changelog is not going to be painfully slow so we probably can
afford it.

Therefore let's just re-expose the DAG-based heads API as rawheads. The only
user of it is in dagutil.py.

This will be used in the next diff where streamclone first gets the revlog
changelog copied without remote bookmarks. Then it needs to do a pull
which requires the heads information.

Reviewed By: DurhamG

Differential Revision: D21296530

fbshipit-source-id: a81a61e3b58c921a3390fda8f716bd7ae0e55ed1
2020-05-12 10:23:23 -07:00
Jun Wu
b8f65b13ab clone: write repo hgrc early
Summary:
Move the logic to write repo hgrc ([paths]) and set [paths] config options
earlier, so other logic can use the [paths] config.

Some tests are changed because remotenames can now write bookmarks in more
cases.

Reviewed By: DurhamG

Differential Revision: D21011397

fbshipit-source-id: 4b921a02c20daeef31d44a03264a89b975303aa5
2020-05-12 10:23:22 -07:00
Jun Wu
d175b5c489 hggit: use transaction name to test initial clone
Summary:
"[paths] being empty" will no longer be a way to test initial clone, use
transaction name instead.

Reviewed By: DurhamG

Differential Revision: D21011395

fbshipit-source-id: e257fe8eb2efd45ac52fad7c74363151b0a8c417
2020-05-12 10:23:22 -07:00
Jun Wu
63872cfbae transaction: make transaction name available on transaction object
Summary: This will be used by hg-git to test initial clone.

Reviewed By: DurhamG

Differential Revision: D21011400

fbshipit-source-id: 11a1a41631830273a6407e419ebe5ff21964e7de
2020-05-12 10:23:22 -07:00
Jun Wu
192467dd38 clone: remove share.pool support
Summary: It is not used and makes the already complicated clone logic more complicated.

Reviewed By: DurhamG

Differential Revision: D21011394

fbshipit-source-id: 3620f7372a9f3cefc60618052c768c6c2cbe04f9
2020-05-12 10:23:21 -07:00
Jun Wu
96ebdf59ce remotefilelog: move stream_out wireprotocol to core
Reviewed By: DurhamG

Differential Revision: D21011398

fbshipit-source-id: c47307d06517e145837854db8e6bbec97b17e6bd
2020-05-12 10:23:21 -07:00
Jun Wu
a515f86575 remotefilelog: remove includepattern and excludepattern in wireproto
Summary:
They are not used. Remove it to make it a bit easier to move stream_out_shallow
to core.

Note: this does not remove all include/excludepatterns yet.

Reviewed By: DurhamG

Differential Revision: D21011403

fbshipit-source-id: f6d27a3e2472f6c69f95a958ac99f75a8b8f8b74
2020-05-12 10:23:21 -07:00
Jun Wu
76643816b3 remotefilelog: move "--shallow" command-line flag to core
Summary: It will be used in the next change.

Reviewed By: DurhamG

Differential Revision: D21011399

fbshipit-source-id: 6bdffc79af0474e42562686109417882a8cb2cd6
2020-05-12 10:23:20 -07:00
Xavier Deguillard
ea98578570 model: report symlink/executable as regular files on Windows
Summary:
While this isn't the right fix, this is what shipped in our packages, for the
sake of being able to reproduce the package, let's land this as it is. A
future change will remove this ifdef.

Below is pkaush original description:
In Eden Windows we treat all the files as regular files and don't have a
concept of symlinks and executable files. Fixing the TreeEntryType::getType()
to return REGULAR_FILE for executable file and symlink.

Reviewed By: wez

Differential Revision: D20481051

fbshipit-source-id: 0b0c4d7aea28134383ef45aeafc02930b420286b
2020-05-12 08:46:35 -07:00
Thomas Orozco
72b949340f mononoke: pretty-print root-cause
Summary:
Right now, we debug-print the root cause and pretty-print everything else. This
is pretty bad because the root cause is usually the one thing we would want to
pretty print so we can add instructions there (such as "your hooks failed, fix
it").

This fixes this so we stop pretty-printing the root cause, but also debug print
the whole error, which gives us more developer-friendly context and is easier
for automation to match on.

This is actually in common/rust ... but we're the only people using it AFAICT.

Reviewed By: StanislavGlebik

Differential Revision: D21522518

fbshipit-source-id: 10158811574b56024e14852229e4541da19d5609
2020-05-12 07:59:42 -07:00
Mark Thomas
428ba0b5f8 commitcloud: add hg cloud hide command to remove things from cloud workspaces
Summary:
Add the `hg cloud hide` command.  This allows removal of commits, bookmarks and
remote bookmarks from a cloud workspace, even when the items are omitted
locally.

Reviewed By: DurhamG, quark-zju

Differential Revision: D21409384

fbshipit-source-id: 24b64c207c78f9b0258e9cf6a578db7b14c84901
2020-05-12 07:56:50 -07:00
Thomas Orozco
6ac0c26e06 mononoke/context_concurrency_blobstore: use rate limit instead of semaphore
Summary:
Limits on concurrent calls are a bit hard to reason about, and it's not super
obvious what a good limit when all our underlying limits are expressed in QPS
(and when our data sets don't have peak concurrency - instead they have
completion time + # blob accesses).

Considering our past experience with ThrottledBlob has been quite positive
overall, I'd like to just use the same approach in ContextConcurrencyBlobstore.
To be safe, I've also updated this to be driven by tunables, which make it
easier to rollout and rollback.

Note that I removed `Debug` on `CoreContext` as part of this because it wasn't
used anywhere. We can bring back a meaningful implementation of `Debug` there
in the future if we want to. That triggered some warnings about unused fields,
which for now I just silenced.

Reviewed By: farnz

Differential Revision: D21449405

fbshipit-source-id: 5ca843694607888653a75067a4396b36e572f070
2020-05-12 06:49:25 -07:00
Thomas Orozco
140607ce1f mononoke/async_limiter: make AsyncLimiter::new async
Summary:
The motivation for making this function async is that it needs to spawn things,
so it should only ever execute while polled by an executor. If we don't do
this, then it can panic if there is no executor, which is annoying.

I've been wanting to do this for a while but hadn't done it because it required
refactoring a lot of things (see the rest of this stack). But, now, it's done.

Reviewed By: mitrandir77

Differential Revision: D21427348

fbshipit-source-id: bad077b90bcf893f38b90e5c470538d2781c51e9
2020-05-12 06:49:25 -07:00
Thomas Orozco
f9d8000c82 mononoke/blobrepo/factory: convert this to async await
Summary:
This updates our blobrepo factory code to async / await. The underlying
motivation is to make this easier to modify. I've ran into this a few times
now, and I'm sure others have to, so I think it's time.

In doing so, I've simplified the code a little bit to stop passing futures
around when values will do. This makes the code a bit more sequential, but
considering none of those futures were eager in any way, it shouldn't really
make any difference.

Reviewed By: markbt

Differential Revision: D21427290

fbshipit-source-id: e70500b6421a95895247109cec75ca7fde317169
2020-05-12 06:49:25 -07:00
Thomas Orozco
01db12a1b2 mononoke/repo_listener: convert request_handler to an async fn
Summary:
I'd like to add some async fns to session creation. The motivation is that I
want to instantiate an AsyncRateLimiter there, and that requires an async
context because it needs to spawn on the Tokio runtime, and the best way to
enforce this is to just make the function async.

Reviewed By: StanislavGlebik

Differential Revision: D21427291

fbshipit-source-id: 75b0d41b62a77ade3d624e24adc57a938b722d9c
2020-05-12 06:49:25 -07:00
Thomas Orozco
4408577028 mononoke: improve reporting of case conflicts
Summary:
At least let's tell the use what to do about the problem and, where we can,
what the conflicting file was (see the attached task).

Reviewed By: farnz

Differential Revision: D21459412

fbshipit-source-id: 52b90cf7d41ebe6550083c6673b4e93b10edf5e2
2020-05-12 06:44:39 -07:00
Thomas Orozco
3d9d4e0a13 mononoke/blobrepo: asyncify check_case_conflicts
Summary:
I initially wanted to modify this and it'll be easier to do so if it's
async-await. While in there, add tests and update the code to bail early if any
conflict is hit.

In writing the tests, I noted that the code that we need is already there and
his does work as expected, so I'm not actually going to modify this more, but
it's probably stil worth it to land the tests.

Reviewed By: StanislavGlebik

Differential Revision: D21457899

fbshipit-source-id: 91350962fa2d96a88e4595d1ae47ef7678dad8cb
2020-05-12 06:44:38 -07:00
Thomas Orozco
58abcc937a mononoke/blobrepo: repo_commit: update old future type names
Summary: I'm going to asyncify some things here. Let's start with this.

Reviewed By: farnz

Differential Revision: D21451761

fbshipit-source-id: 64c78de4ab640b826a3ec1d6d84149d46f225024
2020-05-12 06:44:38 -07:00
Thomas Orozco
2d09c375dd mononoke: avoid un-necessarily cloning the list of files in a changeset
Summary: Doesn't hurt.

Reviewed By: farnz

Differential Revision: D21451317

fbshipit-source-id: 5d946732e1c53f1fa66a8958be9d79b24e6ca91d
2020-05-12 06:44:38 -07:00
Thomas Orozco
58dd2370bb mononoke/hooks: log hook rejections to Scuba
Summary:
Right now we're only logging hooks that outright fail, which isn't great. Let's
log rejections as well.

Reviewed By: johansglock

Differential Revision: D21522804

fbshipit-source-id: 6bfc6b12394099b04faa9d23f164b436935f9fb3
2020-05-12 06:12:36 -07:00
svcscm
3f42343487 Updating submodules
Summary:
GitHub commits:

f06288af92

Reviewed By: zpao

fbshipit-source-id: 32d312c6077a625cd5a82b71228365ea1c2f0ee2
2020-05-12 02:53:41 -07:00
Genevieve Helsel
12c5a2d221 doctor - fixup redirections
Summary: `eden doctor` should probably fix misconfigured redirections. this is mostly copy pasted from the `eden redirect fixup` command.

Reviewed By: wez

Differential Revision: D21487225

fbshipit-source-id: 69e7fcb446cbc42966cabb6d80ab716533da50a9
2020-05-11 22:13:06 -07:00
Durham Goode
20c3f8b34d scuba: round bytes to the nearest useful value
Summary: This will reduce the amount of space they take in scuba.

Reviewed By: xavierd

Differential Revision: D21483472

fbshipit-source-id: 9de49dedef480932f8583dd17fe6625d222a3285
2020-05-11 21:31:05 -07:00
svcscm
95f0b94031 Updating submodules
Summary:
GitHub commits:

129156f4ff

Reviewed By: zpao

fbshipit-source-id: a502d0767dc42466c66afbc9143eb50c618ed4c8
2020-05-11 21:20:10 -07:00
Alvaro Leiva Geisse
675b83557e add extra 2 extra type hints for systemd Manager
Summary: add two methods calls as typehints (no real code change).

Reviewed By: zeroxoneb

Differential Revision: D21337646

fbshipit-source-id: 8079883f7f989251965d3308c5374f097023b57a
2020-05-11 20:52:13 -07:00
svcscm
ad4c78031c Updating submodules
Summary:
GitHub commits:

825d7e2146
d33c823f0d
247c90a49e

Reviewed By: zpao

fbshipit-source-id: ba3a422976d12dbd798a597185985f7b70eb45ec
2020-05-11 20:52:12 -07:00
svcscm
bb300ac19e Updating submodules
Summary:
GitHub commits:

c0b5c0b084
efb57da2ba

Reviewed By: zpao

fbshipit-source-id: 4b5c66c9cd0efdefeb2bc90851a676f52986297a
2020-05-11 19:00:27 -07:00
Jun Wu
99d288c1bd fsmonitor: write fsmonitor walk events to tracing data
Summary: This allows us to query tracing data for fsmonitor walk events.

Reviewed By: DurhamG

Differential Revision: D19797709

fbshipit-source-id: 1ff76dd6122cf56787e7928711f604f9c3d571cc
2020-05-11 16:56:18 -07:00
Ellis Hoag
1d0d626a36 Pass config object down to repack
Summary:
Pass `configparser::config::ConfigSet` to `repack` in
`revisionstore/src/repack.rs` so that we can use various config values in `filter_incrementalpacks`.

* `repack.maxdatapacksize`, `repack.maxhistpacksize`
  * The overall max pack size
* `repack.sizelimit`
  * The size limit for any individual pack
* `repack.maxpacks`
  * The maximum number of packs we want to have after repack (overrides sizelimit)

Reviewed By: xavierd

Differential Revision: D21484836

fbshipit-source-id: 0407d50dfd69f23694fb736e729819b7285f480f
2020-05-11 16:41:30 -07:00
svcscm
d10bd02c87 Updating submodules
Summary:
GitHub commits:

d8ed7cd812
b3281fd99f
a07fd0febe
fe4c0d46e3
8e025a80a2
2e9324718a
9e0a38526c
16f1f53e1b
5b3b3ac872
3b16ae5126
ad939ea6a9
f513dc756a

Reviewed By: zpao

fbshipit-source-id: 1b3804afd513f1e429cae1411816c9e6166dfdf1
2020-05-11 16:41:29 -07:00
svcscm
3caffc114e Updating submodules
Summary:
GitHub commits:

34027c7b31
29cd269e7f
7c5727c8cc
7e79b25f93
e571d404dd
f2aa9bf7f5
f0e8731b72
22375a92ce
5e84ff4dc0
19d8cafbae
52d172d621
cdcedc50d9
20f413e15b
d8234440b2

Reviewed By: zpao

fbshipit-source-id: 991ae049c052c4d1f16d63aebbbed0d1528ca9d1
2020-05-11 13:39:38 -07:00
Stanislau Hlebik
20017e96fe hgsql: check sqlrepolock in memcommit
Summary:
Let's not allow proceeding with memcommit if repo is locked. This what normal
push flow does, so we should allow it here as well.

Reviewed By: markbt

Differential Revision: D21502435

fbshipit-source-id: 80e665f065fb0cd882bc99482769a3de01d3de30
2020-05-11 12:47:10 -07:00
Alex Hornby
0f8beabdb9 mononoke: walker: make WrappedPath available in stream output
Summary:
Make the repo path in Option<WrappedPath> available in stream output in preparation for using it in the corpus dumper to write to disk

The path is Option as not all nodes can have an associated file system path (e.g. BonsaiChangeset)

The headlines changes are in sampling.rs and sizing.rs.  The progress.rs change slightly generalises to allow any type convertible to NodeType as the main walk identifier in the output stream.

Some refactors done as part of this
* NodeSamplingHandler is renamed to  WalkSampleMapping to reflect this is what it stores.
* WalkSampleMapping generic parameters are extended to take both a key and a sample type
* NodeSamplingHandler::start_node() is moved to a new SampleTrigger::map_keys() type.  This is so that SamplingWalkVisitor doesn't need the full WalkSampleMapping generic parameters.

Reviewed By: krallin

Differential Revision: D20835662

fbshipit-source-id: 58db622dc63d7f869a092739d1187a34b77219f6
2020-05-11 12:00:59 -07:00
Alex Hornby
2222bd9f19 mononoke: make sampling blobstore handlers fallible
Summary: Make sampling blobstore handlers fallible in preparation for corpus dumper so we can know if writes to disk/directory creations failed.

Reviewed By: farnz

Differential Revision: D21168632

fbshipit-source-id: d25123435e8f54c75aaabfc72f5fa653e5cf573d
2020-05-11 12:00:59 -07:00
Alex Hornby
1c044613f8 mononoke: walker: filter the repo path by node type
Summary:
Not all node types can have a path associated

Reset the tracked path to None if the route is taking us through a node type that can't have a repo path.

Reviewed By: krallin

Differential Revision: D21228372

fbshipit-source-id: 2b1e291f09232500adce79c630d428f09cd2d2cc
2020-05-11 12:00:59 -07:00