Commit Graph

1765 Commits

Author SHA1 Message Date
Jun Wu
219bbde735 pager: add a way to not separate stderr in a separate pane
Summary:
See also D29400532 (909411bb1c). It turns out that it might be more desirable to just mix
stdout and stderr streams in streampager. For example, having them mixed then
the graph log output can show what network fetches or calculations are done
before outputting the graph lines. This is also more consistent with the
vanilla terminal (no pager) behavior.

Reviewed By: markbt

Differential Revision: D29412531

fbshipit-source-id: c07f68b12498a7cee6152bbecbb58d5a7e64097a
2021-06-28 07:43:20 -07:00
Meyer Jacobs
aba9741862 scmstore: eliminate specialized module
Summary: Move the scmstore implementation from the `specialized` module to the root of the `scmstore` module.

Reviewed By: kulshrax

Differential Revision: D29405779

fbshipit-source-id: ae2ef9cc05337a0ff81f5ba5b7051792207fee82
2021-06-25 21:05:24 -07:00
Meyer Jacobs
f4e636902c scmstore: delete legacy scmstore
Summary: `scmstore` is dead, long live `scmstore`.

Reviewed By: kulshrax

Differential Revision: D29405613

fbshipit-source-id: 3252a545f5b944d14c15b2a777b84a99a2d4c293
2021-06-25 21:05:24 -07:00
Meyer Jacobs
058ac5b63a scmstore: update indexedlogdatastore scmstore tests to use new scmstore
Summary: Update unit tests in `revisionstore::indexedlogdatastore` to use new scmstore instead of old scmstore.

Reviewed By: kulshrax

Differential Revision: D29405258

fbshipit-source-id: 3d2e8cd313dbe66a257433702402804f490bdf47
2021-06-25 21:05:24 -07:00
Meyer Jacobs
1a86cde16b scmstore: update edenapi scmstore tests to use new scmstore
Summary:
Update unit tests in `revisionstore::edenapi::data` to use new scmstore. There's not really a wrapper to exercise anymore for edenapi specifically, so it's probably better to just make these `scmstore` unit tests instead of edenapi (or indexedlogdatastore as in the next change)-specific.

For ease of unit testing, make fetch_logger optional and introduce `empty` constructor.

Reviewed By: kulshrax

Differential Revision: D29397495

fbshipit-source-id: d7ef0df16cf83a2506606c55c78fcbfa684904d7
2021-06-25 21:05:24 -07:00
Jun Wu
9e993aaac1 dag: check head in IdMap during pull fast path
Summary:
The server is expected to provide head (of all segs), parents (of each seg),
roots (of all segs). We checked roots and parents but only check head in debug
build. Let's check head in release build too.

Reviewed By: andll

Differential Revision: D29405816

fbshipit-source-id: 1a97eb52a9a0d1d444ae5dabd1a01f0786be9fa9
2021-06-25 18:21:12 -07:00
Jun Wu
c4ca1d3a34 configparser: treat OracleLinux as CentOS
Summary:
Found by xavierd. Recent `os_info` bump now detects CentOS as OracleLinux.
Workaround it to keep our repo functional.

Reviewed By: xavierd

Differential Revision: D29410415

fbshipit-source-id: 1bd8183f46e3c2265aef119e9f96d9d05a5dbae6
2021-06-25 17:56:27 -07:00
Jun Wu
0183787d11 io: add API to test if the pager is active
Summary: This will be used by the next change.

Reviewed By: andll

Differential Revision: D29400533

fbshipit-source-id: e6b90bedd8d8a6cf9452dfb5c5f14f9980e12f62
2021-06-25 15:18:56 -07:00
Jun Wu
410769c529 mutation: make calculate_obsolete return non-lazy set
Summary:
More straightforward way of D29404055 (e6ea02372c). Return the non-lazy set directly from
Rust. This avoids some overheads.

Note: ignoring whitespace will make reviewing easier.

Reviewed By: andll

Differential Revision: D29404901

fbshipit-source-id: 02e4766256863fe3fe258bcb318473355cd1efe4
2021-06-25 14:55:52 -07:00
Jun Wu
2476b4a3b3 dag: add some debug tracing around remote vertex lookup
Summary: This was used to narrow down issues.

Reviewed By: andll

Differential Revision: D29404054

fbshipit-source-id: 3bfdac332d63bdb13f40d5cf23dacec242b46d52
2021-06-25 14:35:13 -07:00
Jun Wu
cedddd1c8d hgcommits: add a way to inject failure on resolving commits remotely
Summary:
With lazy changelog, for every commit hash that is unknown to the repo, it
needs to be resolved remotely. For commit hash that is also unknown to the
remote server, it can be bad because we don't have cross-process negative
caching and will trigger the remote resolution over and over. Practically,
the solution is to avoid remote lookup if the "minor" correctness issue
is acceptable (ex. D29111710 (ac6c6cf3fa), D29114049 (880b5c3cd8)).

