Commit Graph

67587 Commits

Author SHA1 Message Date
svcscm svcscm
ac253a4449 Updating submodules
Summary:
GitHub commits:

e037ab9fc8
5dff5b904f
b6b5150aeb
e2aaaef8e8
d943aee954

Reviewed By: wittgenst

fbshipit-source-id: bc3ee9fa837bb970877554e434a80e009cea6dae
2021-08-28 03:25:55 -07:00
Xavier Deguillard
f79379aefc revisionstore: reduce lock scope in AuxStore
Summary:
Similarly to the previous diff, reducing the lock scope will improve
concurrency leading to higher performance in EdenFS.

Reviewed By: andll

Differential Revision: D30595787

fbshipit-source-id: 1d52e4a8d362f7e2e3e18c2a57a3ebb7628f549e
2021-08-28 03:25:54 -07:00
Xavier Deguillard
c9ee3b5209 revisionstore: reduce lock scope in IndexedLogHistoryStore
Summary:
Similarly to the previous diff, let's not hold any read/write locks when not
needed. This will improve concurrency of the code.

Reviewed By: andll

Differential Revision: D30595786

fbshipit-source-id: 6ea6c689e4deca713051a9f3611647334c528bc7
2021-08-28 03:25:54 -07:00
Xavier Deguillard
67a1666547 revisionstore: reduce indexedlogdatastore lock duration
Summary:
In the context of EdenFS, during a prefetch operation, EdenFS will call into
the revisionstore (via the backingstore) from multiple threads and use the
ContentStore::prefetch method in each of them with batches of keys.

Unfortunately, the IndexedLogDatastore lock is write held both when serializing
fetched data and when writing to the underlying IndexedLog. The serialization
part can be fairly CPU intensive as it will compress data with LZ4, but doesn't
require the lock to be held. If a concurrent get_missing call to the
IndexedLogDatastore is made, that will thus wait for the compression to
complete, reducing overall concurrency and fetching speed.

Reviewed By: andll

Differential Revision: D30583566

fbshipit-source-id: 06f5f4988c1bc911ae155189317232b54915a5cf
2021-08-28 03:25:54 -07:00
svcscm svcscm
cd265b0d53 Updating submodules
Summary:
GitHub commits:

d076a42d82
f14e794814

Reviewed By: wittgenst

fbshipit-source-id: 30b98149438aa594b4cbf08a46348d5a6baa083e
2021-08-27 17:56:59 -07:00
svcscm svcscm
3f8b3935ae Updating submodules
Summary:
GitHub commits:

b57d46bce8
12e2448255
84c3094fc0
3e2c79a479

Reviewed By: wittgenst

fbshipit-source-id: 84b2df38f971dbcafc07e2bf6dccfa0555eeae3e
2021-08-27 17:22:15 -07:00
svcscm svcscm
53dd538c3e Updating submodules
Summary:
GitHub commits:

4dec692b3a
8228fef363
a6a60e695e
56da25edb5
e8969643cc

Reviewed By: wittgenst

fbshipit-source-id: 87657ab0b6bd346c020e083cb893ff22d805db4e
2021-08-27 16:48:35 -07:00
svcscm svcscm
54d9552071 Updating submodules
Summary:
GitHub commits:

a495023f03
6c2bd28a61
e1036e1f1a

Reviewed By: wittgenst

fbshipit-source-id: 2dfeef2abc30cfe7e660d157c80cb686a338c8b4
2021-08-27 15:36:33 -07:00
Meyer Jacobs
44d6d6ce5b scmstore: update BackingStore to support scmstore
Summary: Add a new `BackingStore` implementation based on `scmstore` instead of `ContentStore` and allow the backend to be selected with the `scmstore.backingstore` config.

Reviewed By: andll

Differential Revision: D29672974

fbshipit-source-id: dc6b8662903bcfc941b586544aad487de6b8c956
2021-08-27 15:11:35 -07:00
Meyer Jacobs
85ebb18136 scmstore: introduce StoreValue trait
Summary: Introduce a new `StoreValue` trait, implemented for `StoreFile`, for use in `CommonFetchState`, which will be shared between `TreeStore` and `FileStore`.

Reviewed By: kulshrax

Differential Revision: D30295987

fbshipit-source-id: 862349980befa13cb3d420ee617e4fe5464d890a
2021-08-27 14:51:44 -07:00
Meyer Jacobs
13423a9ba0 scmstore: introduce StoreAttrs trait
Summary: Introduce a new `StoreAttrs` trait, implemented for `FileAttributes`, for use in `CommonFetchState`, which will be used by both `TreeStore` and `FileStore`.

