Commit Graph

59709 Commits

Author SHA1 Message Date
Alex Hornby
5631157574 mononoke: use sorted_vector_map when parsing hg manifest blob
Summary:
Use sorted_vector_map when parsing hg manifest blob, as blobs are usually stored sorted, which can result in high cost of BTree insertion when traversing large repos.

Also uses the size_hint() from the parsing Split to save reallocations during insert.

Reviewed By: markbt

Differential Revision: D22975883

fbshipit-source-id: 1faff754f03d7b2c20ebb741fec4f97b310852f9
2020-08-12 02:51:17 -07:00
Xavier Deguillard
7f5439da0e eden: add a cat_tree command
Summary:
When running `edenfsctl prefetch **/BUCK` with an empty hgcache, EdenFS ends up
asking mercurial for every manifest one by one. Unfortunately, every manifest
fetched also causes the packfile to be flushed to disk, which then leads EdenFS
to rescan the filesystem for the new packfile. Once too many packfiles are
present on disk, Mercurial triggers a repack. Effectively, that means we have a
quadratic complexity both on Mercurial, and on EdenFS's side.

While this has been a long standing issue, we've so far avoided falling into
this complexity for a number of reason. The main one being that the hgcache is
very rarely empty, and thus the quadratic complexity is usually on low number
of files. Users also rarely run a prefetch of all the files for the entire
repo. However, on repositories with long standing branches, the hgcache is
effectively cold and thus any prefetch would trigger the pathological behavior.

To solve this, we take the same approach taken for files: sending the raw
manifest to EdenFS, which will then take care of deserializing it properly.

Reviewed By: DurhamG

Differential Revision: D23035335

fbshipit-source-id: 855e6fb4fabf81c427fad6c9f17d05f95c47e9ae
2020-08-12 01:48:03 -07:00
Alex Hornby
7766cac6a1 mononoke: add task spawning to manual_scrub
Summary: Add task spawning to manual_scrub to increase throughput

Reviewed By: farnz

Differential Revision: D23055811

fbshipit-source-id: 1e3d1f0e5b5fc2f2935aa367ae2e749c867d2d62
2020-08-12 01:31:03 -07:00
Alex Hornby
e18cf0210f mononoke: use the background session mode from manual scrub
Summary: There are no users waiting on manual scrub, so set it to use the background session mode.

Reviewed By: krallin

Differential Revision: D23054581

fbshipit-source-id: 985bcadbaf17d2a8c92fdec811ecb239cbca7b37
2020-08-12 01:31:03 -07:00
svcscm
d910adeb21 Updating submodules
Summary:
GitHub commits:

866706a155
4959fb1800

Reviewed By: yns88

fbshipit-source-id: e6c93c77b8f6db6f904ffaee99d9915afbfc7606
2020-08-12 01:31:03 -07:00
svcscm
3d35abe819 Updating submodules
Summary:
GitHub commits:

95022abcd9
efe2962d54

Reviewed By: yns88

fbshipit-source-id: c7abb1851eabfb0d07690e97f00f7bb85aee8078
2020-08-12 00:52:36 -07:00
Xavier Deguillard
5cfd0fd8ba sshpeer: backport connection timeout hotfix
Summary:
On macOS, it appears that ssh has a ~1% chance of never being able to connect
too the server and just hang. This caused mactest to be completely unhealthy
for a couple of days and a similar hotfix was applied to mitigate the issue.

Since it proved to be working, let's now backport this hotfix in the actual
code.

Reviewed By: DurhamG

Differential Revision: D22953230

fbshipit-source-id: ead7662ea6d0a33efaa5c4044c9391b2835ee421
2020-08-11 22:57:20 -07:00
Stefan Filip
e06d9979f5 client: add commit revlog data endpoint
Summary: Client portion for the commit/revlog_data endpoint that was added to the server.

Reviewed By: kulshrax

Differential Revision: D23065989

fbshipit-source-id: 3115ad2b426daca22472e2106fcd293f3ccd70f3
2020-08-11 22:15:10 -07:00
Adam Simpkins
2f55fd2a53 add type annotations to dirstate.py
Summary:
Pyre now has improved support for decorators and descriptors, which makes it
possible for us to add type annotations to `dirstate.py` without needing lots
of `pyre-ignore` comments everywhere.  (Previously Pyre could not handle the
`propertycache` decorator, causing it to be confused about the type of
various dirstate members, like `_map`).

Reviewed By: mrkmndz

Differential Revision: D22969757

