Commit Graph

10614 Commits

Author SHA1 Message Date
Diego Elio Pettenò
d0a4406f1c Make the eden restart --force command explicit.
Summary: This just makes it more obvious _where_ `--force` should be passed.

Reviewed By: genevievehelsel

Differential Revision: D28119590

fbshipit-source-id: 1fbdb4428e9b89e7b66c959f874067485a91d534
2021-05-04 09:51:40 -07:00
Thomas Orozco
b27c31d172 mononoke/backfill_derived_data: limit concurrency of unodes warmup
Summary:
Right now, if your batch size is 1K we prefetch 1K unodes in parallel. This
tends to result in e.g. timeouts as various things get starved for CPU as
a result.

Let's stop doing that.

Reviewed By: StanislavGlebik

Differential Revision: D28183685

fbshipit-source-id: d8353ae8e36921a485b982a1043b81f443258098
2021-05-04 05:32:07 -07:00
Thomas Orozco
606332500a mononoke: backfill_derived_data: lower batch sizes (a lot)
Summary:
Our batch sizes are a bit crazy here and causing the backfiller to OOM if there
actually is that many commits to derive. Lower them, a lot.

Reviewed By: StanislavGlebik

Differential Revision: D28183686

fbshipit-source-id: 54b546c4507f65c34a264df283516b5d62408a66
2021-05-04 05:32:07 -07:00
Alex Hornby
c2419d91e8 mononoke: remove repo prefix from pack key in packer
Summary: The packer was adding repo prefix as part of the pack key, which would mean that same content for different repos had different binary form. This change fixes the prefix.

Reviewed By: farnz

Differential Revision: D28119422

fbshipit-source-id: 338e17885abd8cfca12d5bb399244039dbf22e63
2021-05-04 04:31:17 -07:00
Alex Hornby
e19e4625cf mononoke: make pack hash order independent
Summary:
Our packs no longer require strict order on write to be readable, so let's hash the list of sorted keys as the pack identity. i.e. pack will have same identity if if contains same keys, regardless of order.

This makes the packer easier to work with in general

Reviewed By: farnz

Differential Revision: D28119423

fbshipit-source-id: 71c8d4ed351bde63065047c706311a869b2beeda
2021-05-04 04:31:17 -07:00
Jan Mazur
b9820ec1b7 mononoke/server: include individual wireproto commands as qps before command execution
Summary:
Wireproto session multiplexes wireproto commands. Counting them individually is most likely a better metric for QPS even though we wouldn't be able to offload them to a different server/region one by one.

It makes the cost of a query more even across wireproto and edenapi.

Reviewed By: krallin

Differential Revision: D28058054

fbshipit-source-id: 5d606841e07816ec8808a3b9aba4b7c0614b9cb6
2021-05-04 03:41:05 -07:00
CodemodService Bot
f6d847723f Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D28178444

fbshipit-source-id: 1e785c38938fe19400bea178bc442b2b9aa76585
2021-05-04 02:08:42 -07:00
Alex Hornby
764a4788df mononoke: add walk direction to walker
Summary:
When scrubbing to collect commit times for path info logging,  its much easier to get correct commit times for manifests by walking from oldest changeset first.  That way when any manifest/tree is discovered its from the closest changeset chunk to its creation.

Alternative would have been using the path data from linknode associated changesets to prune out which sub-manifests to walk when walking forward, which is more complicated and would require holding more state (or reloading changesets continuall)

Differential Revision: D28092314

fbshipit-source-id: 871dc80dd88b63959501dd1018b6466afae5c6c7
2021-05-04 01:35:23 -07:00
Jun Wu
4c5d7c2123 ui: normalize foo://path to foo:path when finding name for url
Summary: This will affect upcoming changes.

Reviewed By: kulshrax

Differential Revision: D27951629

fbshipit-source-id: e1b24c187424962eb1f0e6c81370eca264eaa20a
2021-05-03 13:21:08 -07:00
Gus Wynn
cbbb45206b slog max_level_debug -> trace
Reviewed By: Imxset21

Differential Revision: D28097080

fbshipit-source-id: 7d417f8256922926cf379d9c2fb3249f6d2544ef
2021-05-03 10:30:21 -07:00
Stefan Filip
bd04e54289 repo_factory: add repo annotation to segmented_changelog logger
Summary: This annotation got lost during the refactor of repo factory.

Reviewed By: quark-zju

Differential Revision: D28135734

fbshipit-source-id: b91d359422ac2456d7c670ae7094f20e3d6e5d7c
2021-05-03 08:58:28 -07:00
Stefan Filip
071ff39381 edenapi_service: update to_cbor_bytes to take reference
Summary:
The implementation of `to_cbor_bytes` does not make use of the ownership. It
works the same a reference is given. However the method is a lot more flexible
if a reference is used for the argument.

Reviewed By: kulshrax

Differential Revision: D28132732

fbshipit-source-id: 2eecd44ce9e4ff5bc42ff01fd358b0d30dde91ef
2021-05-03 08:52:26 -07:00
Meyer Jacobs
c625107209 scmstore: introduce simplified, non-async, non-generic, non-combinator TreeStore
Summary:
There have been a bunch of problems with the previous approach to scmstore, so I'm going to try to start simple, make it feature complete, and then add async integration and factor out generic functionality as appropriate.

This change contains a `TreeStore` implementation with a single, synchronous, batch read method (supporting local storage, memcache, and legacy fallback, with writing missing to cache).

Add `TreeStoreBuilder`, which duplicates the existing `TreeScmStoreBuilder`, which some changes that make it easier to use for this case. I intend to unify these in the future.

Add an inherent impl for `EdenApiTreeStore` that provides subset of the `BlockingEdenApi` trait, which eliminates the need to unpack this type into a different adapter as the old `scmstore` code does. This might not be the right approach here, in reality we only need a `(client: Arc<dyn EdenApi>, repo: String)` here for trees, and that + `ExtStoredPolicy` for files, so we could take the `EdenApiAdapter` approach here too. The only reason we have to do any of this is because when `pyrevisionstore` is called to construct `scmstore` / `contentstore`, all we have is `Arc<EdenApiTreeStore>`. We could also just make the `EdenApiRemoteStore` fields public, and access them through the `Arc`.

