Commit Graph

4547 Commits

Author SHA1 Message Date
Jun Wu
762be86dbe dag: add tracing logs for clone and pull
Summary:
Will be used in tests to check what data is inserted into IdMap during clone or
pull.

Reviewed By: andll

Differential Revision: D30314054

fbshipit-source-id: 8a58473ef3d85263985c1be8a6c57a9a10b3fdb4
2021-08-16 12:51:04 -07:00
Jun Wu
599406df26 dag: add a way to skip flushing certain vertexes fetched remotely
Summary:
In rare cases, the local IdMap might miss parents of draft roots.
This provides a way to emulate that in tests.

Reviewed By: andll

Differential Revision: D30314050

fbshipit-source-id: 09983604bf3259e62a41224a579774265ae0b272
2021-08-16 12:51:04 -07:00
Jun Wu
67ccb97d45 dag: add more failpoints on some errors
Summary: This would help investigate some errors.

Reviewed By: andll

Differential Revision: D30314057

fbshipit-source-id: 070e75cf0a39180c544b49c9ed1292d8536040fa
2021-08-16 12:51:04 -07:00
Yan Soares Couto
7a1085d2ac Add validation that only snapshots can contain untracked/missing files
Summary:
- This diff adds validation so that changesets that are not snapshots cannot have untracked or missing files.
- It removes the THIS IS A SNAPSHOT commit message.
- It makes the snapshot created by `hg snapshot createremote` be an actual snapshot.

Differential Revision: D30159184

fbshipit-source-id: 976968c0c2222f950a4a937aa805b25dc07c9207
2021-08-16 09:19:06 -07:00
Yan Soares Couto
c1e83d3dbd snapshot: Also upload new files, untracked, and removed
Summary:
This diff makes the snapshot command upload all types of files that were missing (added/untracked/missing/deleted), using the new types of file changes added on the previous diff.

Next steps:
- Add some indicator to Bonsai Changeset saying it is a snapshot. Verify only snapshots can have certain file changes (untracked/missing).
- Upload the files and the changeset inside an ephemeral bubble instead of in the main blobstore
- Start writing the `snapshot restore` command

Differential Revision: D30137673

fbshipit-source-id: 555238f1d64a5438cde35a843043884a939de4fe
2021-08-16 09:19:05 -07:00
Jun Wu
c840c120b8 changelog2: support migration to lazy changelog on Windows
Summary:
On Windows, it's hard to rename `.hg/store/segments/v1` away because the files
are (too easily) being currently used. Instead, let's write the new lazy
segments to `segments/v1next`, and try to rename it back later on follow-up
commands.

Reviewed By: DurhamG

Differential Revision: D30118952

fbshipit-source-id: e3edb588dccf1acb5f4ed106bbb979bcc8c6e67e
2021-08-13 16:27:04 -07:00
Zeyi (Rice) Fan
174a009419 rage: run eden rage in dry-run mode if preview is passed
Summary:
OD was running `hg rage --preview` in the background periodically and that has caused edenfsctl creating paste on the user's behalf without them actually knowing.

This will make Mercurial to collect EdenFS rage in dry-run mode (i.e. do not create paste).

Reviewed By: quark-zju

Differential Revision: D30288390

fbshipit-source-id: 1e7f25648ca1b76f24264ee13ed98cf974148b0f
2021-08-13 15:06:44 -07:00
Mat Hostetter
e719f0f225 doctor: Spelling fix "irelevant" -> "irrelevant"
Reviewed By: markbt

Differential Revision: D30248501

fbshipit-source-id: db202807735e75bb0be1034a426380ee72e10372
2021-08-13 08:13:24 -07:00
Meyer Jacobs
65bceaf5e5 manifest-tree: implement TryFrom for directly converting from a serialized manifest tree entry to a manifest::List
Summary: Allow `manifest-tree::Entry` to be constructed directly by other crates, and introduce a `TryFrom` conversion to `manifest::List::Directory`. This will be used by the scmstore `BackingStore` implementation to avoid having to rely on the `TreeStore` trait, which does not support batching.

Reviewed By: kulshrax

Differential Revision: D30282738