fbshipit-source-id: 1b54f1edfb56c20c237a34f14a47404d10605240
2020-08-11 21:45:04 -07:00
Adam Simpkins
0cb0a0bb2a begin adding some type stubs for the Rust Python bindings
Summary: Begin adding some initial type annotations for the Rust Python bindings.

Reviewed By: quark-zju

Differential Revision: D22993222

fbshipit-source-id: 2073db93b22f6bb04e30b767594d435c36ddb17f
2020-08-11 21:45:04 -07:00
svcscm
327e0148f4 Updating submodules
Summary:
GitHub commits:

1175280014
e9daedec84
907906cfa9
c34c520130

Reviewed By: yns88

fbshipit-source-id: 7c5f631d76427d7f0592f10cadc8b9b2cf42879f
2020-08-11 19:28:42 -07:00
Xavier Deguillard
077ba2fd96 cli: properly detect running buck on Windows
Summary:
Using os.kill on EdenFS would always fail and raise an exception. Use the
proc_utils code to detect if the process is running. Also using BUCKVERSION
always raises an error on Windows, so let's ignore that for now.

Reviewed By: fanzeyi

Differential Revision: D22915350

fbshipit-source-id: 806bfab12ae0e8fc97e83d5720481f2a47516129
2020-08-11 19:01:13 -07:00
svcscm
e20e0fb207 Updating submodules
Summary:
GitHub commits:

791119b67b
d11d0b9073

Reviewed By: yns88

fbshipit-source-id: 84be7a3e623c78d14cd64672ee08eab66bda1506
2020-08-11 19:01:13 -07:00
svcscm
22b742ad44 Updating submodules
Summary:
GitHub commits:

1d049ea33c
5bf37a56da
8b65024622
2efcda1389
063cbb129f
57d7da81e4
d8d2db0be6
c043abc5a8

Reviewed By: yns88

fbshipit-source-id: b18767a29034d53a92b6744858d80557bf9b0b80
2020-08-11 17:49:35 -07:00
Stanislau Hlebik
593b16d485 mononoke: add WarmBookmarksCacheBuilder
Summary:
Let's split logic from WarmBookmarksCache into a separate builder. This builder
will configure which warmers we'd like to use.

This will make it easier to introduce a new warmer later in the stack

Reviewed By: krallin

Differential Revision: D23053785

fbshipit-source-id: 32acc9da98d32624ca0dc00277910443f3d86f66
2020-08-11 15:37:36 -07:00
Stanislau Hlebik
8a3d0dca74 mononoke: check if hg changesets should be warmed
Summary:
Previously we were unconditionally adding hg changesets, but that's a bit
strange and there's no reason to do it. Let's do the same check we do for other
derived data types. Note that there should be no change in behaviour - all our
repos have "hgchangesets" derived data type enabled.

Reviewed By: krallin

Differential Revision: D23053786

fbshipit-source-id: 0b3ea99f649bc89ea9b216f368fee11fa25e153f
2020-08-11 15:37:35 -07:00
Stanislau Hlebik
a2d997d7a1 mononoke: renamed is_derived to is_warm
Summary: I want to add a new warmer in the next diffs which won't do any deriving.

Reviewed By: krallin

Differential Revision: D23053787

fbshipit-source-id: 4c7febb60ab7e835302db746c670d656bd9d1989
2020-08-11 15:37:35 -07:00
Xavier Deguillard
ab9cd317da windows: do not remove just created temporary lock files
Summary:
EdenFS may spawn several Mercurial process concurrently and they would all try
to take the wlock at startup time, more often than not, one of these process
would die early due to the tmplock not being present on disk. This is due to
the other Mercurial process removing it, let's have a 10s grace period where
temporary locks aren't removed to avoid this race.

Reviewed By: DurhamG

Differential Revision: D22954997

fbshipit-source-id: ce191265c03a7042d9c6e45db0dc44a688fa204c
2020-08-11 14:48:12 -07:00
svcscm
cf28fa5e01 Updating submodules
Summary:
GitHub commits:

b924a7b1f0
4e81471374
6ac1d25fd0

Reviewed By: yns88

fbshipit-source-id: 8368bb999d6bbc3a624ffc68eed51d489f9ff58e
2020-08-11 14:48:12 -07:00
svcscm
19d4023c01 Updating submodules
Summary:
GitHub commits:

5594a6e41a
e6d5beb44a
cd899e7c3b
1fd960c2f9
7e9865aa3a
5aa5440133
6aac47de5f
7f2e5ff505

Reviewed By: yns88

fbshipit-source-id: 8df15572d09564dbfa2f1e8fba317ff71ad0446a
2020-08-11 12:48:53 -07:00
Tao Chen
dd6d5900f5 Mark getSelection APIs deprecated
Summary: Mark ServiceRouter getSelection APIs deprecated