Add `add_mcdata` method to `MemcacheStore`, `impl TryFrom<Entry> for McData`, and `impl From<McData> for Entry` for convenience when working with `MemcacheStore` (so we don't need to manually unpack the type and build `Entry`, or manually build a fake `Delta` from `Entry` to write).

Reviewed By: DurhamG

Differential Revision: D28076900

fbshipit-source-id: 7fdb5e8a42d052879eff449f60d40a83cfa7145d
2021-04-30 20:38:41 -07:00
Meyer Jacobs
66d4e89968 util: simplify signatures of get_local_path and get_cache_path
Summary:
Both `get_local_path` and `get_cache_path` take suffix as as `PathBuf`, even though they only ever use it as a reference. `get_local_path` also takes a reference to a `PathBuf`, even though it always clones it internally, and takes an `Option`, even though it just maps across the contents of the option.

I modified `get_local_path` to accept a `PathBuf` by move, which it uses directly, and to not take an `Option` (instead just calling `map` externally, removing some unnecessary unwraps), and for both functions to accept `impl AsRef<Path>` for suffix.

Reviewed By: DurhamG

Differential Revision: D28100527

fbshipit-source-id: df28b51c8005f3d95acc8e082b40adaab18e31c9
2021-04-30 20:38:41 -07:00
Meyer Jacobs
1db3addf43 indexedlogdatastore: Add public API for for clients to batch queries without locking for each individually
Summary: Add a Read/Write Guard API to IndexedLogHgIdDataStore which allows client code outside the module to perform a series of reads and writes without locking for each individually.

Reviewed By: kulshrax

Differential Revision: D28075788

fbshipit-source-id: 2a65a426f443e1a421198ad8b4c610e4822574f7
2021-04-30 20:38:41 -07:00
Meyer Jacobs
d00e31b5b0 indexedlogdatastore: Add public read/write/flush API to IndexedLogHgIdDataStore so callers don't need to access private fields
Summary:
Add get_entry, put_entry, and flush_log inherent methods to IndexedLogHgIdDataStore. Refactor callers to use them in cases where they don't lock across multiple reads / writes (to avoid performance regressions).

This should allow `ReadStore` and `WriteStore` to be moved out of the module.

Reviewed By: DurhamG

Differential Revision: D27979828

fbshipit-source-id: c9fb8c4ac68f67b285c72396509aa17928aa54ed
2021-04-30 20:38:41 -07:00
Jun Wu
f31f5ebcd5 commands: update help text of log
Summary: It has been wrong since 2014 (tweakdefault).

Reviewed By: kulshrax

Differential Revision: D28122703

fbshipit-source-id: c83ddbac2c6162e36672649c60c2e7916dc7cbd2
2021-04-30 15:13:21 -07:00
Andrey Chursin
ba0ad33d20 checkout: use action map to construct CheckoutPlan
Summary: This is step towards unifying native merge/rebase structs with native checkout - we now construct native checkout plan from the action map, instead of directly making it from the diff

Reviewed By: quark-zju

Differential Revision: D28078156

fbshipit-source-id: 318d7e419ca9fef15a4aebf7494451f69a3bbbe5
2021-04-30 13:04:57 -07:00
Andrey Chursin
dd5909abe8 checkout: read native checkout concurrency from config
Summary:
This diff makes concurrency of native checkout to be configurable
This config can be used to reduce concurrency on platforms that are known to cause issues with watchman due to too many checkout operations

Reviewed By: quark-zju

Differential Revision: D28074993

fbshipit-source-id: 0a09fcf3ae48d08cead36da56c06b546aecd16b4
2021-04-30 13:04:57 -07:00
Andrey Chursin
9a499113fc checkout: make checkout configurable
Summary: This diff refactors out `Checkout` component from checkout plan and allows to configure parallelism in checkout

Reviewed By: quark-zju

Differential Revision: D28074994

fbshipit-source-id: 72933c757d6e27615d1ef2bb4652bc67c9c3253d
2021-04-30 13:04:57 -07:00
Stefan Filip
a56f662e1c segmented_changelog: rename Vertex to DagId
Summary:
Vertex is old. It no longer makes sense with the current structure. The main
issue is that the dag crate now has VertexName which may confuse readers at
first glance.
When Vertex was added DagId would have been confusing because we had structs
that were named Dag that did not use DagId directly. Those structures are now
renamed and DagId is consistently used for dag crate structures.

The IdMap database would still use the vertex name until someone runs a
migration to rename the column.

I am not 100% that this is needed, but it's a change that's been on my mind.

Reviewed By: quark-zju

Differential Revision: D28110184

fbshipit-source-id: b996a7545a90acc25e2bb5326f2731b95c8740b4
2021-04-30 09:11:03 -07:00
Alex Hornby
d7330b7557 mononoke: walk from BonsaiHgMapping to HgChangesetViaBonsai for consistency
Summary:
Previously there were two different paths to HgChangeset.  This diff unifies them, so that when walker state.rs is checking for a previous visit it will find that it happened.

For existing walks of changesets in the NewestFirst direction this wasn't causing a problem, however the next diff in stack adds support for OldestFirst walks.  In the OldestFirst case the mismatch in paths to HgChangeset was leaving a deferred edge to visit when everything should have been visited in previous chunks.

Differential Revision: D28095569

fbshipit-source-id: ccba4a679fc28bde042cfc222e5097c84fa968c0
2021-04-30 05:43:39 -07:00
Thomas Orozco
df72cc772f mononoke: enable level filtering when printing information about stdlog
Summary:
Right now we write straight to a logger with no filter, so no matter the log
level we print this stuff out. Let's fix it.

While we're at it, move this back to debug level.

I'd made this trace in my recent cmdlib refactoring (which resulted in us
properly initializing logging in all binaries), since I assumed we just had level
filtering working but with debug-logging enabled and I didn't want to have to
update every single test, but it turns out that the reason we didn't print it
out at trace is just because thats not enabled at all in our slog build:
D28097080.

Reviewed By: StanislavGlebik

Differential Revision: D28116053

fbshipit-source-id: f59d9a70ea3c3d834adea16f2686bfc244672b14
2021-04-30 03:24:56 -07:00
Simon Farnsworth
3f33c7ac4c Account for zstd non-determinism in packer test
Summary: The precise compressed size of big blobs in zstd varies between runs. Glob out the exact size

Reviewed By: StanislavGlebik

Differential Revision: D28116066

fbshipit-source-id: 990add820de6c8cb0029805bc1de304fdf83acba
2021-04-30 02:46:42 -07:00
Stanislau Hlebik
45c3ba7d02 mononoke: add fastlog to warm bookmark cache
Summary:
It wasn't in warm bookmark cache, but it was an oversight - there's no reason
for it to not be here. Let's add it, since in case of crashlooping derived data
tailer (see attached task T89911396) there might be nothing to derive fastlog
data structure, and we end up with a long queue to derive.