Reviewed By: kulshrax

Differential Revision: D30295969

fbshipit-source-id: 603242fe08bea72035b1b1d0f37c46514e1fb92b
2021-08-27 14:51:44 -07:00
Meyer Jacobs
3663d5a706 scmstore: move FetchResults and FetchErrors to top level
Summary: Refactoring in preparation for updating `TreeStore` to match `FileStore`

Reviewed By: andll

Differential Revision: D30295957

fbshipit-source-id: 0f1677311eb2578d8e0dae12c07a1599edc3b500
2021-08-27 14:51:44 -07:00
Meyer Jacobs
d5ea0f5024 scmstore: rename FileStoreFetch to FetchResults and make it generic
Summary: Making `FetchResults` generic in preparation for using it with trees too.

Reviewed By: andll

Differential Revision: D30286592

fbshipit-source-id: a48cf2dbcdcc2c4b8a102eaa02ac465c367c6793
2021-08-27 14:51:43 -07:00
Meyer Jacobs
d66b308db5 scmstore: move file-specific metrics into separate module
Summary: I'll be adding metrics to the `TreeStore` soon, so I'm refactoring code that will be shared between files and trees. This change moves the non-file-specific metrics types up to the top-level `scmstore` module, rather than inside `scmstore::file`.

Reviewed By: andll

Differential Revision: D30284933

fbshipit-source-id: 31f48312bca8d75d4893220cd189b9735a37a5a0
2021-08-27 14:51:43 -07:00
Jun Wu
1875a663b1 metalog: add tracing logs
Summary: Helps figure out what happens to metalog internally.

Differential Revision: D30563249

fbshipit-source-id: 10323d36d762edda93206dd01c88d1f0d8abdf8d
2021-08-27 13:44:03 -07:00
Jun Wu
6aefe85ce8 util: replace faultinjection with failpoint
Summary:
The failpoint feature supports more complex injections, such as sleep, or fail
after a few times. There is no need to keep the adhoc faultinjection feature.

Differential Revision: D30495223

fbshipit-source-id: b5613811e489a5a52e9c0dd1ebf1096c848a402b
2021-08-27 13:44:03 -07:00
Zhengchao Liu
aa4566ece6 check hgcache before enqueue import tree request
Summary: Currently, tree imports are queued regardless of whether they are in the `hgcache`. This adds unnecessary delay, especially if the queue is busy (importer takes a long time and causes queue to backlog). This diff adds the logic to check if the tree is in `hgcache` before enqueuing a tree import request.

Reviewed By: xavierd

Differential Revision: D30514871

fbshipit-source-id: eb23f64b7f059832571f957fb67d18c3821d2844
2021-08-27 13:08:59 -07:00
Gus Wynn
6a75141b86 add panic-message
Summary:
this library is a more general version of the `panic_unpack` lib I
made in fbcode. I made this library, its mit-apache licensed

Reviewed By: dtolnay

Differential Revision: D30607308

fbshipit-source-id: ee4fad3924fdae021753055cd3fd88c99cb99512
2021-08-27 12:09:29 -07:00
svcscm svcscm
55169ae2fe Updating submodules
Summary:
GitHub commits:

ee858742fb
8c66c6946f
7c55aec077
ee3886f5d0

Reviewed By: wittgenst

fbshipit-source-id: 21211e28052e09e494bf6db8fb8d7fe892d044d1
2021-08-27 11:55:21 -07:00
Jun Wu
3562880804 pyfail: module to use FAILPOINTS in Python
Summary:
This allows us to insert FAILPOINTS in Python so we can use sleep, return error
etc.

Differential Revision: D30495224

fbshipit-source-id: aef56d03bc32eefb69573cfa586aa63a301edffc
2021-08-27 11:30:55 -07:00
svcscm svcscm
c25134d21a Updating submodules
Summary:
GitHub commits:

343444dfc2
46ae698125
180e836689
4c0bec69f8
f2a6ab7334

Reviewed By: wittgenst

fbshipit-source-id: 48e91afc4b69ecf096107c6ad59bb3b07677106f
2021-08-27 11:23:37 -07:00
Jan Mazur
fa742950a3 remove need for repo_name in hooks configerator config
Summary:
I abandoned D30603353 in favor of this one because
its_cleaner