Differential Revision: D22990911

fbshipit-source-id: b4de95335005f08948796f6017e3317bb1224fd0
2020-08-11 12:34:15 -07:00
Stanislau Hlebik
f5e5286a87 mononoke: fix minor typo
Summary: makes grepping easier

Reviewed By: krallin

Differential Revision: D23053784

fbshipit-source-id: f8ebddfb0d99000ec3ad9d068c8abfe929bf7a5d
2020-08-11 11:15:59 -07:00
svcscm
246c48e4aa Updating submodules
Summary:
GitHub commits:

245e98cacc
a99fb67233

Reviewed By: yns88

fbshipit-source-id: 0fd230846b9c904443ac91c16d2cb8eda688ae19
2020-08-11 10:51:34 -07:00
Durham Goode
2e8915a653 revisionstore: set max memory footprint for data/history indexedlog
Summary:
When doing large clones or checkouts the amount of data we add to an
indexedlog can be many GB. On a laptop we don't have much memory, so let's set a
max memory threshold for the file data/history indexedlogs.

Reviewed By: xavierd

Differential Revision: D23046489

fbshipit-source-id: 43b7686b11fe05e4c074bcb02c475ebf8cf14ab1
2020-08-11 09:51:26 -07:00
Liubov Dmitrieva
fc739137bb improve readability of exception status
Summary: Dump the text into file as it is

Reviewed By: markbt

Differential Revision: D23039839

fbshipit-source-id: 966d6c5e90f020efbb8123704f5c2749596fbab5
2020-08-11 04:01:43 -07:00
Liubov Dmitrieva
b7f5085832 improve ux for hg cloud status command in regards to SCM Daemon
Summary:
There are two different magic background syncing that can be enabled. The first
is triggered by commit or any other local changes. The second is triggered by
SCM Daemon by any remote change in this workspace.

I would like to explain it a bit better in `hg cloud status` command.

This will also offer some reassurance to clients.

For example, assume they run `hg cloud disable` command that should disable all background Commit Cloud traffic for some time, so then they can run `hg cloud status` and verify that neither local changes, nor remote changes trigger any commit cloud traffic on this machine.

I also provide full log path to Scm Daemon logs if it is enabled.

Reviewed By: markbt

Differential Revision: D23038954

fbshipit-source-id: c3a5b8f58df729ee3f1c7f15da44ad6e6e0b98f6
2020-08-11 04:01:43 -07:00
svcscm
bfb071f4a5 Updating submodules
Summary:
GitHub commits:

63e65071a5

Reviewed By: yns88

fbshipit-source-id: 75c3114bd1fdd7d3e0a1a38ab02e972e70919a9e
2020-08-11 03:31:30 -07:00
Viet Hung Nguyen
f267bec3f7 mononoke/repo_import: add merge functionality
Summary:
Once we have revealed the commits to the user (D22864223 (578207d0dc), D22762800 (f1ef619284)), we need to merge the imported branch into the destination branch (specified by dest-bookmark). To do this, we extract the latest commit of the destination branch, then compare the two commits, if we have merge conflicts. If we have merge conflicts, we inform the user, so they can resolve it. Otherwise, we create a new bonsai having the two commits as parents.

Next step: pushrebase the merge commit

Minor refactor: moved app setup to a separate file for better readability.

Reviewed By: StanislavGlebik

Differential Revision: D23028163

fbshipit-source-id: 7f3e2a67dc089e6bbacbe71b5e4ef5f6eed2a9e1
2020-08-11 03:26:57 -07:00
svcscm
dd79f87e6e Updating submodules
Summary:
GitHub commits:

c41a357ed0
d17e2f0e0a
8187c1dc7d

Reviewed By: yns88

fbshipit-source-id: 2f7852b50cd770d0df0ec3a05048ebe4a0c89d02
2020-08-11 03:04:16 -07:00
Alex Hornby
74f2e7affc mononoke: add context to blobstore_sync_queue get error handling
Summary: Add context to show the affected key if there are problems peeking a key.

Reviewed By: farnz

Differential Revision: D23003001

fbshipit-source-id: b46b7626257f49d6f11e80a561820e4b37a5d3b0
2020-08-11 02:52:44 -07:00
Alex Hornby
0a8c81c668 mononoke: walker state, check for visited before insert
Summary:
Now that the previous diff has pre-computed the hash value using EagerHashMemo, its less expensive to try a read-lock only get() first before committing to a write lock acquiring insert().

