Commit Graph

1745 Commits

Author SHA1 Message Date
Jun Wu
677097aca1 dag: add a more complex test about pull fast path
Summary: The test pulls when the client has a lazy graph, and the server has a few merges.

Reviewed By: andll

Differential Revision: D29363806

fbshipit-source-id: 09bc3c4c3d21924f500ca86e8d86f58a15159169
2021-06-24 16:20:14 -07:00
Jun Wu
16796c9fb5 dag: add TestDag::debug_segments
Summary:
`fmt::Debug` for a NameDag is too verbose. Separate part of it so we can debug
print segments for a given (group, level).  This will be used by upcoming
changes.

Reviewed By: andll

Differential Revision: D29363805

fbshipit-source-id: e1c6713be10b8b64fc7a42178117e724e0d691d0
2021-06-24 16:20:14 -07:00
Victoria Tsai
ad9e1b0d4b Fix rust lint errors
Summary: unused import and unused variable

Differential Revision: D29365367

fbshipit-source-id: 39d625eba232deeb8e70e8ba11c6043b4ea60122
2021-06-24 15:54:45 -07:00
Jun Wu
73ab6e9e6f dag: ensure TestDag::pull updates client's remote
Summary:
The client TestDag might have outdated server Dag as the remote protocol,
because it is a static "snapshot". Ensure the remote Dag is updated when
using the pull API.

This is an issue solved by tracking down issues in tests added in upcoming
diffs.

Reviewed By: andll

Differential Revision: D29363807

fbshipit-source-id: a560b2e91999873338604907a6d83cc7d2ff5c58
2021-06-24 15:12:58 -07:00
Jun Wu
27f864cc5b dag: extract TestDag::set_remote from client
Summary: It will be used by the next change.

Reviewed By: andll

Differential Revision: D29363802

fbshipit-source-id: 842735ac05ea5fea4ea0c3625a68d06d27bc37d5
2021-06-24 15:12:58 -07:00
Jun Wu
c908ead7fa dag: add TestDag::drawdag_async
Summary:
It is useful when drawdag itself triggers remote fetches.

This was used but is not used after some refactoring. I think it might be useful
in the future so kept it.

Reviewed By: andll

Differential Revision: D29363803

fbshipit-source-id: fa178ac9783d1dc1b73525eeb8cd3d766cf46a0f
2021-06-24 15:12:58 -07:00
Jun Wu
63619fd27b dag: add test about pull checking overlapped vertexes
Summary: The test will be used to verify upcoming changes.

Reviewed By: andll

Differential Revision: D29363809

fbshipit-source-id: d34d13123914cfabb5c82dee3873b6e0c4979ee2
2021-06-24 15:12:58 -07:00
Jun Wu
367ce3dbc3 dag: add TestDag::pull_ff_master
Summary: Make it easier to write more tests around pull.

Reviewed By: andll

Differential Revision: D29363804

fbshipit-source-id: 5b2cf8675343898fabc1d8845228e240e463edf8
2021-06-24 15:12:58 -07:00
Jun Wu
d3b87c6861 indexedlog: resolve a warning
Summary: Follow up of D29035913 (63884d65c1).

Reviewed By: singhsrb

Differential Revision: D29363811

fbshipit-source-id: 1147b5e28f73bf893c30f3bea5a617fc116885bf
2021-06-24 15:12:58 -07:00
Jun Wu
e396cab669 dag: include roots in pull data
Summary:
The roots data will be useful for the client to check if the pulled commits are
going to overlap with its existed DAG.

Reviewed By: andll

Differential Revision: D29363808

fbshipit-source-id: e09d924d65537f59fd4ea209b568265d07a80e46
2021-06-24 15:12:58 -07:00
Jun Wu
21e2bdd709 dag: sever => server
Summary: Minor spelling fix.

Reviewed By: andll

Differential Revision: D29363812

fbshipit-source-id: 58393ddac058e1e63182aa5bc4a85e5dcf04c599
2021-06-24 15:00:35 -07:00
Jun Wu
f8af66d7d2 dag: x..y+1 => x..=y
Summary: Minor change to make the code a little bit more straightforward.

Reviewed By: andll

Differential Revision: D29363801

fbshipit-source-id: 2c4bd6ece07282f044622227a3c077cb31db6d17
2021-06-24 15:00:35 -07:00
Jun Wu
77e8dcc21d dag: minor updates on iddag docstring
Summary: Make the docstring a bit more consistent.

Reviewed By: andll

Differential Revision: D29363798