Reviewed By: krallin

Differential Revision: D28114533

fbshipit-source-id: feb29c07d90be6250c5385ae9f2fb13eb52eedba
2021-04-30 01:50:25 -07:00
Xavier Deguillard
fc382774d6 service: remove dependency on curl
Summary:
From what I can see, this was added when EdenFS had a Mononoke store, which is
now long gone, thus we should be able to remove the Curl dependency altogether.

Reviewed By: fanzeyi

Differential Revision: D28037816

fbshipit-source-id: 834f7db64bab5dda1748ad2f033c27a2854b0ba4
2021-04-29 19:41:04 -07:00
Xavier Deguillard
ddf6c2dc5c fuse: remove @manual from FuseTypes.h
Summary: Looks like these aren't needed since these files are owned by a TARGETS file.

Reviewed By: genevievehelsel

Differential Revision: D28101197

fbshipit-source-id: d790530227641bf25e48bd96c8a95dd31f08a954
2021-04-29 17:30:16 -07:00
Xavier Deguillard
5a6172a8e6 autodeps: remove @manual for cpptoml
Summary:
Now that autodeps knows where to find cpptoml.h, we no longer need these
manual annotation.

Reviewed By: kmancini

Differential Revision: D28100956

fbshipit-source-id: 463b73834c500c1d16a4a769af3655938124d49d
2021-04-29 16:19:09 -07:00
Jeremy Fitzhardinge
f4f52c1d96 mononoke/mercurial_types: remove unneeded vec![] temporaries
Summary:
For no particular reason I was looking at this and saw a bunch of
unneeded `vec![]` temporaries which could be replaced with arrays or slices.

Reviewed By: krallin

Differential Revision: D28073693

fbshipit-source-id: 7fca3b4c7b40cc380b4b128e9809912b7b9ba1f7
2021-04-29 15:49:58 -07:00
Mateusz Kwapich
43c2f9f88e error out when fetching NULL data from hgsql
Summary:
The original bug that resulted in empty revisions being pulled is long-fixed:
T28553115. I'm planning to make data1 nullable so I can reclaim space by removing older
revs.

Reviewed By: DurhamG

Differential Revision: D28096278

fbshipit-source-id: a57da458df115dcbdf544e2151aa327651190c1a
2021-04-29 14:45:12 -07:00
Mateusz Kwapich
d1064681ee bring back debugephemeralcommit.py
Summary: andll removed it (probably by accident) in D27722921 (80adbe385c)

Reviewed By: andll

Differential Revision: D28096279

fbshipit-source-id: 0d3e9aee4c22803680cee8d5e3a40d51d7f36b7b
2021-04-29 14:45:12 -07:00
Mateusz Kwapich
2a23089e9a hgsql: fix tests
Summary:
This enlists hgsql tests to the lists of tests using revision numbers and
marks some racy lines as optional

Reviewed By: quark-zju

Differential Revision: D28096282

fbshipit-source-id: eb8406cb74f3338d13d4109fce35f969ff9e3b79
2021-04-29 14:45:12 -07:00
Mateusz Kwapich
7a6c3e090f lib: remove unused C code
Summary:
This is a hg-sever backport of fix from D27659634 (8e8aaa61d6)

Those are not used. Recently we saw build issues like:

  lib/third-party/sha1dc/sha1.c:8:10: fatal error: string.h: No such file or directory
   #include <string.h>
            ^~~~~~~~~~

Possibly by some compiler flags disabling stdlib. Since we don't need
the C code let's just remove them.

Reviewed By: StanislavGlebik

Differential Revision: D28096283

fbshipit-source-id: 6c5390d26264e1e39f99b29dec8608d92e5ae572
2021-04-29 14:45:12 -07:00
Thomas Orozco
a0debf738b mononoke/lfs_server: log client attempts left
Summary: - Like it says in the title.

Reviewed By: HarveyHunt

Differential Revision: D28092796

fbshipit-source-id: 01816f815148aca6c86078fb7dec616ecf53095c
2021-04-29 13:54:07 -07:00
Thomas Orozco
bef2578fc2 revisionstore/lfs: treat backoffs separately from transfer errors
Summary:
This updates hg to have a different amount of retry for backoffs requested by
the server and errors.

The rationale is that backoffs are fairly well understood and usually caused by
a surge in traffic where everybody wants the same data (in which case we should
be willing to wait to get it because there is literally no alternative),
whereas general errors aren't predictable in the same way.

We're now effectively at a point on the server side where _all_ our instances
have the exact same load, so if any server is telling you to backoff, that
pretty much guarantees that the whole tier has too much traffic to deal with.

This leaves us with two options:

- Tell clients to wait longer and smooth out the traffic surge.
- Add enough capacity that even our biggest surges don't result in _any_
  throttling.