We don't need repo name in every hook, just 2 of them.

This will allow us to have predefined, named hook configs that are repo-agnostic. E.g. when repositories are similar, they could share one set of hook configs in configerator.
There were two hooks that had repo_name in configerator hook config: verify_integrity and verify_reviewed_by

Reviewed By: StanislavGlebik

Differential Revision: D30605229

fbshipit-source-id: c310b16b564808d0dc0909d21cc3521a57e06fad
2021-08-27 10:45:32 -07:00
svcscm svcscm
21696b49e0 Updating submodules
Summary:
GitHub commits:

70be2d8ff7

Reviewed By: wittgenst

fbshipit-source-id: 8c5dafe02ba92a4cbe960aca399fb7b8457f1f9d
2021-08-27 10:40:34 -07:00
Durham Goode
86dd972294 tests: remove test-perftrace.t
Summary: The result is too flakey now that we've introduced threading.

Reviewed By: andll

Differential Revision: D30607733

fbshipit-source-id: f8bfa2a57d427731fb4ac3011f4364190a83b771
2021-08-27 10:19:05 -07:00
svcscm svcscm
b86a8a6b46 Updating submodules
Summary:
GitHub commits:

6a9e5e40df
493dd9e9fc
a24a90588f
58ca827f96
da0a04aace

Reviewed By: wittgenst

fbshipit-source-id: 06bac946edc31df7f6310a7ae02831c93af0970b
2021-08-27 10:11:34 -07:00
Xavier Deguillard
49619add41 store: allow extracting a slice of the Hash stored in HgProxyHash
Summary:
Some code in the HgDatapackStore is overly complicated due to the fact that
revHash returns a owned Hash and this forces the code to thus copy it onto a
temporary vector. By having a method that can directly return a slice to the
hash, this issue disappears, thus let's add it.

Reviewed By: chadaustin

Differential Revision: D30582458

fbshipit-source-id: dc102117bc82ab72378293c0abfe9acfd862e9e6
2021-08-27 10:05:48 -07:00
svcscm svcscm
c411f6b0f8 Updating submodules
Summary:
GitHub commits:

93eef59e56

Reviewed By: wittgenst

fbshipit-source-id: 80deff92581c59c9354f260d44a8007961246d34
2021-08-27 09:39:06 -07:00
Michael Samoylenko
d972c278ce Rm deprecated mysql connection factory
Summary: Cleaned up all remaining usages of this deprecated API in CTP codebase

Differential Revision: D30517771

fbshipit-source-id: 6b2c7fb6c569bf5a928a7eec60fdd890baad312f
2021-08-27 06:06:30 -07:00
Stanislau Hlebik
cf0380dccb mononoke: fix handling of mutable renames in fastlog
Summary:
Handling of mutable renames was incorrect for two reasons:
1) We didn't add an entry to history graph, so only a single changeset before
rename was returned. That was easy to "fix" (just add a new entry to history
graph), but...
2) ...all history operations now have to use a different path (the source of
the rename path).

To fix it let's track not just the changeset id, but also the path for the
given changeset id. Since the path can potentially be large I wrapped it into
Arc to avoid expensive clones.

Differential Revision: D30576342

fbshipit-source-id: a99f6269c34b0a0c626104ec47c9392f984328fb
2021-08-27 05:58:31 -07:00
Yan Soares Couto
475ebe8c17 Use fetch_snapshot endpoint from restore command
Summary:
This diff calls the `/:repo/snapshot` EdenApi endpoint added on D30514854 (ab17c4d181) from the `hg snapshot restore` command.

For now, it just prints the parent of the snapshot, but in next diffs it will update to it and restore the dirty changes.

Reviewed By: StanislavGlebik

Differential Revision: D30517984

fbshipit-source-id: e1381eaed561a7184ee02ab99d0282f11a1d944f
2021-08-27 03:40:57 -07:00
Yan Soares Couto
5e34a79748 Add bindings for fetch_snapshot endpoint
Summary: This diff adds the `fetch_snapshot` method to the EdenApi trait, implements it for talking with the EdenApi service, and also adds python bindings for ease of use from python.

Reviewed By: StanislavGlebik

Differential Revision: D30517973

fbshipit-source-id: 41c24ba25040b397b7d739c2885a47acfb9100d2
2021-08-27 03:40:57 -07:00
svcscm svcscm
981614c82b Updating submodules
Summary:
GitHub commits:

90bd25d7c6
327a7c3f63
91f45fe1a8
130b5a0883

Reviewed By: wittgenst

fbshipit-source-id: 7dfef20bbdfdb951f134c951b0644b38b774c6c0
2021-08-26 21:44:23 -07:00
svcscm svcscm
9e3f2aa667 Updating submodules
Summary:
GitHub commits:

f09819cfc1
63ae4d9f95
d1067ec2f2
e4f1e4b22a

Reviewed By: wittgenst

fbshipit-source-id: 3bb064420eb60dc7632ec13bceaf6eff5669023b
2021-08-26 21:35:25 -07:00
svcscm svcscm
7936baaa5a Updating submodules
Summary:
GitHub commits:

90bd25d7c6
327a7c3f63
91f45fe1a8
130b5a0883

Reviewed By: wittgenst

fbshipit-source-id: f7eeac855faed993f9f263d4a1a7bf8bce3d3cbe
2021-08-26 21:14:16 -07:00
svcscm svcscm
a786f5a003 Updating submodules
Summary:
GitHub commits:

21ec9eb245
803823675d

Reviewed By: wittgenst

fbshipit-source-id: 7a37f5a4aec087a1bc48f0dc9aaaeaa2b0c60160
2021-08-26 20:43:33 -07:00
svcscm svcscm
3126322a67 Updating submodules
Summary:
GitHub commits:

f09819cfc1
63ae4d9f95
d1067ec2f2
e4f1e4b22a

Reviewed By: wittgenst

fbshipit-source-id: b6687051f9d2e446015460249f55ca863915536b
2021-08-26 17:52:02 -07:00
Andrey Chursin
aae0a37a7f use metadata cache to skip hash recalculation
Summary:
I noticed that every time we fetch blob from hg, we calculate sha hash and put it into metadata table.
Both calculating sha1 of content and writing it to rocks is fairly expensive, and it would be nice if we can skip doing so in some cases.

In this diff I use inexpensive cache check to see if we already calculated metadata for given blob and skip recalculation

In terms of performance, it reduces blob access time in hot case from **0.62 ms to 0.22 ms**.
[still need to do some testing with buck, but I think this should not block the diff since it seem farily trivial]

This is short-medium term fix, the longer term solution will be keeping hashes in mercurial and fetching them via eden api, but this will take some time to implement

Reviewed By: chadaustin, xavierd

Differential Revision: D30587132

fbshipit-source-id: 3b24ec88fb02e1ea514568b4e2c8f9fd784a0f10
2021-08-26 17:30:17 -07:00
svcscm svcscm
27cfd7e19b Updating submodules
Summary:
GitHub commits:

c6af005c3b
1d5ae534ee
7c9e35af39
971415dab4
eb1f00ba23
12f58add1b

Reviewed By: wittgenst

fbshipit-source-id: 84ce40098c872d03023ca6efc4930d02a35ae795
2021-08-26 17:18:14 -07:00
svcscm svcscm
48cb47265a Updating submodules
Summary:
GitHub commits:

6783c1ac5f
3b138ad194
ab020a1a36
914ba3574e
22ecd7edc1
473ce6da93
1c4ddbcfb7
ad75ab91d6
60f5312c47
f3a023381e
2cd2cc39b2

Reviewed By: wittgenst

fbshipit-source-id: 7d9ca269cdd5c2ef9b6658fdd243dc5588f90261
2021-08-26 16:45:17 -07:00
svcscm svcscm
3964f564cb Updating submodules
Summary:
GitHub commits:

7bf89bf4f8
2e927ad34e
d2a9a27d59
f039ef7150
509262a98a
090f439d72
292fc4c45e
2a309149de
f0340f19c7
d8ffb26ca8
9dca019669
45ed594ebd

Reviewed By: wittgenst

fbshipit-source-id: ef58b65648f2ae0e50c3141be504746dcfce4526
2021-08-26 16:20:21 -07:00
svcscm svcscm
5b8d7c1159 Updating submodules
Summary:
GitHub commits:

5f74de533b
2a20a79adf
815c0c5533
ebaa3c8a59
f983d03ab5
7925b2eaaf
40cc0ca93e
52f0a7da69

Reviewed By: wittgenst

fbshipit-source-id: 5f7145bb7721d8e814054ee4fafe34e750b4208c
2021-08-26 15:53:14 -07:00
Durham Goode
b519a52161 tests: fix test-perftrace.t
Summary: This is blocking hgbuild.