fbshipit-source-id: 1b4e2a7a1af4c4cffe3693e437a831bab1b43fd7
2021-06-24 15:00:35 -07:00
Andrey Chursin
568237d11c eden_api: implementation for pull_fast_forward_master client request
Reviewed By: quark-zju

Differential Revision: D29342432

fbshipit-source-id: 1a371e707b2e75b155f5abdc343bfb42ba53df5a
2021-06-24 13:58:02 -07:00
Andrey Chursin
49bd00fe2c types: introduce fast forward pull wire types
Reviewed By: quark-zju

Differential Revision: D29342139

fbshipit-source-id: 848eceaf5d4a7e88e9830155c0763321ea275c82
2021-06-24 13:58:02 -07:00
Meyer Jacobs
bbe46dcf06 scmstore: avoid empty remote requests in TreeStore
Summary: Verify we actually have pending keys to fetch before attempting a remote request in scmstore TreeStore.

Reviewed By: kulshrax

Differential Revision: D29345214

fbshipit-source-id: 328bdcbc41429e59de6ceb488533bafa97518fcc
2021-06-23 19:27:26 -07:00
Arun Kulshreshtha
7ffa37c5e9 pyedenapi: use block_unless_interrupted instead of block_on_future
Summary: Previously, it was not possible to interrupt `hg` during EdenAPI fetch operations. This made it impossible to interrupt long-running fetches, which is very frustating to users. This can be simply fixed by using `block_unless_interrupted` in place of `block_on`.

Reviewed By: quark-zju

Differential Revision: D29344670

fbshipit-source-id: 3b0d36dda28f5f7cc812a07981f295f8d0fbdd8a
2021-06-23 19:01:22 -07:00
Andrey Chursin
fc47068389 debugsementpull: introduce debug command to pull using segmented chanelog
Summary:
This is simple command mostly to be used by testing before we fully integrate with hg pull

This command does not perform discovery and requires from/to revision to be passed in cmd line

Reviewed By: quark-zju

Differential Revision: D29315647

fbshipit-source-id: 26d67031e566b7c99af1e2a5ab287f02b52f7db0
2021-06-23 17:58:26 -07:00
Xavier Deguillard
27b55303ee Back out "Enable fb dynamicconfig loading inside eden backingstore"
Summary: This is breaking the Windows release, reverting.

Reviewed By: fanzeyi

Differential Revision: D29339787

fbshipit-source-id: 22d8ff5db5619194e4597754dc37343cf0bc3286
2021-06-23 16:45:43 -07:00
Meyer Jacobs
640767d414 scmstore: track contentstore fallbacks
Summary:
Introduce basic contentstore fallback tracking to help monitor the scmstore shim rollout.

This will be expanded to a general fetch metrics system for scmstore in a future change.

Reviewed By: kulshrax

Differential Revision: D29305839

fbshipit-source-id: c6cc3ea15a3bb7b90f4ec298febc911ec4e2af91
2021-06-23 15:26:26 -07:00
Andrey Chursin
7f54775d00 dag: tests for pull protocol
Reviewed By: quark-zju

Differential Revision: D29177851

fbshipit-source-id: 8c2b35306cc68d9c4d18449fd80e5504bd650031
2021-06-22 18:14:41 -07:00
Andrey Chursin
8c12f1f786 dag: implementation for import_pull_data
Reviewed By: quark-zju

Differential Revision: D29147359

fbshipit-source-id: 0508b48656fda99f37e9e3377a6ac08149bc1dcf
2021-06-22 18:14:41 -07:00
Meyer Jacobs
015f5864d2 scmstore: fix deadlock in write
Summary:
Prevent `FileStore` from deadlocking when a write falls back to contentstore and attempts to write to the same indexedlog_local which is held lock for the batch.

Note: this shouldn't need to block release, we current expect writing raw LFS pointers to only happen with non-remotefilelog LFS.

Reviewed By: kulshrax

Differential Revision: D29299050

fbshipit-source-id: bf39f87b9956165a558f3a19960d3d055685db9a
2021-06-22 13:14:58 -07:00
Andres Suarez
fc37fea20c Update itertools 0.8.2 to 0.10.1
Reviewed By: dtolnay

Differential Revision: D29286012

fbshipit-source-id: 6923c0b750692e6932e85fd539b076b172ff43b7
2021-06-22 04:09:00 -07:00
Jan Mazur
5830589a71 Enable fb dynamicconfig loading inside eden backingstore
Summary: Enable fb dynamicconfig loading inside eden backingstore

Reviewed By: fanzeyi, xavierd

Differential Revision: D29212009