fbshipit-source-id: 590350dd53217fa8a181e91b194abca753a8adbe
2021-08-12 19:37:20 -07:00
Meyer Jacobs
5048cf3e0f scmstore: add new results adapter to FileStore
Summary: Add a new results adapter for `FileStore` (which will probably become the primary method of consuming batch errors in the future), which iterates over all keys, and explicitly encodes not found with `Option`, separate from the outer `Result`.

Reviewed By: kulshrax

Differential Revision: D30254000

fbshipit-source-id: 074c6ac4c279fdf72078dca17231e58d0c704956
2021-08-12 19:37:20 -07:00
Meyer Jacobs
c5b59696e9 scmstore: add method for getting local-only TreeStore
Summary:
Add a `local` method to `TreeStore` like the one on `FileStore` which returns a `TreeStore` with only the local subset of backends.

Required for `BackingStore` implementation.

Reviewed By: kulshrax

Differential Revision: D30253980

fbshipit-source-id: 142f2d88454826ff9cb9c34f30b7d21bf62b297c
2021-08-12 19:37:20 -07:00
Meyer Jacobs
47fd500315 scmstore: allow overriding edenapi config
Summary: Add a new method, `edenapi_override`, to the `TreeStore` and `FileStore` builders for use in the `BackingStore` implementation.

Reviewed By: kulshrax

Differential Revision: D30253837

fbshipit-source-id: 4a42e83621fb2634024e4ee8529c26aeae0256a4
2021-08-12 19:37:20 -07:00
Meyer Jacobs
d4e6c15939 scmstore: collect API usage metrics
Summary:
Instrument all the fetching-related legacy API implementations (ie, not `get_logged_fetches` and `get_shared_mutable`) to track the number of calls, keys, and single-key calls.