That has been tricky to debug - the remote fetching happens in Rust, and
cannot be easily inserted something like `import ipdb; ipdb.set_trace()`
like Python. I have been inserting sleeps and use gdb to understand the
call stack when writing the above 2 diffs.

This diff makes debugging easier by supporting "break point" setting by
environ variables. So one can do something like:

  $ EDENSCM_LOG=dag::protocol=debug hg ...
  DEBUG dag::protocol: resolve names [435c235d65ccc4f95595d74478a617450c96c2e] remotely
  $ EDENSCM_DISABLE_REMOTE_RESOLVE=435c235d65cc4f95595d74478a617450c96c2ec hg ... --traceback --debugger

Reviewed By: andll

Differential Revision: D29404057

fbshipit-source-id: d8a631f279f32e2ee88f097796cdc85d8ca27b77
2021-06-25 14:35:13 -07:00
Meyer Jacobs
084004fd2b checkout: update native checkout to new scmstore
Summary:
Straightforward conversion of native checkout implementation from old scmstore API to new (non-async, batched) scmstore API.

We'll meet again someday soon, async.

Reviewed By: andll

Differential Revision: D29321512

fbshipit-source-id: 1e3e0d92c95730a5c2df610061f6faf5b1eb9068
2021-06-25 10:57:56 -07:00
Jun Wu
4b7bcc2553 dag: rename parents_and_head to parents_head_and_roots
Summary: The returned value now includes roots. Rename the function to clarify.

Reviewed By: kulshrax

Differential Revision: D29383072

fbshipit-source-id: 02a255ce20d9797f482f6fe1c716f2d79a12d4e0
2021-06-25 09:29:03 -07:00
Thomas Orozco
8c83bd9a1c third-party/rust: update Tokio to 1.7.1
Summary: There is a regression in 1.7.0 (which we're on at the moment) so we might as well update.

Reviewed By: zertosh, farnz

Differential Revision: D29358047

fbshipit-source-id: 226393d79c165455d27f7a09b14b40c6a30d96d3
2021-06-25 06:17:41 -07:00
Jun Wu
ed7c8931fa dag: make parents_and_head include roots
Summary:
An alternative to D29363808 (e396cab669). The benefit is that parents_and_head is used by
both the client and the server. So we don't need to duplicate D29363808 (e396cab669) in
Mononoke code.

Reviewed By: andll

Differential Revision: D29365079

fbshipit-source-id: bca60ba2b3df477929d8e72b2363e5a0f744b35d
2021-06-24 17:54:46 -07:00
Jun Wu
ac63c8df22 dag: forbid pull fast path with pending changes
Summary:
Pull fast path uses `reload` which drops pending changes.
To avoid misuse, raise an error if pending changes are present.

Reviewed By: andll

Differential Revision: D29363799

fbshipit-source-id: 8f520d2c5553432abc452bc7b2b59d7af80e0a99
2021-06-24 17:54:46 -07:00
Jun Wu
29d07f8f73 dag: reduce round-trip looking up remotely in pull
Summary: Reduce network round-trip by prefetching missing parents and roots.

Reviewed By: andll

Differential Revision: D29363797

fbshipit-source-id: ba9201ba4a22e08effaa82026398e16f69b7c0c6
2021-06-24 17:54:46 -07:00
Jun Wu
d4e08f7345 dag: check overlapped vertexes during pull
Summary: Resolve an issue demonstrated by test_pull_overlap.

Reviewed By: andll

Differential Revision: D29363800

fbshipit-source-id: 4ba2490e9c9f0d659974177bac19480c8aeef62b
2021-06-24 17:54:45 -07:00
Jun Wu
4ee4d0be21 dag: store resolved parents in pull fast path
Summary:
The import pull data logic used low-level locking, persisting APIs, it does not
write cached idmap to disk. So we need to manually insert the idmap remote
lookup result to the actual local idmap explicitly.

This addressed an issue that verify_missing fails in the pull fast path.

Reviewed By: andll

Differential Revision: D29363813

fbshipit-source-id: 2749855a6c8c924bd1b772173de066d400f73764
2021-06-24 16:20:14 -07:00
Jun Wu
10d6c23b83 dag: resolve names remotely in pull fast path
Summary:
For a NameDag, `IdConvert` on `self.map` cannot resolve names remotely, but
`IdConvert` on `self` can. Use the latter. This is similar to D27547584 (af3c3b3fd0) where
some `self.map` are updated to `self`.

This addressed an issue found in the pull fast path test. Note there is another
issues to solve.

Reviewed By: andll

Differential Revision: D29363810

fbshipit-source-id: 28ba583ed14bbc5d52af81d4128d965f24eef011
2021-06-24 16:20:14 -07:00
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