fbshipit-source-id: 79f3ab1a5764101c37dcf3e4676c0c0394d88d40
2021-06-22 02:17:32 -07:00
Meyer Jacobs
c891c84967 scmstore: introduce LegacyStore trait for scmstore shim
Summary:
Introduce `LegacyStore` trait, which contains ContentStore methods not covered by other datastore traits.

Implement this trait for both contentstore and scmstore, and modify rust code which consumes `contentstore` directly to use `PyObject` and `LegacyStore` to abstract over both contentstore and scmstore instead.

Reviewed By: DurhamG

Differential Revision: D29043162

fbshipit-source-id: 26e10b23efc423265d47a8a13b25f223dbaef25c
2021-06-18 17:39:53 -07:00
Meyer Jacobs
7db0302cd8 scmstore: correctly propagate errors back to Python
Summary: Previously, we just fetched "best effort", and logged any encountered errors using `tracing`, leaving it up to the client to inspect errors if necessary. Python relies on catching these fetch errors as exceptions, though, so this change introduces some utility methods to help propagate them correctly.

Reviewed By: DurhamG

Differential Revision: D29211683

fbshipit-source-id: 5e9dee942c2b60e0f77a051624d7f393a811fc4e
2021-06-18 17:39:52 -07:00
Meyer Jacobs
5b1a16077f scmstore: actually fix undesired file logging
Summary: My previous fix was actually incorrect, we now log actual remote requests, but join that with the logs from the contentstore fallback.

Reviewed By: DurhamG

Differential Revision: D29206878

fbshipit-source-id: d22e58792bf380c274e8086ce08aebe20dd9b848
2021-06-18 17:39:52 -07:00
Meyer Jacobs
ee67634fbf scmstore: gate contentstore fallback behind config
Summary: Introduce a config option to enable or disable contentstore fallback in scmstore.

Reviewed By: DurhamG

Differential Revision: D29206846

fbshipit-source-id: 58e339a8f0f7b8fa98baa53b99ef25b18a066299
2021-06-18 17:39:52 -07:00
Arun Kulshreshtha
fff9086983 edenapi: don't wait for headers from all responses before yielding entries
Summary:
Previously, when fetching data using several concurrent requests, the EdenAPI client would wait for the headers for every request to finish coming in before starting to deserialize and yield entries from the bodies of any of the requests.

Normally, this isn't a huge deal since the response headers on all of the requests are usually roughly the same size, so they all finish downloading at roughly the same time when the requests are run concurrently. However, this does become an issue when `edenapi.maxrequests` is set. This option makes EdenAPI configure libcurl to queue outgoing connections once the configured limit is hit.

This means that although from EdenAPI's perspective all of the requests are running concurrently, they are not actually running in parallel. The result is that the EdenAPI client ends up waiting for all of the queued requests to be sent before yielding any data to the caller, which forces it to buffer all of the received data, resulting in massive memory consumption.

This diff fixes the problem by rearranging the structure of the Futures/Streams involved such that the client immediately begins yielding entries when they are received from any of the underlying transfers.

Reviewed By: quark-zju

Differential Revision: D29204196

fbshipit-source-id: b6b56bb7d60457de3c4046a07a5965749e9dd371
2021-06-18 15:23:25 -07:00
Arun Kulshreshtha
ca8200e9df http-client: make send_async return a Vec of Futures instead of a Stream
Summary:
When the `send_async` method is used to dispatch multiple concurrent requests, the method needs to return an `AsyncResponse` for each request. Since `AsyncResponse`'s constructor is itself `async` (it waits for all of the headers to be received), internally the method ends up with a collection of `AsyncResponse` futures.

Previously, in an attempt to simplify the API, the method would insert all of these futures into a `FuturesUnordered`, thereby conceptually returning a `Stream` of `AsyncResponses`. Unfortunately, this API ends up making it harder to consume the resulting `AsyncResponses` concurrently, as one might want to do when streaming lots of data over several concurrent requests.

This diff changes the API to just insert the `AsyncResponse` futures into a `Vec` to allow the caller to use them as desired. To maintain compatibility with the old behavior for the sake of this diff, the one current callsite has been updated to just dump the returned `Vec` into a `FuturesUnordered`. This will be changed later in the stack.

Reviewed By: quark-zju

Differential Revision: D29204195

fbshipit-source-id: ecee8cff430badd8213c2efef62fc68fbd91fde9
2021-06-18 15:23:25 -07:00
Arun Kulshreshtha
2a13b62754 edenapi: remove metadata from Fetch<T>
Summary: Nothing was using this metadata, and removing it simplifies the subsequent diffs in this stack.