The latter is a bit unrealistic unrealistic given we routinely get egress
variations in excess of 5x (here's an example: https://fburl.com/ods/pidsrqnl),
so this does the former.

This also updates the client to tell the server how many attempts it has left
in addition to how many it used up so far. How many are left is more meaningful
for alerting!

Finally, it adds a bit of logging so that in debug mode you can see this
happening.

Reviewed By: quark-zju

Differential Revision: D28092797

fbshipit-source-id: f61410e39c4a3e3356371a3c7bd7892de4beacc8
2021-04-29 13:54:07 -07:00
Jun Wu
d3de89f62c changelog: do not consider integers revs for shortest
Summary:
After D27144492 (48cd15ab14) we disabled revision number resolution. There is no need to
consider it when calculating shortest prefix.

Reviewed By: DurhamG

Differential Revision: D28072997

fbshipit-source-id: 832017c7b626265eb8cd2dd78946a03c4e7228f6
2021-04-29 13:39:31 -07:00
Zeyi (Rice) Fan
e94d69dcd5 utils: define symlink type for Windows
Summary:
This diff defines symlink type in `DirType`.

Even though it is not directly used in the FSCK diff. This will allow us to support symlink in EdenFS Windows in the future.

Reviewed By: genevievehelsel

Differential Revision: D28016305

fbshipit-source-id: 67c1aa22e39198f9c91845129695f27b8303a5f1
2021-04-29 13:17:54 -07:00
Alex Hornby
c89d21a9d6 mononoke: add strum to bulkops Direction enum
Summary: Add strum derivations to bulkops so we can use them in command line parsing later in stack.

Differential Revision: D28069912

fbshipit-source-id: 4d997e20e18f2011b51933ed4322c85bb7468980
2021-04-29 11:03:47 -07:00
Xavier Deguillard
3868dd01fc inodes: File::fallocate should return a Future
Summary:
We were ignoring the return value of runWhileMaterialized, and thus we were
returning to FUSE before fallocate returned.

Reviewed By: fanzeyi

Differential Revision: D28081991

fbshipit-source-id: f398942ddb2432e48e80c148abc8edb7e5ada71d
2021-04-29 09:51:48 -07:00
Alex Hornby
aeddca942b mononoke: connect up mtime tracking to walker scrub
Summary: Start logging mtime as relatedness key in the walker scrub pack info output

Differential Revision: D28055637

fbshipit-source-id: 4c24c5f2af0414ae7df17ade69bba9ff18861264
2021-04-29 09:32:47 -07:00
Alex Hornby
244b4bdd4f mononoke: connect up path hash tracking to walker scrub
Summary: Start logging path hashes in the walker scrub pack info output

Differential Revision: D28031871

fbshipit-source-id: d610aeb1410b58611147b73eb47e123f997d4cf3
2021-04-29 09:32:47 -07:00
Thomas Orozco
9c7aa6aaf7 third-party/rust: remove patches for Tokio 0.2 & Hyper 0.2
Summary:
We used to carry patches for Tokio 0.2 to add support for disabling Tokio coop
(which was necessary to make Mononoke work with it), but this was upstreamed
in Tokio 1.x (as a different implementation), so that's no longer needed. Nobody
else besides Mononoke was using this.

For Hyper we used to carry a patch with a bugfix. This was also fixed in Tokio
1.x-compatible versions of Hyper. There are still users of hyper-02 in fbcode.
However, this is only used for servers and only when accepting websocket
connections, and those users are just using Hyper as a HTTP client.

Reviewed By: farnz

Differential Revision: D28091331

fbshipit-source-id: de13b2452b654be6f3fa829404385e80a85c4420
2021-04-29 08:07:45 -07:00
Thomas Orozco
ffed22260d third-party/rust: remove Gotham 0.2
Summary:
This used to be used by Mononoke, but we're now on Tokio 1.x and on
corresponding versions of Gotham so it's not needed anymore.

Reviewed By: farnz

Differential Revision: D28091091

fbshipit-source-id: a58bcb4ba52f3f5d2eeb77b68ee4055d80fbfce2
2021-04-29 08:07:45 -07:00
Alex Hornby
40a7e12e56 mononoke: make scrub EmptyRoute produce WalkKeyOptPathHash
Summary:
Connect up the scrub stream types so they will be uniform for scrubs that log pack info and those that do not.

This is in preprepation for the next diff which connects up the pack info logging of path hashes to scrub.    CI for this diff verifies its not broken the non-path tracking case.

Differential Revision: D28031868

fbshipit-source-id: 7bf91eb1778f57487f6a2847f215cf7f5cd2dff7
2021-04-29 07:46:29 -07:00
Alex Hornby
58f52f6422 mononoke: make WalkKeyOptPath generic over path and pathhash
Summary: This moves evolve_path up to WrappedPathLike so that we can use sample route evolution logic for routes that track paths (e.g. corpus sampling) and path hashes (e.g. scrub, where path hashes take less memory than full paths).

Differential Revision: D28031867

fbshipit-source-id: cdabdc466158a8db1c770536747c996dddb27e71
2021-04-29 07:46:29 -07:00
Alex Hornby
b296a73c2c mononoke: name the fields in WalkPayloadMtime
Summary: Name the fields rather than leave it as a tuple struct.  This makes it a bit easier to work with in the rest of the stack

Differential Revision: D28062254

fbshipit-source-id: 9e5202b4d6f1f29d44d98b86aa9b6ddb97d821eb
2021-04-29 07:46:29 -07:00
Alex Hornby
ff462f5422 mononoke: move filter_repo_path to be a method on NodeType
Summary: Makes more sense for this to be a method on NodeType

Differential Revision: D28031869

fbshipit-source-id: 1ddbafa0d7634ac67fd8d5112e6f57759ed91638
2021-04-29 07:46:29 -07:00
Alex Hornby
4e7f0888bf mononoke: name the fields in WalkKeyOptPath
Summary: Name the fields rather than leave it as a tuple struct

Differential Revision: D28031866

fbshipit-source-id: 039f004e0b81294aa6d6b13e79cb45ee2b84567c
2021-04-29 07:46:29 -07:00
Alex Hornby
901fe40f5f mononoke: introduce WrappedPathLike to walker
Summary: This new trait abstracts across WrappedPath and WrapperPathHash.  Later in the stack I make path tracking use this to track either full paths (for corpus sampling) or path hashes (for logging from scrub).

Differential Revision: D28031870

fbshipit-source-id: d1c57230f68fffff179929a3cb92c82d92e0588c
2021-04-29 07:46:29 -07:00
Thomas Orozco
71994ae65d mononoke: be less specific in errors we expect in test-lfs-server-scuba-logging.t
Summary:
Like it says in the title. This isn't giving us the same error consistently
causing flaky failures.

Reviewed By: StanislavGlebik

Differential Revision: D28091747

fbshipit-source-id: dfc7a28b443c6577823c71cee7b006ed30fec18e
2021-04-29 06:44:49 -07:00
Mark Juggurnauth-Thomas
a32ccfc5cc blobrepo: delete BlobRepo::new_dangerous
Summary: This is no longer needed, as all construction is performed by facet factories.

Reviewed By: StanislavGlebik

Differential Revision: D28001390

fbshipit-source-id: 237dd4f7b8b08bec5b85360edc3be7018d9161de
2021-04-29 06:11:20 -07:00
Mark Juggurnauth-Thomas
139d93bedb changesets: split implementation to a separate crate
Summary:
Keeping the `Changesets` trait as well as its implementations in the same crate means that users of `Changesets` also transitively depend on everything that is needed to implement it.

Flatten the dependency graph a little by splitting it into two crates: most users of `Changesets` will only depend on the trait definition.  Only the factories need depend on the implementations.

Reviewed By: krallin

Differential Revision: D27430612

fbshipit-source-id: 6b45fe4ae6b0fa1b95439be5ab491b1675c4b177
2021-04-29 06:11:20 -07:00
Mark Juggurnauth-Thomas
d66e56c407 changesets: remember repo_id in changesets
Summary:
The changesets object is only valid to access the changesets of a single repo
(other repos may have different metadata database config), so it is pointless
for all methods to require the caller to provide the correct one.  Instead,
make the changesets object remember the repo id.

Reviewed By: krallin

Differential Revision: D27430611

fbshipit-source-id: bf2c398af2e5eb77c1c7c55a89752753020939ab
2021-04-29 06:11:20 -07:00
Mark Juggurnauth-Thomas
b935836e32 changesets: replace get_sql_changesets with enumeration methods
Summary:
The `get_sql_changesets` method on `Changesets` is an abstraction violation,
and prevents extraction of `SqlChangesets` to a separate crate as it would
introduce a circular dependency.

It is used to allow bulk queries to enumerate changesets by integer unique ID,
so promote this to a full feature of `changesets`, and remove the
`get_sql_changesets` method.

Reviewed By: krallin

Differential Revision: D27426921

fbshipit-source-id: 2839503029b262dd5e6a8be09bb35bb143b4c5ac
2021-04-29 06:11:20 -07:00
Xavier Deguillard
42b17dfa1c nfs: add to Executor directly without creating a future
Summary:
folly::via is a Future API, and thus it creates one, which requires allocating
it and then attaching it to the Executore. Since the code to dispatch a request
isn't Future based, we don't need to use folly::via, and we can simply add the
lambda to the Executor directly. This removes expensive memory allocations from
the EventBase.

Reviewed By: kmancini

Differential Revision: D27976674

fbshipit-source-id: 8fa9724a94ba69b071ab894cdbbad0d33733c098
2021-04-28 17:06:23 -07:00
Xavier Deguillard
72b4096a06 nfs: remove multi-fragment O(N^2) complexity
Summary:
Neither macOS, nor Linux are sending multi-fragment requests to the NFS server.
Since supporting these means calling into memmove, which can be expensive for
large requests, let's just remove support for them for now. If somehow macOS
and/or Linux start sending these, the XCHECK(isLast) will catch this and we can
fix the code by then.

Reviewed By: kmancini

Differential Revision: D27976671

fbshipit-source-id: 77c758b2bb36517d22d5b637e6f0ebf84cc19e5b
2021-04-28 17:06:23 -07:00
Xavier Deguillard
32ee50d702 nfs: move some code out of the event base
Summary:
The EventBase is single threaded, and for heavily concurrent client workflows,
it could see a lot activity, thus every cycle saved can be used to drive more
client requests. The construction of the IOBuf doesn't need to be done while in
the EventBase, thus let's build it outside.

Reviewed By: kmancini

Differential Revision: D27976670

fbshipit-source-id: c6c015ef26df1dcb3fc0c5f179e474bafbd71fac
2021-04-28 17:06:23 -07:00
Xavier Deguillard
04ba04fe88 nfs: bump buffer preallocation size
Summary:
Passing 64 to preallocate means that the AsyncSocket code will issue reads of
64 bytes, even though the IOBufQueue has significantly more space available. We
can thus pass a bigger size to preallocate to reduce both the cost of
allocation, and the syscall cost. For heavily concurrent client code, this will
allow us to read more than one request per syscall.

The careful reader may have noticed that for very small requests the code may
reallocate more often that it should as it will always reallocate when falling
under 4KB. This is likely to not be an issue in practice.

Reviewed By: kmancini

Differential Revision: D27976672

fbshipit-source-id: 4c7e3aecc4763ab20854f3c466ce0872332f9b77
2021-04-28 17:06:23 -07:00
Xavier Deguillard
4daf57cab6 nfs: various cleanup of Server.cpp
Summary:
These are various cleanups that should make the code easier to read, there is
no behavior changes.

Reviewed By: kmancini

Differential Revision: D27976673

fbshipit-source-id: 470eb628ca75bf1712a93c6e9aa3a27c3f314d01
2021-04-28 17:06:23 -07:00
Xavier Deguillard
3185c2f83e inodes: cache size for non-materialized inodes
Summary:
Running `rg foobar` in a loop and profiling EdenFS shows that we're spending a
significant amount of time collecting the size of non-materialized files. Since
this will never change, we can easily cache it for much faster access.

Reviewed By: chadaustin

Differential Revision: D27924804

fbshipit-source-id: 8b8af63dcb82664db2ecd81b3fcdc006a3a52d72
2021-04-28 17:06:23 -07:00
Alex Hornby
a709d203e4 mononoke: fix build
Summary: fix the build

Reviewed By: sfilipco

Differential Revision: D28069668

fbshipit-source-id: f50c302807b7b18ab3e8d7a9600a6e9f4d6a4a71
2021-04-28 16:53:10 -07:00
Yipu Miao
85b9f8ed3d creating RE CAS Digest proxy
Summary: Create a proxy that stored RECAS-> Eden Hash, similar to SCS and HG proxy.

Reviewed By: chadaustin

Differential Revision: D27873498

fbshipit-source-id: 0b3e50e3a74b8f0914547178789cb6684b780866
2021-04-28 14:59:39 -07:00
Yipu Miao
10dd235a48 creating RE CAS backing store with everything unimplemented.
Summary: Create a RE-CAS backing store with all APIs unimplemented, and Linux only.

Reviewed By: chadaustin

Differential Revision: D27771047

fbshipit-source-id: de00c6e290f924872eae7290b1945e6b3f40d610
2021-04-28 14:59:39 -07:00
Jun Wu
9bf34fe364 remotenames: pass list to pushop.remote.known
Summary:
The "known" API is expected to accept a list with ordering guarantees.
Avoid passing `set` to it. This also stabilizes debug outputs in (upcoming)
tests.

Update `setdiscovery` to pass a list with stable order too.

Reviewed By: kulshrax

Differential Revision: D27951627

fbshipit-source-id: a2718e4380f80584fc8afc35d14e524ab428f9bd
2021-04-28 12:28:28 -07:00
Jun Wu
20975cd6e7 pyedenapi: add commit graph and commit known APIs
Summary: Expose the Rust logic to Python.

Reviewed By: kulshrax

Differential Revision: D27951635

fbshipit-source-id: 541c768ccdd8d456dd82551daa3e60266373482a
2021-04-28 12:28:28 -07:00
Jun Wu
08349e7129 eagerepo: implement commit_graph and commit_known endpoints
Summary: They will be useful in the pull exchange path.

Reviewed By: kulshrax

Differential Revision: D27951625

fbshipit-source-id: 31dfd54cda7a0d0d0b2565e0ecddc2e82eebcc05
2021-04-28 12:28:28 -07:00
Jun Wu
0e501c05e1 edenapi: define commit_graph endpoint
Summary:
This will be used to migrate "pull" from bundle2 to EdenApi.
This diff just defines the interface in a minimal way.
Actual implementation is TBD.

Differential Revision: D27951634

fbshipit-source-id: 66210a833d8fc87452a19d1935e9d208a1d31b14
2021-04-28 12:28:28 -07:00
Jun Wu
e4044c718c edenapi: define commit_known endpoint
Summary:
This will be used to migrate "pull" from bundle2 to EdenApi.
This diff just defines the interface in a minimal way. Actual implementation is TBD.

I dropped the progress callback parameter since the native Rust progress bars
make it unnecessary. I also avoided the blocking API interface, since we would
like pure Rust code to not call blocking APIs which is likely a mistake, and
only use `async_runtime::block_on` in Python bindings - in that case blocking
API is not needed.

Reviewed By: andll

Differential Revision: D27951624

fbshipit-source-id: 3844dd96df265cc6e61d7cf5e79f39c891e8117d
2021-04-28 12:28:28 -07:00
Andrey Chursin
11eb0eb74e debugdryup: handle sparse profiles
Summary: This makes use of plan calculation logic in merge.py

Reviewed By: quark-zju

Differential Revision: D28045174

fbshipit-source-id: f2bfd1104ba2d010c2b911aa6c643b057e4cb91d
2021-04-28 12:26:08 -07:00
Andrey Chursin
9e05b5f6f2 checkout: factor out plan calculation in merge.py
Summary: This factors out native checkout plan calculation (including handling sparse profiles) into separate fn

Reviewed By: quark-zju

Differential Revision: D28045175

fbshipit-source-id: cd034b2c335496e5e2c6994795dd5c40d3388238
2021-04-28 12:26:08 -07:00
Jun Wu
3283fe0c4a pyeagerepo: bindings for eagerepo
Summary:
Add a way to construct the EagerRepo from Python, and use it to serve EdenApi.

Example in `hg dbsh`:

Prepare EagerRepo:

  In [2]: r=b.eagerepo.EagerRepo.open('/tmp/r1')

  In [3]: r.addsha1blob(b'1')
  Out[3]: '5j\x19+y\x13\xb0LTWM\x18\xc2\x8dF\xe69T(\xab'

  In [4]: r.getsha1blob(Out[3])
  Out[4]: '1'

  In [5]: r.addcommit?
  Docstring:
  Insert a commit. Return the commit hash.
  (parents: [node], rawtext: bytes) -> node
  Type:      builtin_function_or_method

  In [6]: c=r.addcommit([], 'commit 1')

  In [7]: c
  Out[7]: '\x8a\x8a\x0bq\x1e\xa4\x08\xd4\xa5\x14a\xc8\x95Y\xed\x8d$\xba1\x9a'

  In [8]: r.flush()

Use it to serve EdenApi:

  In [9]: e=r.edenapiclient()

  In [10]: e.commitdata?
  Docstring:
  commitdata(repo: str, nodes: [bytes], progress=None) -> [(node: bytes, data: bytes)], stats

  Fetch commit data in raw HG format (sorted([p1, p2]) + text).
  Type:      builtin_function_or_method

  In [11]: e.commitdata('', [c])
  Out[11]: (<stream at 0x7f96194bcc70>, <future at 0x7f96194bf810>)

  In [12]: list(e.commitdata('', [c])[0])
  Out[12]:
  [{'hgid': '\x8a\x8a\x0bq\x1e\xa4\x08\xd4\xa5\x14a\xc8\x95Y\xed\x8d$\xba1\x9a',
    'revlog_data': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00commit 1'}]

Reviewed By: andll

Differential Revision: D27951623

fbshipit-source-id: c5423d55b6359146e5a416c440d85f817e43396d
2021-04-28 12:24:27 -07:00
Jun Wu
72dba2a6fe pyedenapi: add from_edenapi
Summary:
Add a way to construct the Python EdenApi wrapper from a native Rust EdenApi instance,
bypassing the config, etc.

Reviewed By: kulshrax

Differential Revision: D27951622

fbshipit-source-id: 2e3d16a91e20c6aab6baced3dea60db9834fa103
2021-04-28 12:24:27 -07:00
Jun Wu
999a6ac749 eagerepo: implement EdenApi "bookmarks" endpoint
Summary: Implement the endpoint.

Reviewed By: andll

Differential Revision: D27951630

fbshipit-source-id: 64511ff52eb31395a4a6c4ec3a81a3eee8053431
2021-04-28 12:24:27 -07:00
Jun Wu
b2b7a58f58 eagerepo: implement EdenApi "commit_hash_to_location" endpoint
Summary: Implement the endpoint. Most of the complexity is type conversion.

Reviewed By: andll

Differential Revision: D27929203

fbshipit-source-id: ff865ae727e383cd2b465f8bcd1e29f0c9316ff6
2021-04-28 12:24:27 -07:00
Jun Wu
5920b3b927 eagerepo: implement EdenApi "commit_location_to_hash" endpoint
Summary: Implement the endpoint. Most of the complexity is type conversion.

Reviewed By: andll

Differential Revision: D27929201

fbshipit-source-id: b96f65a0173a31f716272c8e0dd47ce8a90759cd
2021-04-28 12:24:26 -07:00
Jun Wu
fc55fab9f9 eagerepo: implement EdenApi "clone_data" endpoint
Summary: Implement the endpoint.

Reviewed By: DurhamG

Differential Revision: D27929202

fbshipit-source-id: adda6a76f3d990edf6defcf1fd0f298e225f6370
2021-04-28 12:24:26 -07:00
Jun Wu
769f54228f dag: remove head_id from CloneData
Summary: This makes CloneData possible to represent an empty repo.

Reviewed By: sfilipco

Differential Revision: D27926246

fbshipit-source-id: 0bcead224ef5b89c66d07a34d8217edaef62177f
2021-04-28 12:24:26 -07:00
Jun Wu
ea7df1711e eagerepo: implement EdenApi "commit_revlog_data" endpoint
Summary: Implement the endpoint.

Reviewed By: kulshrax

Differential Revision: D27926248

fbshipit-source-id: dea1f69f4f53927188be503e1fdc5e1a6c4487fb
2021-04-28 12:24:26 -07:00
Jun Wu
64480ea512 eagerepo: implement EdenApi "trees" endpoint
Summary: Implement the endpoint. The child_metadata remains unsupported for now.

Reviewed By: kulshrax

Differential Revision: D27926253

fbshipit-source-id: 7d3d8be458462dc6e87080ce49754cf76b731794
2021-04-28 12:24:26 -07:00
Jun Wu
333dce9fa5 eagerepo: implement EdenApi "history" endpoint
Summary: Implement the file history API.

Reviewed By: kulshrax

Differential Revision: D27926252

fbshipit-source-id: b56406101810e29904b24591d744345924bde38c
2021-04-28 12:24:26 -07:00
Jun Wu
6cf5df2983 eagerepo: implement EdenApi "files" endpoint
Summary: Implement the files API. It's just reading content from the zstore.

Reviewed By: kulshrax

Differential Revision: D27926251

fbshipit-source-id: 54d04caa63e01b6ce5b9c785990c14043f7f22ad
2021-04-28 12:24:26 -07:00
Jun Wu
e1eb399245 eagerepo: implement EdenApi "health" endpoint
Summary: Implement the health API.

Reviewed By: kulshrax

Differential Revision: D27926249

fbshipit-source-id: 1cbaf7859132387c1260ca981164549721685b9f
2021-04-28 12:24:26 -07:00
Jun Wu
540adf776f eagerepo: prepare to implement EdenApi on EagerRepo
Summary: Add blank implementation. They will be filled later.

Reviewed By: kulshrax

Differential Revision: D27926254

fbshipit-source-id: 628961c2377893bf2c44633635d4dd3b99a41be1
2021-04-28 12:24:26 -07:00
Jun Wu
d5b2bf7750 eagerepo: add ways to read or write bookmarks
Summary: The will be useful for "push" logic.

Reviewed By: kulshrax

Differential Revision: D27951633

fbshipit-source-id: 38bbdc554f017d5776df0577b82fbb0c78d18a83
2021-04-28 12:24:25 -07:00
Jun Wu
8fd660fe13 eagerepo: add a way to add a commit to the commit graph
Summary:
This will be useful for "push" related logic.

The name "eager" is to make it explicit that the repo is not lazy.

Reviewed By: kulshrax

Differential Revision: D27951618

fbshipit-source-id: 8039059beba68d269c752bc8ed3e72bde0c55790
2021-04-28 12:24:25 -07:00
Jun Wu
bdf6f6f75f eagerepo: new crate for providing a local test repo that implements EdenApi
Summary:
Currently it's hard to test EdenApi related features in hg tests. The Mononoke
test suite can do it but it's too heavyweight. Looking at the API surface of
EdenApi it's actually quite small. So let's add a minimal Rust struct that can
serve as an EdenApi server.

This diff just adds a few minimal features. EdenApi related features and
push/pull support will be added later.

The name "eager" is to make it explicit that the repo is not lazy. I thought
about names like "testrepo" or "serverrepo", but the implementation is
somewhat "sound" to be used as a client, non-test repo. It can potentially
be used as starting point for a real "repo" in pure Rust. So I didn't choose
those names.

(I'm not entirely happy with the name but it's more like a placeholder
that makes it look different from other names for now).

Reviewed By: kulshrax

Differential Revision: D27926255

fbshipit-source-id: ad7a023de5e77605a553509de82ff13ae8112439
2021-04-28 12:24:25 -07:00
Jun Wu
f527306576 edenapi: move EdenApi trait to edenapi_trait
Summary:
This allows an external crate C that implements `EdenApi` to depend on a more
lightweight library just providing `EdenApi` without things like `hg_http`.
Then the `edenapi` crate can depend on C too.

Didn't move it to `edenapi_types` because it would add extra dependencies
(http, http_client, auth, etc.)

Reviewed By: kulshrax

Differential Revision: D28006548

fbshipit-source-id: 6e828974fd3f78fec70d4a04ae7be85abc459b36
2021-04-28 12:24:25 -07:00
Jun Wu
f811df8575 edenapi: make Builder more flexible
Summary:
The `Builder` API is the main API used by external users to obtain an `EdenApi`
client.  In the future we want to support different kinds of `EdenApi`, like a
local repo serving it, if `paths.default` is set to something like
`myrepotype:path`. Make `Builder` more flexible to support non-HTTP `EdenApi`s,
by returning `EdenApi` trait objects.

The old builder that is coupled with HTTP is renamed to HttpClientBuilder.

Reviewed By: kulshrax

Differential Revision: D28018586

fbshipit-source-id: 1eff7bbb8f0e5521a9bcf5a225ac361ddf7c310f
2021-04-28 12:24:25 -07:00
Jun Wu
b4316da4c4 edenapi: move User-Agent to builder
Summary:
This ensures the User-Agent is always set. It also makes the `header` less
unnecessary.

Reviewed By: DurhamG

Differential Revision: D28018587

fbshipit-source-id: 1125d2122431579f127e81c4713de45135b1f972
2021-04-28 12:24:25 -07:00
Jun Wu
4103dc2cef edenapi: re-export more stuff
Summary:
Make it easier to use.

This makes it easier for other crates to use `edenapi::Result<T>`, which is
a bit shorter than `Result<T, EdenApiError>`. Also re-export `Metadata`
from revisionstore-types so callsite does not need to depend on
revisionstore-types explicitly.

Reviewed By: kulshrax

Differential Revision: D27926250

fbshipit-source-id: c85198b5c151e10a2d4d2567e23e32605a3e7c36
2021-04-28 12:24:25 -07:00
Johan Schuijt-Li
c66bd43f3f allow auth_proxy settings to come from local
Summary: Ensure these settings are available in mononokepeer.

Reviewed By: mitrandir77

Differential Revision: D28061520

fbshipit-source-id: 68cbe9f427d4a1528a4c9968b3f1f9dcd2541004
2021-04-28 12:12:47 -07:00
Aida Getoeva
54c4a17e16 mononoke: remove async on FbConstruct methods
Summary: The methods don't do anything async anymore, let's remove `async`.

Reviewed By: krallin

Differential Revision: D28026899

fbshipit-source-id: 571eb2a1ba499876042c6e89770c803ac731cfe3
2021-04-28 11:14:52 -07:00
Stefan Filip
35bdda2e88 handlers: add commit/hash_lookup
Summary:
New endpoint. This endpoint can be used for prefix lookup and the contains
check.

Reviewed By: quark-zju

Differential Revision: D28034533

fbshipit-source-id: d724b85c3816414475b142215e3052d0b555cf59
2021-04-28 10:21:52 -07:00
Stefan Filip
27b15bfa06 edenapi/types: add CommitHashLookup request/response structs
Summary:
These structures are going to be used to implement the `commit/hash_lookup`
endpoint in EdenApi.

Reviewed By: quark-zju

Differential Revision: D28034532

fbshipit-source-id: 7b00d0d97dd0593dfa43834cda9fc9e9ab9021c5
2021-04-28 10:21:51 -07:00
Stefan Filip
324668be85 edenapi/types: add Batch
Summary:
Generic container for a bunch of uniform objects. This is primarily intended
for requests and responses which can be difficult to evolve when the top level
object is an array.  For cases where evolution is required we would
probably replace the Batch wrapper with a specialized type. For example,
starting from `Batch<MyRequest>` we would change to:
  struct MyRequestBatch {
    pub batch: Vec<T>,
    pub evolution: Evolution,
  }

Reviewed By: quark-zju

Differential Revision: D28034534

fbshipit-source-id: d231c063eeacf3500b75ae76bcc101ccbcda8881
2021-04-28 10:21:51 -07:00
Stefan Filip
4d65afb5c2 bonsai_hg_mapping: add get_hg_in_range
Summary:
I want to add prefix lookup functionality to EdenApi.

I considered adding some sort of prefix abstraction to Hg or our wire types.
so that I could use the method that was already implemented. I found the
serialization and conversion logic complicated to reason about.  It is easier
to transform the prefix query in a range query and add a range query endpoint.
No need to invent new fancy types and deal conversions.

This diff updates the prefix query implementation to rely on the range query.
The range query is functionality that is more general than prefix lookup.

Reviewed By: quark-zju

Differential Revision: D28034531

fbshipit-source-id: 491db2354e3804c4cea6db16fe7d056a962515f7
2021-04-28 10:21:51 -07:00
Thomas Orozco
0f44a4f106 mononoke: update to tokio 1.x
Summary:
NOTE: there is one final pre-requisite here, which is that we should default all Mononoke binaries to `--use-mysql-client` because the other SQL client implementations will break once this lands. That said, this is probably the right time to start reviewing.

There's a lot going on here, but Tokio updates being what they are, it has to happen as just one diff (though I did try to minimize churn by modernizing a bunch of stuff in earlier diffs).

Here's a detailed list of what is going on:

- I had to add a number `cargo_toml_dir` for binaries in `eden/mononoke/TARGETS`, because we have to use 2 versions of Bytes concurrently at this time, and the two cannot co-exist in the same Cargo workspace.
- Lots of little Tokio changes:
  - Stream abstractions moving to `tokio-stream`
  - `tokio::time::delay_for` became `tokio::time::sleep`
  - `tokio::sync::Sender::send` became `tokio::sync::Sender::broadcast`
  - `tokio::sync::Semaphore::acquire` returns a `Result` now.
  - `tokio::runtime::Runtime::block_on` no longer takes a `&mut self` (just a `&self`).
  - `Notify` grew a few more methods with different semantics. We only use this in tests, I used what seemed logical given the use case.
- Runtime builders have changed quite a bit:
  - My `no_coop` patch is gone in Tokio 1.x, but it has a new `tokio::task::unconstrained` wrapper (also from me), which I included on  `MononokeApi::new`.
  - Tokio now detects your logical CPUs, not physical CPUs, so we no longer need to use `num_cpus::get()` to figure it out.
- Tokio 1.x now uses Bytes 1.x:
  - At the edges (i.e. streams returned to Hyper or emitted by RepoClient), we need to return Bytes 1.x. However, internally we still use Bytes 0.5 in some places (notably: Filestore).
  - In LFS, this means we make a copy. We used to do that a while ago anyway (in the other direction) and it was never a meaningful CPU cost, so I think this is fine.
  - In Mononoke Server it doesn't really matter because that still generates ... Bytes 0.1 anyway so there was a copy before from 0.1 to 0.5 and it's from 0.1 to 1.x.
  - In the very few places where we read stuff using Tokio from the outside world (historical import tools for LFS), we copy.
- tokio-tls changed a lot, they removed all the convenience methods around connecting. This resulted in updates to:
  - How we listen in Mononoke Server & LFS
  - How we connect in hgcli.
  - Note: all this stuff has test coverage.
- The child process API changed a little bit. We used to have a ChildWrapper around the hg sync job to make a Tokio 0.2.x child look more like a Tokio 1.x Child, so now we can just remove this.
- Hyper changed their Websocket upgrade mechanism (you now need the whole `Request` to upgrade, whereas before that you needed just the `Body`, so I changed up our code a little bit in Mononoke's HTTP acceptor to defer splitting up the `Request` into parts until after we know whether we plan to upgrade it.
- I removed the MySQL tests that didn't use mysql client, because we're leaving that behind and don't intend to support it on Tokio 1.x.

Reviewed By: mitrandir77

Differential Revision: D26669620

fbshipit-source-id: acb6aff92e7f70a7a43f32cf758f252f330e60c9
2021-04-28 07:36:31 -07:00
CodemodService FBSourceClangFormatLinterBot
63c0e35bd7 Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D28053932

fbshipit-source-id: d2f903158c49a41a0a19df5cf1af540ba9f90a98
2021-04-28 04:38:27 -07:00
Aida Getoeva
bb3d207e33 mononoke: remove myrouter from Mononoke
Summary:
MyRouter is no longer used by Mononoke services, it is deprecated and will stop working when we upgrade the tokio.

This diff removes MyRouter support from Mononoke and simplifies the Mysql connection type struct.
Before we had `MysqlOptions` and `MysqlConnectionType` enum to represent what kind of a client we want to use. Now we use only MySQL FFI so I removed `MysqlConnectionType` completely and put everything into the options struct.

As setting up the connections (aka conn pool) is not an async operation, some of the methods don't need to be async anymore. Because this diff is already enormous, I'm refactoring this in the next one.

Reviewed By: StanislavGlebik

Differential Revision: D28007850

fbshipit-source-id: 32c3740f4bb132f06e1e256b0530ace755446cdd
2021-04-28 03:43:48 -07:00
Andrey Chursin
9c0304b1e1 checkout: introduce debugdryup command
Summary:
This command executes native checkout dry run code for updating between specificed revisions
Command tests network and storage perf, without actually affecting working copy

Examples of usages:
1) User reports that when updating between revisions multiple times, they see unexpected fetches, even though they expected that all data should already be in cache. Running this command shows that update between those revs fetches more data then a cache size, so repating fetches are not a surprise

2) People working on storage/network layer optimizations can utilize this command to test performance without messing with their working copy

This command understands nativecheckout.usescmstore config, same way it is used in actual native checkout

Differential Revision: D28040641

fbshipit-source-id: e5454f3110ade11f3227d6adc804a22176f530b9
2021-04-28 02:14:44 -07:00