The combination of these and the previous diff moved WalkState::visit from dominating the cpu profile to not ( the path interning dominates now ).

Reviewed By: krallin

Differential Revision: D22975881

fbshipit-source-id: 90b2be83282ee2095c517c0d4f13536ddadf6267
2020-08-11 02:52:43 -07:00
Alex Hornby
22add277f9 mononoke: update walker state to use eager hash memo
Summary:
DashMap takes the hash of its keys multiple times,  once outside the lock, and then once or twice inside the lock depending if the key is present in the shard.

Pre-computing the hash value using EagerHashMemo means its done only once and more importantly, outside the lock.

To use EagerHashMemo one needs to supply the BuildHasher, so its added as a struct member and the record method is made a member function.

Reviewed By: farnz

Differential Revision: D22975878

fbshipit-source-id: c2ca362fdfe31e5dca329e6200029207427cd9a1
2020-08-11 02:52:43 -07:00
Stefan Filip
2825193931 edenapi: add /commit/revlog_data endpoint
Summary:
Matches the `getcommitdata` SSH endpoint.
This is going to be used to remove the requirement that client repostories
need to have all commits locally.

Reviewed By: krallin

Differential Revision: D22979458

fbshipit-source-id: 75d7265daf4e51d3b32d76aeac12207f553f8f61
2020-08-11 01:54:14 -07:00
svcscm
4399b5a859 Updating submodules
Summary:
GitHub commits:

2dde034e4e

Reviewed By: yns88

fbshipit-source-id: 4e6a1d1abcb2d656d0b3e527c0153027d17b57ec
2020-08-11 00:34:24 -07:00
Tao Chen
e41f32a9f1 Add deprecated getSelection APIs to ServiceSelectorCache
Summary:
Instead of modifying the existing APIs and marking all callsites as deprecated in one diff, I am going to take the "add and remove" approach, where I will add the deprecated version of methods first, then mark all callsites, and finally remove the existing ones. This provides some backward compatibility without breaking things.

This diff is to add deprecated getSelection APIs to ServiceSelectorCache.

Differential Revision: D22981269

fbshipit-source-id: 6e3025e7f7df6ee7f9e1cba9dc036ca84adbe49a
2020-08-11 00:14:23 -07:00
Katie Mancini
58d012d8b4 enable metadata fetching by manifest id
Summary:
Previously we fetched metadata by commit hash and path. We knew this would be a
little extra expensive, but turns out this is a lot extra expensive.

