Commit Graph

7783 Commits

Author SHA1 Message Date
Chad Austin
e146f08d9a indicate to coreutils that edenfs is a remote filesystem
Summary:
GNU `df` (and any other coreutil that relies on gnulib's ME_REMOTE
flag) detects remote filesystems with some heuristics. One of which is
whether the device type contains a colon. Since edenfs is a remote
filesystem, include a colon, so it's properly detected as such.

Reviewed By: genevievehelsel

Differential Revision: D24174015

fbshipit-source-id: 4b1f2f49c6eee6e690a6f570924274060a66eee7
2020-10-19 12:13:54 -07:00
Stanislau Hlebik
6c634f94ee mononoke: admin command to change mapping version
Summary:
We'll use this command to change the mapping version we use when doing push
redirection.

Reviewed By: ikostia

Differential Revision: D24392308

fbshipit-source-id: 4dab01c0e58a8953a0c6c84c7c166977a6baf00f
2020-10-19 09:46:29 -07:00
Stanislau Hlebik
9ec52564c7 mononoke: force users to specify mapping version in
Summary:
Previously it was just taking the current version. Instead of guessing let's
allow users to specify whatever version they want to rewrite it with.

Reviewed By: ikostia

Differential Revision: D24360918

fbshipit-source-id: d9f4c55cd66931a9f2ab7da3474d2152d77525d0
2020-10-19 09:46:29 -07:00
Stanislau Hlebik
631d1da786 mononoke: remove update_mapping method
Summary:
update_mapping method was silently setting current mapping version. This was
very error-prone and we had a replacement update_mapping_with_version. This
diff removes update_mapping completely.

Reviewed By: krallin

Differential Revision: D24360105

fbshipit-source-id: 57761f4279f75032e9d4ec88a45e5199e250247a
2020-10-19 09:46:29 -07:00
Stanislau Hlebik
5bce95a9d7 mononoke: remove copy-paste initialization of CommitSyncer
Reviewed By: krallin

Differential Revision: D24360097

fbshipit-source-id: bb4fd2de905731a2780ff9cb49f0174a3c0bbdd6
2020-10-19 09:46:29 -07:00
Pavel Aslanov
d752cfa651 batched tailing mode
Summary:
This diff add new mode of tailing based on derived data graph, it uses same functionality as backfill.
- `tail_batch_iteration` uses `bounded_traversal_dag` directly instead of leveraging `DeriveGraph::derive` so we could warm-up dependencies for each node before calling `DerivedUitls::backfill_batch_dangerous`

Reviewed By: StanislavGlebik

Differential Revision: D24306156