Reviewed By: quark-zju

Differential Revision: D29147228

fbshipit-source-id: aa4828b710c3ef719f4d66adec5f66cd5b7d05d1
2021-06-18 15:23:25 -07:00
Thomas Orozco
97c598ac82 fixup build after os_info crate update
Summary:
This dep got updated in D29165283 (b82c5672fc) across a major version but the code depending
on it wasn't so now it's broken.

Reviewed By: mitrandir77

Differential Revision: D29229087

fbshipit-source-id: 5f2a14dd9f0447dd4578e8321991dfb3df32dcc2
2021-06-18 07:06:14 -07:00
Davide Cavalca
b82c5672fc Update several rust crate versions
Summary: Update versions for several of the crates we depend on.

Reviewed By: danobi

Differential Revision: D29165283

fbshipit-source-id: baaa9fa106b7dad000f93d2eefa95867ac46e5a1
2021-06-17 16:38:19 -07:00
Liubov Dmitrieva
1b818d114d add an option to pass some metadata in the token
Summary:
add an option to pass some metadata in the token

This will be used for content tokens, for example. We would like to guarantee that the specific content has been uploaded and it had the specific length. This will be used for hg filenodes upload.

Reviewed By: markbt

Differential Revision: D29136295

fbshipit-source-id: 2fbd3917ee0a55f43216351fdbc1a6686eb80176
2021-06-17 08:22:33 -07:00
Liubov Dmitrieva
98f863b323 use commitknown api for checking existing commits
Summary:
use `commitknown` edenapi api for checking the existing commits

it uses the same `lookup_commits` under the hood but a bit shorter to use

we won't need the tokens for existing changesets, so can use a simpler api

also, make `lookupfilenodes` function a bit shorter

Reviewed By: markbt

Differential Revision: D29134677

fbshipit-source-id: 257624d64480102c34761560b2bd768049cbfa83
2021-06-17 08:22:33 -07:00
Andrey Chursin
11f0f9152d dag: separate out AbstractNameDag::{verify_missing, reload, persist}
Summary: They will be reused in import_pull_data

Reviewed By: quark-zju

Differential Revision: D29147950

fbshipit-source-id: 192bf33c30067f43c4fcaaf3054741b39efb4e25
2021-06-16 11:07:50 -07:00
Andrey Chursin
2de68ff1fd dag: introduce DagImportPullData
Summary: This is an interface for importing pull data into dag

Reviewed By: quark-zju

Differential Revision: D29142979

fbshipit-source-id: b40b94403a044c0b74d1574528aa374ec309a0cf
2021-06-16 11:07:50 -07:00
Andrey Chursin
2d76e5ce61 commits: introduce AppendCommits::import_pull_data
Summary: This will be used to import pull data into segmented changelog

Reviewed By: quark-zju

Differential Revision: D29142981

fbshipit-source-id: 2d19a035ee0b6cefef8fc0547a5dfb79f284a1de
2021-06-16 11:07:49 -07:00
Andres Suarez
0f273c5ded update globset from 0.4.5 to 0.4.7
Summary:
The only real change here is: https://github.com/BurntSushi/ripgrep/pull/1756
This is a patch release but fixes a very glaring bug that others have
depended on. This diff fixes the uses to match the old behavior.

Although it's billed as a "fix", it's actually a huge perf improvement
for Linttool, which uses predominantly recursive suffix globs. The fact
that we don't have to compile ~5,000 regexps at Linttool startup anymore
makes such a huge difference that I am going to do write up soon.

Reviewed By: ndmitchell

Differential Revision: D29085977

fbshipit-source-id: 304470e5fa8cb986738aa0d9dd941641684a9194
2021-06-15 15:47:49 -07:00
Andrey Chursin
c8d63eff2f async: replace block_on_future with block_on
Summary:
For a while we had two methods in async runtime: block_on_future and block_on_exclusive, due to historic reasons

Recently those methods were calling same code, and now it is time to replace both of them and rename to block_on

Reviewed By: quark-zju

Differential Revision: D29121107

fbshipit-source-id: 5faa76ae181e491b55d799c23c9de1b4e80298f3
2021-06-15 14:08:13 -07:00
Jun Wu
be06ac3ada hgcommands: add debugdumpdynamicconfig for no-repo use-cases
Summary:
The added command gives access to read (execute) dynamicconfig without
using an on-disk repo.

It can be used by the clone script to stage rollout lazy changelog, or just to
verify dynamic config changes without using a repo.