This introduces an additional lock acquisition to each of these implementations (and it'd be awkward to merge it with the one in `fetch`), but I think that's probably fine.

For APIs which do not support a variable number of keys, I use `.call(0)` so we simply track the total number of API calls.

Reviewed By: DurhamG

Differential Revision: D30003444

fbshipit-source-id: 8756d2669ca038b3f6a08e211e44e8ccb9251312
2021-08-12 19:37:19 -07:00
Meyer Jacobs
d9a885a6df scmstore: track FileStore write errors
Summary:
Adds tracking of FileStore write errors.

Write batches will still abort after the first failure as written.

Reviewed By: DurhamG

Differential Revision: D29997203

fbshipit-source-id: e1cc2ffc4a8d97ca935a7fc9aab30bde3dc548b2
2021-08-12 19:37:19 -07:00
Meyer Jacobs
34dfc6d1f7 scmstore: refactor FileStore write_batch method
Summary: Refactor the `FileStore::write_batch` method, extracting the various write cases into other methods.

Reviewed By: DurhamG

Differential Revision: D29997096

fbshipit-source-id: 8efac4b2efa2e2225d39583a5c6893efc5096fec
2021-08-12 19:37:19 -07:00
Meyer Jacobs
57503f2632 scmstore: add write metrics
Summary: Adds new write metrics tracking to filescmstore, also replacing the existing LFS pointer write metric.

Reviewed By: DurhamG

Differential Revision: D29996487

fbshipit-source-id: f5be5ccc431a9162c9e737510283a543e5b948a2
2021-08-12 19:37:19 -07:00
Meyer Jacobs
c4033dace0 scmstore: count contentstore batch errors more accurately
Summary:
Previously errors from `prefetch` weren't counted. With this change I move calculating the pending keys out of the `inner` method, making it easier to handle all batch error metrics from `?` calls right beside the existing `other_errors` call.

This is probably how I'll structure the other methods too, though it's still a little subtle - currently the batch errors only come from `prefetch`, but if batch errors were returned after the `drain` call (which always drains the vector, even if you don't consume the whole iterator), the second `pending.len()` call could incorrectly report 0. To address this, I could separate out the "single key fetching" part of the method, or just let it be understood that you should repeatedly call `pop` in such cases.

Reviewed By: DurhamG

Differential Revision: D29995789

fbshipit-source-id: 09753081c5e7076b83cb26fdddb949205ad7cd43
2021-08-12 19:37:19 -07:00
Meyer Jacobs
9bc0a013b6 scmstore: standardize contentstore metrics with other fetch metrics
Summary: Previously, contentstore metrics were tracked as a special case. Now that I'm tracking metrics on each backend, I've standardized the contentstore metrics to match.

Reviewed By: DurhamG

Differential Revision: D29995500

fbshipit-source-id: 3133dca5912d9cd6c26bd88d9aeb6a572f6eca40
2021-08-12 19:37:19 -07:00
Arun Kulshreshtha
ce4416de6b edenapi: increase low speed time limit to 2 minutes
Summary:
Increase [CURLOPT_LOW_SPEED_TIME](`https://curl.se/libcurl/c/CURLOPT_LOW_SPEED_TIME.html`) because users were hitting low speed timeouts during normal usage.

2 minutes was arbitrarily chosen, but it seems unlikely that we'd have situations where connections legitimately sit idle for more than 2 minutes. (If it turns out we do, that would be a bit concerning.)

This diff also updates the config option to specify the time in seconds instead of milliseconds because libcurl only supports second-level precision when specifying `CURLOPT_LOW_SPEED_TIME`. The config option name has been updated to explicitly include the unit to avoid confusion.

Differential Revision: D30272017

fbshipit-source-id: 0ae5e912c0dafc897fe19de3ea8e5aeb4ed8459c
2021-08-12 11:18:08 -07:00
Liubov Dmitrieva
6db6f36ed8 Clean Up: remove infinitepush path
Summary: Clean Up: Once we migrated to Mononoke we can remove the infinitepush path because it creates extra complexity in remotenames, infinitepush and commitcloud extensions

Reviewed By: yancouto

Differential Revision: D30277402

fbshipit-source-id: 1708a71eb33dc9a9b509bdc1b03bed08073b6152
2021-08-12 08:07:30 -07:00
Liubov Dmitrieva
1d9f731f67 fix remote lookup for every bookmark
Summary:
fix remote lookup for every bookmark

Some users have lots of local bookmarks and remote bookmarks, so the current logic would perform tons of sequential remote lookups via edenapi (due to segmented changelog) just to maintain correct omission state for local and remote bookmarks even if nothing has been changed.

Reviewed By: markbt

Differential Revision: D30247185

fbshipit-source-id: 7c7fd8491ff0bd67827c2a01eb852322ba15f994
2021-08-11 07:05:16 -07:00
Andrey Chursin
95e0e87c97 metrics: add println renderer
Summary: This renderer simply outputs select metris to the stdout

Reviewed By: DurhamG

Differential Revision: D30145591

fbshipit-source-id: e68efc8f808ca038dd89cd6ea4a74b33bae083fc
2021-08-10 14:11:23 -07:00
Andrey Chursin
4493282b9c progress: allow to customize units of time series
Reviewed By: DurhamG

Differential Revision: D30137294

fbshipit-source-id: f75dc3e433007f42093c70f5c2f52c4cd012a165
2021-08-10 14:11:23 -07:00
Andrey Chursin
a0612b6bf7 progress: fix division by zero
Reviewed By: yancouto

Differential Revision: D30137301

fbshipit-source-id: 0f23c1bde6f2b4b0e28e326287607b4f42ec0cb0
2021-08-10 14:11:23 -07:00
Andrey Chursin
a767d3c269 edenapi: metric for inflight files and requests
Reviewed By: DurhamG

Differential Revision: D30137296

fbshipit-source-id: 0277fb3b88268defd72573f6711d2a39b3f8db44
2021-08-10 14:11:23 -07:00
Andrey Chursin
e27843a48a metrics: add entrance wrapper for the futures
Summary: This wrapper keep guards until future is complete

Reviewed By: DurhamG

Differential Revision: D30137298

fbshipit-source-id: 552363031ecc2c408791f6c0963dafad840154b7
2021-08-10 14:11:23 -07:00
Andrey Chursin
5869046e48 edenapi: remove unnecessary async from Client::fetch
Summary:
Client::fetch was async method for no reason(it does not contain any awaits)
This diff removes async and makes it clear that fetch only prepares futures but does not itself contain async code

Reviewed By: DurhamG

Differential Revision: D30137299

fbshipit-source-id: 87f80cf906bbea856f9f54b88a3609d0aad03a73
2021-08-10 14:11:23 -07:00
Andrey Chursin
4ac3d5b47b metrics: init metrics render when hg starts
Reviewed By: DurhamG

Differential Revision: D30137300

fbshipit-source-id: f3510415d643fcb57b39a870af8b9622e239c9f0
2021-08-10 14:11:22 -07:00
Andrey Chursin
46b99410db metrics: implement metrics renderer into iosample bar
Summary: This allow to render metrics in the real time, similar to how we render network usage

Reviewed By: DurhamG

Differential Revision: D30137295

fbshipit-source-id: 8843b574971c1ccaaae0727be6f9d46d1d90625f
2021-08-10 14:11:22 -07:00
Andrey Chursin
89fb80e0da metrics: read render config from env variable
Summary: See docstring to init_from_env for the description

Reviewed By: quark-zju

Differential Revision: D30137304

fbshipit-source-id: ad3fb5e0cbb52ca405959eb0d394f5a2c9761ad9
2021-08-10 14:11:22 -07:00
Andrey Chursin
ceee800b6e metrics: add render crate
Reviewed By: quark-zju

Differential Revision: D30137303

fbshipit-source-id: c5202b34b006137ec137ca1ac6c2092d1c0f708b
2021-08-10 14:11:22 -07:00
Andrey Chursin
6a626ace30 metrics: add entrance counter
Summary: This allows to count number of parallel operations, like parallel entrance to some fn or parallel requests

Reviewed By: quark-zju

Differential Revision: D30137297

fbshipit-source-id: 74585dcab353091619a0a1f217548121079b463c
2021-08-10 14:11:21 -07:00
Andrey Chursin
ff9705b787 metrics: add Counters and Registry
Reviewed By: quark-zju

Differential Revision: D30137302

fbshipit-source-id: 4e144783b13a7114f71529aa9404301a7adad077
2021-08-10 14:11:21 -07:00
Andrey Chursin
7fc4e6a9b8 metrics: add metrics crate
Reviewed By: yancouto

Differential Revision: D30113372

fbshipit-source-id: f3761e36e40efbd97a700d209135cb9939486b76
2021-08-10 14:11:20 -07:00
Johan Schuijt-Li
a7ae42d3ca move to common shared directory
Summary: Allow this to be used by more utilities.

Reviewed By: DurhamG

Differential Revision: D29958512

fbshipit-source-id: b6a1a7017102a4ff4ad252246d3252903bbb793f
2021-08-10 10:27:16 -07:00
Johan Schuijt-Li
01938aa168 rename to a more generic name
Summary: Prepare before moving to a common directory

Reviewed By: StanislavGlebik

Differential Revision: D29958513

fbshipit-source-id: 48c04a9bf6e8c3800b3f187e7741d240ecff9e9c
2021-08-10 10:27:16 -07:00
Jun Wu
e9d872aa95 debugchangelog: add a flag to remove backup files
Summary: This allows us to remove older files to free disk space.

Reviewed By: DurhamG

Differential Revision: D30092445

fbshipit-source-id: 20770968cfaeba4fb6f6c45b247cc1cdafb79a08
2021-08-10 09:26:55 -07:00
Jun Wu
3aaf970ceb debugchangelog: avoid "return" in changelog migration logic
Summary: This makes upcoming changes a bit easier.

Reviewed By: yancouto

Differential Revision: D30092446

fbshipit-source-id: f62f1ced45c46dc48c3b1112af661d8fbcd80706
2021-08-10 09:26:55 -07:00
Stanislau Hlebik
1d0c535123 mononoke: support reading streaming changelog chunks with tag
Reviewed By: ahornby

Differential Revision: D30015772

fbshipit-source-id: ca19f41b95ce0db43895b3c53009538d5712e239
2021-08-10 05:13:54 -07:00
Jun Wu
d1ef12b2c6 dag: use local cache for _batch lookups
Summary: This removes some redundant lookups when using the `*_batch` APIs.

Reviewed By: andll

Differential Revision: D30094155

fbshipit-source-id: f64702a09f67b67a10a2d51545f3b6940e80022f
2021-08-09 17:05:33 -07:00
Jun Wu
7a65847bb0 dag: add tests about suboptimal local cache for remote lookups
Summary: The test exposes issues that the local cache isn't used in some cases.

Reviewed By: andll

Differential Revision: D30094158

fbshipit-source-id: 0122154b8bd2f9d321e248720632e28b6ca0559e
2021-08-09 17:05:33 -07:00
Jun Wu
cac695802f dag: add failpoints for resolving ids or vertexes remotely
Summary:
Similar to D29888937 (8cb3d3dd75). This helps getting the Rust traceback of why certain
code path gets triggered.

Reviewed By: andll

Differential Revision: D30094157

fbshipit-source-id: ef5bacbf4612ed115fd631056f6c004fe6d1d93f
2021-08-09 17:05:33 -07:00
Jun Wu
5caa1688ed dag: add a tracing log for inserting into the overlay map
Summary: This will be used to debug some over fetching issues.

Reviewed By: andll

Differential Revision: D30094159

fbshipit-source-id: cfbdff497fbf53f97f1c957bf77c25e26ee79286
2021-08-09 17:05:33 -07:00
Jun Wu
8ff23766b7 update: prefetch children of node to avoid remote lookups
Summary:
Prefetch vertex on checkout (which is more expected to require network to download
files) so committing on them does not trigger remote lookup.

Reviewed By: andll

Differential Revision: D30094156

fbshipit-source-id: 917df2bbad7cee51a06f2fa38172775423893c37
2021-08-09 17:05:33 -07:00
Jun Wu
c971369c84 dag: further reduce remote lookups calculating "definitely missing" vertexes
Summary:
See the added comments. In some cases we can avoid remote lookups. This would
help make commit/amend more offline friendly.

Reviewed By: DurhamG

Differential Revision: D30004908

fbshipit-source-id: 94fbc7934a1eb3ae1058d8c542211a885d5ad8e6
2021-08-09 17:05:33 -07:00
Jun Wu
ca41a68c6d dag: add failpoints for not found errors
Summary:
Similar to D30094157. This is helpful to get a Rust backtrace on "not found"
errors. This is useful because the Python traceback might not have Rust
stack.

Ideally, it'd be better if we can integrate backtrace into the error types.
However, the stdlib backtrace is still unstable and the thirdparty backtrace
seems too heavyweight.

Reviewed By: DurhamG

Differential Revision: D30123355

fbshipit-source-id: 7af76422143340194d8499a75e8ed65e9bf1fcae
2021-08-09 14:13:34 -07:00
Jun Wu
da6ca568b0 indexedlog: turn some panic into errors
Summary:
We have seen slicing panics on NFS, like:

  thread 'main' panicked at 'range end index 14079379 out of range for slice of length 0', eden/scm/lib/indexedlog/src/log/mod.rs:1678:14

Possibly when some files were stale or out of sync (ex. `log` got shorter than
expected somehow) due to NFS weirdness (bad locking?). Let's make them Rust
errors instead of panics for easier error reporting and investigation.

Reviewed By: DurhamG

Differential Revision: D30166177

fbshipit-source-id: 25cbd9c178b24580c176fe9469362fe0020ede95
2021-08-09 13:32:16 -07:00
Mark Juggurnauth-Thomas
8ed3f2f031 update thrift deps
Reviewed By: krallin

Differential Revision: D30191123

fbshipit-source-id: 49c6b61a69cf3251360b9a17e0ebb14c73fc380b
2021-08-09 11:19:17 -07:00
Liubov Dmitrieva
3dbac2ff63 commitcloud CLEAN UP remove last bits code with interngraph proxy
Summary:
commitcloud CLEAN UP: remove last bits code related to an old interngraph commit cloud proxy

The configs are not used, the service_url in scm daemon is not used, the interngraph proxy is not used

Reviewed By: singhsrb

Differential Revision: D30160471

fbshipit-source-id: 07fee2b8733afa29659467cb296df3b47fe1b54b
2021-08-09 07:17:44 -07:00
Durham Goode
1ae4201155 checkout: remove unused imports
Summary: These were accidentally left over from a previous diff.

Reviewed By: singhsrb

Differential Revision: D30133799

fbshipit-source-id: 311f746848fc823a6fbae9e58bafda6641104b1e
2021-08-06 08:19:05 -07:00