Wait why is it expensive?
In short: lots of extra lookups that are not satisfied by cache :(
In long:
1. Each piece of the path would require a read to fetch the fsnode for that tree.
So this means asking for the metadata of a/b/c/d/e means 5 reads.
2. Normally these reads could be cached, but often we would make these requests
with a commit hash for a draft commit. On the server side this info is not
cached for a draft commit, this means a lot of database reads and recalculating.
(Most of the real uses of metadata prefetching is when an engineer is working
on a local commit. We just use the commit hash of the commit the user was on
when fetching metadata for a tree, even if that tree hasn't changed since a public
commit. so this means lots of requests with draft commit hashes).

Fetching by manifest id we are able to bypass this sequential path look up.
(and even if we are on a draft commit, if the tree has not locally changed
since a public commit, the manifest id will be the same as the public commit
avoiding this whole draft commit issue).

This allows us to query scs with a manifest id for a tree.

Reviewed By: wez

Differential Revision: D22990687

fbshipit-source-id: aa81d67de1f1d04a14d174774ee216f5ac6be5ba
2020-08-10 23:53:10 -07:00
svcscm
ef8e8a67ac Updating submodules
Summary:
GitHub commits:

11bbe00223

Reviewed By: yns88

fbshipit-source-id: 5500c8935f26cd80d0dc5a8a8ba277a84ec42abb
2020-08-10 23:53:09 -07:00
svcscm
05f384a005 Updating submodules
Summary:
GitHub commits:

c7d609d4b3
2d3f23416a
29d5eb9f3c

Reviewed By: yns88

fbshipit-source-id: 643e05b4e38ac940a373e3cf7e16badf134e8057
2020-08-10 15:56:57 -07:00
Simon Farnsworth
3086b241c6 Give the blobstore healer a way to cope with temporary falls in MySQL capacity
Summary:
The query we use to select blobs to heal is naturally expensive, due to the use of a subquery. This means that finding the perfect queue limit is hard, and we depend on task restarts to handle brief overload of MySQL.

Give us a fast fall in batch size (halve on each failure), and slow climb back (10% climb on each success), and a random delay after each failure before retrying.

Reviewed By: StanislavGlebik

Differential Revision: D23028518

fbshipit-source-id: f2909fe792280f81d604be99fabb8b714c1e6999
2020-08-10 15:24:13 -07:00
svcscm
c5ce8557b5 Updating submodules
Summary:
GitHub commits:

cf2fff415e

Reviewed By: yns88

fbshipit-source-id: a1ef781f98c24c71582697699b5cf5aa20193ea5
2020-08-10 15:24:13 -07:00
svcscm
1a64cf90f5 Updating submodules
Summary:
GitHub commits:

ebc1ae6853
cb26c8cc80

Reviewed By: yns88

fbshipit-source-id: ef11513c5311121f1cb6ebf0a2224fdfe0e57d29
2020-08-10 11:41:21 -07:00
Stanislau Hlebik
9787a2c33a mononoke: add admin command to return filenodes for path
Summary: It's useful to debug filenodes

Reviewed By: krallin

Differential Revision: D23028528

fbshipit-source-id: 500fe2ad62a8e07498f46801c0c1523d1656ceeb
2020-08-10 11:13:01 -07:00
Xavier Deguillard
c22f6ed35d cmdutil: fix hg log -Tjson with utf8 characters
Summary:
All of these are already valid utf-8 characters, no need to dance to
decode/encode them again.

Reviewed By: DurhamG

Differential Revision: D22978828

fbshipit-source-id: c5f6e25e71cdcaa1c0558d4a1181b667ffe379fb
2020-08-10 09:48:34 -07:00
Xavier Deguillard
0273817488 win: simplify path management
Summary:
The StringConv.h header contains many functions to convert from Windows paths
to Eden's path (and vice versa) to workaround the fact that Eden's path don't
support wide strings that Windows uses. Let's simply add support for these wide
strings in PathFuncs so we can greatly simplify all the call sites. Instead of
calling "edenToWinName(winstr)", "PathComponent(winstr)" is both more
descriptive and more idiomatic.

To be fair, I'm not entirely a fan of the approach taken in this diff, as this
adds Windows specific code to PathFuncs.h, but I feel that the benefit is too
big to not do that.

Reviewed By: chadaustin

Differential Revision: D23004523

fbshipit-source-id: 3a1507e398a66909773251907db01e06603b91dd
2020-08-10 08:53:13 -07:00
Stanislau Hlebik
bdd494b2ce mononoke: fix filenodes cache key
Summary:
`is_tree` weren't part of the cache key, and that means we could have returned
incorrect history if we had a file and a directory with the same name.

This diff fixes it.

Reviewed By: krallin

Differential Revision: D23028527

fbshipit-source-id: 98a3b2028fa62231dfb570a76fb836374ce1eed0
2020-08-10 07:13:35 -07:00
Stanislau Hlebik
21e232ddaf mononoke: add init_tunables in fastreplay
Summary:
I noticed that fastreplay doesn't init tunables, and that means that it doesn't
get the updates, and more importantly it doesn't use default values of
tunables.

That doesn't look expected (but lmk if I'm wrong!)

Reviewed By: krallin

Differential Revision: D23027311

fbshipit-source-id: ee43d02457d2240ebeb1530c672cb3847bc3afd4
2020-08-10 03:55:41 -07:00
svcscm
a02e2c7853 Updating submodules
Summary:
GitHub commits:

cfe7cfea7e

Reviewed By: wittgenst

fbshipit-source-id: 29c93cde4e3d050fd286f3de88d9edbd3e457dd5
2020-08-10 03:44:34 -07:00
Alex Hornby
02b9979b21 rust: vendor dashmap 3.11.9
Summary: This has my into_key() PR https://github.com/xacrimon/dashmap/pull/91 merged so the patch pointing to my fork is also removed.

Reviewed By: farnz

Differential Revision: D22896911

fbshipit-source-id: 188d438ce2aa20cfb3c466a62227d1cd27625f74
2020-08-10 03:19:33 -07:00
svcscm
c29fcf3228 Updating submodules
Summary:
GitHub commits:

3f88687795
cf617e5912
fb75df1eec
3787e396e2
2839bfc5cb
fe602541b4
082d116f0f
da35611013

Reviewed By: wittgenst

fbshipit-source-id: f64748e97be7324e4cbbcd2a5e63538519687179
2020-08-10 03:19:33 -07:00
svcscm
1c8c445e33 Updating submodules
Summary:
GitHub commits:

6f028d5d75

Reviewed By: wittgenst

fbshipit-source-id: e10637be34c4779cfbc953368cf0f8baa2a6347b
2020-08-09 18:22:39 -07:00