Reviewed By: quark-zju

Differential Revision: D30585308

fbshipit-source-id: 68efca01e39eac2a329bb7ef88e9fd9086c15607
2021-08-26 13:52:22 -07:00
Xavier Deguillard
87545e26b2 benchmarks: add HgImportRequestQueue::dequeue benchmark
Summary: Similarly to the enqueue benchmark, let's have a dequeue benchmark.

Differential Revision: D30560489

fbshipit-source-id: ae18f7e283e4bab228aaa0f58bff2e6f2cfa3021
2021-08-26 12:28:51 -07:00
Xavier Deguillard
edfc14fa97 store: use Hash instead of HgProxyHash to speedup enqueue 1.6x
Summary:
In order to enqueue and find an element in a hash table, the key needs to be
hashed. Hashing a HgProxyHash relies on hashing a string which is significantly
more expensive than hashing a Hash directly. Note that they both represent the
same data and thus there shouldn't be more collisions.

Reviewed By: chadaustin

Differential Revision: D30520223

fbshipit-source-id: 036007c445c28686f777aa170d0344346e7348b0
2021-08-26 12:28:50 -07:00
Xavier Deguillard
f3dc469957 store: remove an allocation in enqueue to speed it up 1.25x
Summary:
Allocations are expensive, especially when done under a lock as this increase
the critical section, reducing the potential concurrency. While this yields to
a 1.25x speedup, this is more of a sideway improvement as the allocation is now
done prior to enqueuing. This also means that de-duplicating requests is now
more expensive, as no allocation would be done before, but at the same time,
de-duplication is the non-common code path, so the tradeoff is worthwhile.

Reviewed By: chadaustin

Differential Revision: D30520228

fbshipit-source-id: 99dea65e828f9c896fdfca6b308106554c989282
2021-08-26 12:28:50 -07:00
Xavier Deguillard
882713319c store: use an F14 map to speed up HgImportRequestQueue::enqueue 1.3x
Summary: The F14 hashmap are significantly faster than the std::unordered_map.

Reviewed By: chadaustin

Differential Revision: D30520225

fbshipit-source-id: d986908c5eac17f66ae2c7589f134c430a3c656e
2021-08-26 12:28:50 -07:00
Xavier Deguillard
a3d6554a8c store: speed up HgImportRequestQueue::enqueue 1.5x
Summary:
When turning on the native prefetch, EdenFS will enqueue tons of blob requests
to the import request queue. The expectation is then that the threads will
dequeue batch of requests and run them. What is being observed is however
vastly different: the dequeued batches are barely bigger than 10, far lower
than the batch capacity, leading to fetching inefficiencies. The reason for
this is that enqueuing is too costly.

The first step in making enqueuing less costly is to reduce the number of times
the lock needs to be acquired by moving the de-duplication inside the enqueue
function itself. On top of reducing the number of times the lock is held, it
also halves the number of allocation done under the lock.

Reviewed By: chadaustin

Differential Revision: D30520226

fbshipit-source-id: 52f6e3c1ec45caa5c47e3fd122b3a933b0448e7c
2021-08-26 12:28:50 -07:00
Xavier Deguillard
7eb4db22db store: convert back some SemiFuture to Future
Summary:
It turns out that we do want to use a Future to make sure that the tracebus and
watches are completed on the producer and not on the consumer of the future. We
could use a `.via(inline executor)` but the code becomes less readable, so
let's just revert the diff.

Reviewed By: chadaustin

Differential Revision: D30545721

fbshipit-source-id: 524033ab4dbd16be0c377647f7f81f7cd57c206d
2021-08-26 12:28:50 -07:00
svcscm svcscm
a0e1c7f71f Updating submodules
Summary:
GitHub commits:

d72be09bbb
1eac79ab43
2dff2ff3e8
ce2f04da61

Reviewed By: wittgenst

fbshipit-source-id: c17aab7f5465990588de3549178015afcecaf50e
2021-08-26 11:24:57 -07:00
svcscm svcscm
e6e4555eb9 Updating submodules
Summary:
GitHub commits:

ef99be2fc4
a65209bf84
bab7f00d9b
211c6589f1
4afa24f8ae
20c4af5bf1
6e667464fa
d3354e751e
bfdf702a79
2d7fcd9299

Reviewed By: wittgenst

fbshipit-source-id: de7d4ad20283d9e1f4918fd7e80e45a47ddb4f91
2021-08-26 11:02:40 -07:00