fbshipit-source-id: 006cb6d4df9424cd6501cb4a381b95f096e70551
2020-10-19 07:30:03 -07:00
Lukas Piatkowski
87db93687e rust/shed/hostname: rename hostname dependency to unbreak doctests (#15)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: https://github.com/rust-lang/cargo/issues/6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
2020-10-19 07:21:38 -07:00
Thomas Orozco
fde21ba026 mononoke/lfs_server: log client attempt
Summary:
I updated the client to send this earlier this week. Let's start collecting it
server side. The bottom line is this will let us identify when we reject a
client that is done retrying.

Reviewed By: HarveyHunt

Differential Revision: D24361884

fbshipit-source-id: b31e53c7dc989f1698e28b2a0bf14dc3fdbb507a
2020-10-19 05:01:57 -07:00
Jan Mazur
d7cf79cf5a print regex when rejecting a file
Summary: It will be much more convenient for end user to know why certain limit is enforced.

Reviewed By: krallin

Differential Revision: D24364473

fbshipit-source-id: ad86384f7f7a246bc3735028339cfd54a1d0254a
2020-10-19 03:27:50 -07:00
Jan Mazur
805523a1f9 adjust integration tests because of changed IpAddr Debug trait
Summary:
I think that this: 6293dca1e8
"broke" (in a sense that they need to be adjusted - run with --interactive) some of our integration tests.
In fbcode seem like it was D24363513.
This commit deleted derived Debug trait of enum IpAddr in favor of implementing it with already existing fmt::Display.
I think this change landed with rust 1.7.0 which hit fbcode recently.

Reviewed By: StanislavGlebik

Differential Revision: D24382155

fbshipit-source-id: bce5998015bfdd7c0b01a5c6ee5a661f9f00df5a
2020-10-19 01:30:28 -07:00
Chad Austin
bef06ca978 don't load hidden config files
Summary:
Chef writes root-owned temporary files in /etc/eden/config.d. If
edenfsctl attempts to read those configs at this time, it will
fail. Just skip all hidden files.

Reviewed By: kmancini

Differential Revision: D24377953

fbshipit-source-id: 765b7f096b62e6749e186adc3e90bbc7814079c8
2020-10-16 20:50:32 -07:00
Chad Austin
83dbe9d985 compute deterministic paths in debugInodeStatus
Summary:
InodeBase::getPath is not deterministic under concurrent
renames. Instead, thread the paths down through the recursion so
they're consistent.

Reviewed By: genevievehelsel

Differential Revision: D24297724

fbshipit-source-id: 3e8664ce2bc5159e464d1d76ed37294c4eac1709
2020-10-16 19:13:19 -07:00
Jun Wu
6dac514fae continue: pass --noninteractive to continued command
Summary: This preserves the `--noninteractive` flag used by some tools.

Reviewed By: DurhamG

Differential Revision: D24040789

fbshipit-source-id: 8d50f3f3ce6b2015f0ef6c3bd1b4fbb874d0ea7d
2020-10-16 18:40:51 -07:00
Jun Wu
b36584e704 configparser: set ui.merge:interactive from ui.merge in user config
Summary:
This restores the compatibility of setting up merge tools using the `ui.merge`
config while still limiting the default `editmerge` tool to interactive
sessions.

Reviewed By: sfilipco

Differential Revision: D24377259

fbshipit-source-id: 3d2befba412b824fc985ddffa131e339644178c2
2020-10-16 18:33:06 -07:00
Jun Wu
122108e46e configparser: move load_user to a testable method
Summary: Make it testable by allowing specifying paths to load as user hgrc.

Reviewed By: sfilipco

Differential Revision: D24377258

fbshipit-source-id: 969028df64d55ad1f1304e35675d84595ed6a2bf
2020-10-16 18:33:06 -07:00
Lukas Piatkowski
1b5293d584 mononoke/integration: create a Makefile to run tests as part of getdeps.py build (#67)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/67

With this change it will be possible to build dependencies of and run integration tests using getdeps.py.

This is the first goal of Q4 as per https://fb.quip.com/v8YzAYNSYgot: "Get Open Source version of integration tests running on Legocastle".

Before this diff:
The OSS integration tests run now on GitHub by:
- Building some test dependencies with getdeps.py
- Building some test dependencies with homebrew/apt-get
- Running tests via python script

The OSS integration tests were not running on Sandcastle.

After this diff:
The OSS integration tests run on Github by:
- Building and executing tests via getdeps.py (execution of tests happens by getdeps.py calling Make calling python script)

The OSS integration tests run on Sandcastle using the same getdeps.py setup as Github.

Reviewed By: krallin

Differential Revision: D24253268

fbshipit-source-id: cae249b72d076222673b8bbe4ec21866dcdbb253
2020-10-16 12:23:33 -07:00
Arun Kulshreshtha
d16a62ce06 edenapi: send user agent string
Summary:
Include a `User-Agent` header in EdenAPI requests from Mercurial. This will allow us to see the version in Scuba, and in the future, will allow us to distinguish between requests send by Mercurial and those sent directly by EdenFS.

Keeping with the current output of `hg version`, the application is specified as "EdenSCM" rather than "Mercurial".

Reviewed By: singhsrb

Differential Revision: D24347021

fbshipit-source-id: e323cfc945c9d95d8b2a0490e22c2b2505a620dc
2020-10-16 11:05:24 -07:00
Stanislau Hlebik
76ae65bd46 mononoke: add subcommand to prepare pushredirection rollout
Reviewed By: krallin

Differential Revision: D24282770

fbshipit-source-id: dd8a6951048f238bb4b24cec4f669a1a58a7adee
2020-10-16 10:49:19 -07:00
Kostia Balytskyi
0ae6fcbddb cross_repo_sync: tweak validation logging
Summary: Log more stuff at `debug!`.

Reviewed By: StanislavGlebik

Differential Revision: D24361631

fbshipit-source-id: fb4d46eac11ef70a9a1ee8645ed0efcc4035b594
2020-10-16 10:45:45 -07:00
generatedunixname89002005325677
3bd11a5817 Daily arc lint --take RUSTFMT
Reviewed By: zertosh

Differential Revision: D24357892

fbshipit-source-id: dec7969a8bb9302689e4a10656a60e1a38daef80
2020-10-16 10:41:29 -07:00
Simon Farnsworth
3c7ce4eed1 hg histedit: document autoverb badly
Summary: This was competely undocumented, and thus undiscoverable. Add some documentation, so that it's at least clear the feature exists

Reviewed By: singhsrb

Differential Revision: D24332961

fbshipit-source-id: 9e73163a9314ceb7f953a3b1ac0f58c9a6e6d4d9
2020-10-16 09:30:28 -07:00
Thomas Orozco
ada1d7e7a9 mononoke/{multiplexedblob,logblob}: capture operation perf counters
Summary:
This updates multiplexedblob and logblob to capture perf counters for the
operations we run, and log them to Scuba. Along with the previous diffs in this
stack, this gives us the number of Manifold retries, total delay, and conflicts
all logged to blobstore trace on a per-operation basis.

Reviewed By: HarveyHunt

Differential Revision: D24333039

fbshipit-source-id: 9c7d0a467f8df08dcb2a0d3bb6b543cdb3ea1d90
2020-10-16 08:57:13 -07:00
Thomas Orozco
63158883e3 mononoke/manifoldblob: log retries, delay and conflicts to perf counters
Summary:
This updates ManifoldBlob to log the aformentioned data points to perf
counters. There's a bit of refactoring that also had to go into this to make
`ctx` available everywhere it's needed.

Reviewed By: aslpavel

Differential Revision: D24333040

fbshipit-source-id: 1b63bcd1e1ee36bae4dbbc1da053c7f1bdf96675
2020-10-16 08:57:13 -07:00
Thomas Orozco
80bb3074bc mononoke/context: allow forking perf counters
Summary:
This adds support for "forking" perf counters at a point in the stack, giving
you a CoreContext that logs to one or more sets of perf counters.

This is useful for low level operations where we want to collect granular more
logging data — in particular blobstore operations, where we'd like to collect
the time spent waiting for Manifold retries or the number of Manifold retries
in blobstore trace for each individual blobstore operation (we can't do that
using the `CoreContext` we have because that would be missing

The implementation supports a list of reference counted perf counters in the
CoreContext. When you want to add a new counter, we replace the list with a new
one, and give you a reference to the one you just added. When you write, we
write to all perf counters, and when you read, we read from the "top" perf
counter (which is always there). To read from one of the forked counters, you
use the reference you got whne you created it.

Reviewed By: aslpavel

Differential Revision: D24333041

fbshipit-source-id: ce318dfc04a1ea435b2454b53df4cae93d57c0a5
2020-10-16 08:57:13 -07:00
Stanislau Hlebik
4931e6654b mononoke: add a tool that backfills noop mapping
Summary:
The x-repo usually have "noop" mapping i.e. mapping that doesn't change the
paths (it might have arbitrary name though)

It's useful for commits that are identical between small and large repo to be
able to backfill this mapping. This diff adds a command to do that.

Reviewed By: krallin

Differential Revision: D24337281

fbshipit-source-id: 89a058f95677e4a5c8686122a317eadf8b1bb995
2020-10-16 08:47:04 -07:00
Stanislau Hlebik
4e0280a42e mononoke: refactor waiting for replication from run_mark_not_synced
Summary: It will be used in the next diff, so let's move it to a separate function.

Reviewed By: krallin

Differential Revision: D24334717

fbshipit-source-id: e50d13d45c633397504cf08954f2ced9ace8f570
2020-10-16 08:47:04 -07:00
Stanislau Hlebik
051d0d1ef4 mononoke: add a tunable to disable pushredirected hooks
Reviewed By: ikostia

Differential Revision: D24360325

fbshipit-source-id: b1b5e062c2d9b7af867bf9258d7a2b78d2f26629
2020-10-16 08:24:56 -07:00
Pavel Aslanov
4190463c33 convert derived data utils to new futures
Summary: Convert derived data utils to use new style futures

Reviewed By: StanislavGlebik

Differential Revision: D24331068

fbshipit-source-id: ad658b278802afa1e4ecd44c5a24164135748790
2020-10-16 07:46:07 -07:00
Jan Mazur
274d46b7a0 change limit_filesize hook to operate fully on regexes and per-regex limits
Summary: See summary in D24161361

Reviewed By: krallin

Differential Revision: D24190905

fbshipit-source-id: 75311425ba4296925d761f89a2d24cbbb5bebd03
2020-10-16 07:34:43 -07:00
Thomas Orozco
a4dd2d43ed mononoke/filestore: add missing error cause
Summary:
This is needed to be able to use `has_redaction_root_cause()` with a metadata
rebuilding error.

Reviewed By: StanislavGlebik

Differential Revision: D24360816

fbshipit-source-id: 388df8cedb769ff001bfe4ff9cd5063ccd9de9f1
2020-10-16 07:04:12 -07:00
Kostia Balytskyi
a4f69ed7da commit_rewriting: allow non-prefix free maps in metaconfig
Summary:
This is in line with other changes we're making to map logic now. Note that
apart from checking in-repo prefix-free-ness of the map, this also checked the
same across many small repos. It probably does not make sense to do that either
now that we allow non-prefix free maps within a repo.

Reviewed By: StanislavGlebik

Differential Revision: D24348161

fbshipit-source-id: caaa22953c8a15a08607157b99c9f0fd0edf633f
2020-10-16 05:16:58 -07:00
Kostia Balytskyi
7af104b330 hooks: bypass more hooks for push-redirected pushes
Summary:
Until we have the same standards for the native and push-redirected pushes,
these need to be automatically bypassed.

Reviewed By: krallin

Differential Revision: D24357372

fbshipit-source-id: f85459145f6a5217c07445d7017f3b11ed1284a7
2020-10-16 04:25:56 -07:00
Stanislau Hlebik
9810413295 mononoke: use sync_commit_and_ancestors in mononoke_x_repo_sync_job once
Summary:
Except for the tail mode of x_repo_sync_job which we use normally there's also
"once" mode which means "sync a single commit". Previously it did just that -
synced a single commit and failed if parents of this commit weren't synced.

However this is very unpleasant to use - instead let's change the semantics to
sync the commit and all of its ancestors.

also I made target_bookmark an optional parameter - sometimes we just want to sync a commit without any bookmarks at all.

Reviewed By: mitrandir77

Differential Revision: D24135771

fbshipit-source-id: 341c1808a44c58f89536b8c07394b77d8ced3f37
2020-10-16 02:37:45 -07:00
David Tolnay
0fe0538058 Clean up warning on stabilized str_strip, inner_deref features
Summary: These were stabilized in 1.45.0 and 1.47.0 respectively.

Reviewed By: StanislavGlebik

Differential Revision: D24353680

fbshipit-source-id: f2afe906e5260b1b360455acc20d9a806c988c9c
2020-10-16 00:08:15 -07:00
Xavier Deguillard
9db1fcdee8 inodes: do not ignore errors when computing sha1
Summary:
On Windows, computing the sha1 of a materialized file requires opening up the
file in the working copy, as the file is cached there. Interestingly, this
potentially means that for computing the sha1 of a file, EdenFS may receive a
callback from ProjectedFS about that file or a parent directory. At this point,
EdenFS just refuses to serve this callback, as doing so may trigger an infinite
loop, or simply deadlocks. While this may sound weird, recursive callbacks are
not expected, as this signify that EdenFS view of the working copy doesn't
match what it actually is.

To close the loop, and from a code perspective, this means that computing the
sha1 of a file can fail and can throw an exception. Unfortunately, the code
didn't reflect this fact and exceptions were simply ignored, when that happens
during a checkout operation, this can leave the working copy in a weird state,
further agravating the mismatch between EdenFS view of the working copy, and
what it actually is.

Reviewed By: wez

Differential Revision: D24282048

fbshipit-source-id: 745af03189fe345150f0b1792ee1b37a1b8fb0d4
2020-10-15 23:57:11 -07:00
Jun Wu
7b132fb6e2 smartlog: stop filtering commits by date
Summary:
The hide-before config was added to encourage people to actively hide unused
drafts for repo performance, instead of keeping unused draft forever, since a
lot of code paths assume `len(draft)` is small. See D13993584 (28b4dfbb38) for more context.

Now our hide-before data is set to 2.5 years ago (2018-2-25), this change
probably only affects a very small number of users.

Reviewed By: DurhamG

Differential Revision: D24298198

fbshipit-source-id: 938aca1222b55e09fdb058ff01bc063733f201dc
2020-10-15 22:48:41 -07:00
Jun Wu
e39f3bc233 revisionstore: add mutex for tests related to env vars
Summary:
Rust tests run in multiple threads. Setting environment variables affects other
tests running in other threads and causes random test failures.
Protect env vars using a lock.

Reviewed By: DurhamG

Differential Revision: D24296639

fbshipit-source-id: db0bee85625a7b63e07b95ea76d96029487881d4
2020-10-15 22:48:41 -07:00
Jun Wu
263d1c5a7f hg: reduce flakiness of cargo tests
Summary:
The shell-script cargo tests seem very flaky. Use a dedicated Python script to
run the tests, with a more concise output that only includes failures, and run
tests in parallel.

Reviewed By: DurhamG

Differential Revision: D24296433

fbshipit-source-id: 1d63146c6c84f1035dded24fcd3d79f116c2e740
2020-10-15 22:48:41 -07:00
Durham Goode
174f05f3fb convert: disable p4 tests on Python 3
Summary:
Ideally we'd just delete the p4 convert functionality, but I'm too lazy
to go through and extract it right now.

This was recently enabled when I enabled all the convert tests.  We don't use the p4 logic, so it's safe to just turn back off to get a release out.

Reviewed By: quark-zju

Differential Revision: D24352068

fbshipit-source-id: 6f3a1f88739b2e2348aff00e8cae333473bbe71a
2020-10-15 22:23:24 -07:00
Durham Goode
335988858e ui: fix prompt on Windows
Summary: My recent change accidentally returned early when reading the prompt input, which skipped the \r truncation needed for Windows.

Reviewed By: sfilipco

Differential Revision: D24350672

fbshipit-source-id: 4a589d76bf41cda7fda2518003ef272f9a6ead48
2020-10-15 22:19:38 -07:00
Xavier Deguillard
18a313cba0 inodes: make invalidating inodes fallible
Summary:
While on Linux these can't fail (or, to be more precise: it doesnt' matter),
they can on Windows. One such exemple is when a user lock a file and triggers
an update that modifies this file. The invalidation will fail, and thus the
update should keep track of that file not being updated properly.

Previously, the invalidation would raise an exception, but that proved to be
the wrong approach as some state would need to be rolled back which the
exception didn't help in. For that, let's just return a Try and make sure that
we handle all the cases properly.

Reviewed By: chadaustin

Differential Revision: D24163672

fbshipit-source-id: ac881984138eefa65c053478a160e2a653fd3fdf
2020-10-15 17:31:13 -07:00
Jeremy Fitzhardinge
8e8006d241 rust: update rust to 1.47.0
Summary:
Update from 1.44.0. Updates have been blocked because of a bad interaction
between platform007+mode/opt-clang-thinlto+gold. Now that the default linker is
lld, perhaps this is no longer an issue.

Various tweaks due to updates:
- `atomic_min_max`, `const_transmute`, `inner_deref`, `ptr_offset_from` and `str_strip`  are now stable
- `asm` renamed to `llvm_asm`
- `intra_doc_link_resolution_failure` lint renamed to `broken_intra_doc_link` (ndmitchell I didn't fix Gazebo because you'd explicitly suppressed the warning - I'll let you work out what to do with that)

(This is caused by incompatibility between the llvm used by rustc in
platform007 and llvm-fb. In platform009, rustc uses llvm-fb directly so there's
no scope for incompatibility.)

Reviewed By: dtolnay

Differential Revision: D24288638

fbshipit-source-id: 5155d85c186fd79d3cc86cb0bb554ab77d76c12c
2020-10-15 17:28:02 -07:00
Alex Hornby
956845df54 mononoke: prepare for use of new futures in derived data
Summary: Rename futures01 types from Foo to Foo01 in the top level lib.rs and derive_impl.rs files in preparation for adding a trait method that returns new futures

Reviewed By: aslpavel

Differential Revision: D24311165

fbshipit-source-id: 4f3b12ba3eaf8023959d6d4bbb4568d191b1fffb
2020-10-15 14:07:47 -07:00
Kostia Balytskyi
8a98c4aefc megarepotool: add run-mover subcommand
Summary: This allows the user to see how the mover of a particular version operates on any given path.

Reviewed By: StanislavGlebik

Differential Revision: D24335975

fbshipit-source-id: f67847112eb0d3c8c49584604e2f9d93579cdde4
2020-10-15 12:12:13 -07:00
Thomas Orozco
151a7f1d26 mononoke/integration: make the test-commitcloud-XXXfiller tests work
Summary:
Those tests are kinda broken in a number of ways right now.

First, they try to connect to a prod DB to record what bundle they just pushed.
That's not ideal, so this adds a flag to have them not do this.

Second, they are racy by design, and they mostly don't pass at tall in
mode/dev.

The way we make the tests run here is by having them forwardfill for 10 seconds
then give up, and we hope that during that time, they've fetched the bundles
they should fetch from SQL, and synced them. However, that's not really
sufficient because establishing your first connection to SQL from a mode/dev
binary is quite slow, so in the 10 seconds, you might pick up your first
bundle, start replaying it, then exit before you get to the second one.

To fix this, this diff updates the fillers to expect a specific number of
bundles to replay. We still have a limit on the number of total iterations to
avoid letting the tests hang if the number of bundles isn't the one we expect.

Fixing this revealed further breakage, which I solved earlier in this stack.
Unfortunately, it's not sufficient to make test-commitcloud-reversefiller.t
work on Python 3, because the infinitepush extension appears to be broken
server side. I'll file a task for the Mercurial oncall for that.

Reviewed By: mitrandir77

Differential Revision: D24277474

fbshipit-source-id: 0a5e1f7db8dc0c0068b0fc203abc0503226107ec
2020-10-15 12:01:27 -07:00
Durham Goode
4bebe853fd remotefilelog: add debug output for pack fetching
Summary:
We're seeing slow pack fetches in some cases. Let's add some extra
debug output to get more information.

Reviewed By: quark-zju

Differential Revision: D24295593

fbshipit-source-id: b5a5bdf169a8c05a3143da09d69646a7a742ef08
2020-10-15 11:19:24 -07:00
Durham Goode
9da5707131 checkout: disable fetching history during checkout
Summary:
We're seeing history fetching take quite a while during checkout and
rebase, but it's not really necessary for a checkout. In addition to it being
slow, if memcache doesn't have the history entry we'll fall back to a full
revision fetch from the server, which includes data. Let's disable prefetching
history during checkout.

Reviewed By: quark-zju

Differential Revision: D24295594

fbshipit-source-id: 70aa6e1925074b6546626a5192a7562d6da31f2b
2020-10-15 11:19:23 -07:00
Durham Goode
e60d023263 infinitepush: fix sql integration on Python 2
Summary:
My recent diff changed these lines from `bytes(value)` to
`pycompat.decodeutf8(value)`, since we want these to be strings. Unfortunately,
on python 2 decodeutf8() just passes the value straight through, so in cases
where we're handed bytearray, we pass that through instead of converting it to
bytes. Some down stream consumers requires it to be bytes.

Let's conditionally turn it to bytes.

Reviewed By: krallin

Differential Revision: D24307818

fbshipit-source-id: a0cc64b7e2cf7645586e633e7a4a382b69390e15
2020-10-15 11:16:46 -07:00
Thomas Orozco
0b083a74b1 mononoke/blobrepo_hg: optimize case conflict check performance
Summary:
Our case conflict checking is very inefficient on large changesets. The root
cause is that we traverse the parent manifest for every single file we are
modifying in the new changeset.

This results in very poor performance on large changes since we end up
reparsing manifests and doing case comparisons a lot more than we should. In
some pathological cases, it results in us taking several *minutes* to do a case
conflict check, with all of that time being spent on CPU lower-casing strings
and deserializing manifests.

This is actually a step we do after having uploaded all the data for a commit,
so this is pure overhead that is being added to the push process (but note it's
not part of the pushrebase critical section).

I ended up looking at this issue because it is contributing to the high
latencies we are seeing in commit cloud right now. Some of the bundles I
checked had 300+ seconds of on-CPU time being spent to check for case
conflicts. The hope is that with this change, we'll get fewer pathological
cases, and might be able to root cause remaining instances of latency (or have
that finally fixed).

This is pretty easy to repro.

I added a binary that runs case conflict checks on an arbitrary commit, and
tested it on `38c845c90d59ba65e7954be001c1eda1eb76a87d` (a commit that I noted
was slow to ingest in commit cloud, despite all its data being present already,
meaning it was basically a no-op). The old code takes ~3 minutes. The new one
takes a second.

I also backtested this by rigging up the hook tailer to do case conflict checks
instead (P145550763). It is about the same speed for most commits (perhaps
marginally slower on some, but we're talking microseconds here), but for some
pathological commits, it is indeed much faster.

This notably revealed one interesting case:

473b6e21e910fcdf7338df66ee0cbeb4b8d311989385745151fa7ac38d1b46ef (~8K files)
took 118329us in the new code (~0.1s), and 86676677us in the old (~87 seconds).

There are also commits with more files in recent history, but they're
deletions, so they are just as fast in both (< 0.1 s).

Reviewed By: StanislavGlebik

Differential Revision: D24305563

fbshipit-source-id: eb548b54be14a846554fdf4c3194da8b8a466afe
2020-10-15 09:49:39 -07:00
Thomas Orozco
1dc25648bf mononoke/types: indicate what path conflicted in a case conflict
Summary:
I'm reworking some of our case conflict handling, and as part of this, I'm
going to be using check_case_conflicts for all our checking of case conflicts,
and notably for the case where we introduce a new commit and check it against
its parent (which, right now, does not check for case conflicts).

To do this and provide a good user experience (i.e. indicate which files
conflicted and with what), I need `check_case_conflicts` to report what files
the change conflicts with. This is what this diff does.

This does mean a few more allocations, so I "paid those off" by updating our
case lowering to allocate one fewer Vec and one fewer String per MPathElement
being lowercased.

Reviewed By: StanislavGlebik

Differential Revision: D24305562

fbshipit-source-id: 8ac14466ba3e84a3ee3d9216a84c2d9125a51b86
2020-10-15 09:49:39 -07:00