Reviewed By: DurhamG

Differential Revision: D29123072

fbshipit-source-id: e8856d816a636fa860bfcc9694306a4a37552523
2021-06-15 10:48:01 -07:00
Liubov Dmitrieva
99a2b85f1a upload file content
Summary:
implement uploading file content via Eden API

* in this diff I aim to upload file content for the given set of filenodes
* also, the code would check with Mononoke using the lookup request what is already there and skip those
* also, this diff introduces calculation of blake2 hash (called ContentId) for file contents (we would probably need to store/cache those and the mapping from hg filenode id to the canonical Mononoke content_id)
* for every uploaded content EdenApi returns a token that we would also need to store later

Reviewed By: markbt

Differential Revision: D29063229

fbshipit-source-id: 739a44bc3ff904cb04a39514ba5efd01c80ba6d0
2021-06-15 08:09:00 -07:00
Andrey Chursin
3cf926bcfe eagerepo: impl pull_fast_forward_master for EagerRepo
Reviewed By: quark-zju

Differential Revision: D29113217

fbshipit-source-id: f7c84d450b6c029c251474bfe1be86767979a78b
2021-06-14 21:11:15 -07:00
Andrey Chursin
6e4d6a5671 dag: pull_fast_forward_master implementation for AbstractNameDag
Summary: This will be used in eager repo integration tests

Reviewed By: quark-zju

Differential Revision: D29113218

fbshipit-source-id: a24232bd6c19010d8ac90d1305f57f1094b06323
2021-06-14 21:11:15 -07:00
Jun Wu
ac6c6cf3fa mutationstore: avoid excessive server lookups for lazy dag
Summary:
The mutationstore might contain lots of names (commit hashes) that are unknown
to the repo. When using a lazy changelog, by default, those names will be
looked up remotely, and most of the time the server just returns "name is outside
the graph".

We don't have negative cache to speed it up, because cache invalidation is
tricky - every lazy pull would in theory invalidate them.

To make things faster, let's just skip names in the mutationstore that are unknown
_locally_ without asking the server.

In theory this might affect correctness. Practically, this should only affect "landed as" markers,
because all drafts should be non-lazy. If the "landed as" correctness is an issue, we can fix
forward "landed as" later (ex. by writing down the public commit hash explicitly in
debugmarklanded).

Reviewed By: andll

Differential Revision: D29111710

fbshipit-source-id: 2c1b16a8140ca4f7195bf1206ffe1db4750185b9
2021-06-14 16:00:58 -07:00
Jun Wu
1e2b3cf87a configmodel: impl Config on BTreeMap<String, String>
Summary: This allows BTreeMap to be used as a provide of config for testing.

Reviewed By: andll

Differential Revision: D28019023

fbshipit-source-id: 94a1585139d6c6612fa163f2ff1aecc909db3a72
2021-06-13 09:19:22 -07:00
Pedro Rittner
b91da1d115 Bump crossbeam from 0.7 to 0.8, lsp from 0.3 to 0.5, lsp-types from 0.73 to 0.89
Summary: Bumping the crossbeam version so we can use `recv_deadline`. This also necessitates updating the lsp and lsp-types crates.

Reviewed By: alunyov, dtolnay

Differential Revision: D29056473

fbshipit-source-id: 9434e9e0895d82482f4c70afa01a2f77702b965f
2021-06-11 21:57:21 -07:00
Meyer Jacobs
8e79a2ce47 scmstore: add support for writing LFS pointers directly via FileStore
Summary:
This functionality is exercised in `test-lfs-copytracing.t` and a few other tests, though I'm not sure if it's necessary outside of that. I've added a `TODO` to investigate and try to eliminate such cases.

Because we'd rather not support this, I implemented it on top of ContentStore - it looks like we might have some lingering datapack-related tests where I think this comes up, too.

Reviewed By: DurhamG

Differential Revision: D29056647

fbshipit-source-id: e6bd5ec31dde06d8c509665f738cfe19270ddc76
2021-06-11 18:53:11 -07:00
Meyer Jacobs
41bc3699f8 scmstore: implement LFS upload for FileStore via legacy codepath
Summary: Temporarily implement `upload` on `FileStore` by forwarding to the existing `upload` implementation using `LfsRemote`. Eventually we'll want to re-implement this entirely inside `FileStore`.

Reviewed By: DurhamG

Differential Revision: D29045264

fbshipit-source-id: 8ebbaead4c1032949e5bdd1dcf9a733d0086a77c
2021-06-11 18:53:11 -07:00