Commit Graph

68379 Commits

Author SHA1 Message Date
Xavier Deguillard
4f9bfb66fc inodes: avoid unecessary shared_ptr copies
Summary:
Passing shared_ptr by copy everywhere can be expensive as it forces an atomic
operation to be performed. Since the caller of the glob code can easily
guarantee that the data will outlive the globbing code, let's just pass
references/pointers to it so that only references and pointers are copied.

Reviewed By: genevievehelsel

Differential Revision: D31344889

fbshipit-source-id: cee797202470aa123381d9ee22e11780722f5b33
2021-10-06 17:18:25 -07:00
Jun Wu
9247ce318a edenapi: add retries for hash<->location endpoints
Summary: The endpoint can fail sometimes. Add retries to make it more reliable.

Reviewed By: yancouto

Differential Revision: D31407279

fbshipit-source-id: 1b05feedd65477aa0b9cd07be30217b4f2e6d1b2
2021-10-06 17:14:04 -07:00
Jun Wu
a0a58d77d4 http-client: add Clone for some structs
Summary: This will be used by the next change.

Reviewed By: yancouto

Differential Revision: D31407281

fbshipit-source-id: 6e3e26a0fb4864d2076d2aafcb0f0ba919bfe2cc
2021-10-06 17:14:04 -07:00
Jun Wu
b68ef5e195 edenapi: change hash<->location from Response<T> to Vec<T>
Summary:
The `Response` type in edenapi has extra complexity about async streaming.
It is more useful for large data like file contents. For metadata like the
hash<->location translation, using a plain `Vec` is much simpler. Using
`Vec` also makes it easier to implement retry logic.

Reviewed By: yancouto

Differential Revision: D31407278

fbshipit-source-id: 9d6df225d183eaffe72f99cfd53ae3cd2987a518
2021-10-06 17:14:04 -07:00
Jun Wu
b16b09239e edenapi: remove EdenApiBlocking
Summary:
We concluded that ideally `sync -> block_on(async)` only happens in Python
wrappers, not pure Rust code. With that, `EdenApiBlocking` makes it easier
to write anti-pattern pure Rust code, and itself looks a bit repetitive.
All users of `EdenApiBlocking` have been migrated. So let's drop
`EdenApiBlocking` now.

Reviewed By: yancouto

Differential Revision: D31407284

fbshipit-source-id: 797506ccd07f413ac041dcd2ea07b3a3519d912f
2021-10-06 17:14:04 -07:00
Jun Wu
cbb7df0fc1 edenapi: avoid EdenApiBlocking in C bindings
Summary: Unblocks removing `EdenApiBlocking`.

Reviewed By: yancouto

Differential Revision: D31416612

fbshipit-source-id: c2aa1add69c24ba247c4bdcfcacaeaceb15ac0d6
2021-10-06 17:14:04 -07:00
Jun Wu
c22c44397e pyedenapi: avoid EdenApiBlocking
Summary:
There are only a few places using EdenApiBlocking. The other endpoints are just
using explicit `block_on` constructs.

Let's migrate the endpoints off the EdenApiBlocking trait.

Reviewed By: yancouto

Differential Revision: D31407287

fbshipit-source-id: edeb16a1ed4f50cc01c75546df7362673f941d01
2021-10-06 17:14:04 -07:00
Jun Wu
1b487cf434 hgcommands: drop EdenApiBlocking dep for debughttp
Summary:
EdenApiBlocking is going away. Drop another dependency on it.
This also adds proper Ctrl+C support for the command.

Reviewed By: yancouto

Differential Revision: D31407285

fbshipit-source-id: 6c5f40f2933fdd54db197ae6b93c5f240eda1c25
2021-10-06 17:14:04 -07:00
Jun Wu
05139b453b commands: avoid EdenApiBlocking in debugsegmentclone
Summary:
This makes it possible to drop EdenApiBlocking. Since the actual lazy clone
logic is in the Python code, we might want to only keep one of the Rust or
Python lazy clone logic eventually.

Reviewed By: yancouto

Differential Revision: D31407286

fbshipit-source-id: 3685edbf6e4709aaf8190ba65035d6627ef83fe9
2021-10-06 17:14:04 -07:00
Jun Wu
7b4881a7a4 revisionstore: drop dep on EdenApiBlocking
Summary:
`EdenApiBlocking` was there to provide some convenience for non-async code to
use edenapi. Now a lot of places actually use async Rust properly, and calling
async Rust from non-async Rust is not a great practice. So let's plan for
`EdenApiBlocking` removal. To unblock it, drop `EdenApiBlocking` usage in
revisionstore.

Reviewed By: yancouto

Differential Revision: D31407282

fbshipit-source-id: 70a6e9468606176cf5cf119418547e694e229ec4
2021-10-06 17:14:04 -07:00
Jun Wu
761083b02a edenapi: make retry count configurable
Summary:
Add a config option `edenapi.max-retry-per-request` to control the maximum
retry count. Replace the hard-coded 10 with it.

Reviewed By: yancouto

Differential Revision: D31407280

fbshipit-source-id: 654c79601fe12007e6cbf7ac6a4110da420801dd
2021-10-06 17:14:04 -07:00
Jun Wu
7fec2084fe edenapi: add a general-purposed retry method
Summary: Add a general retry method for futures. Move clone and pull paths to use it.

Reviewed By: yancouto

Differential Revision: D31407283

fbshipit-source-id: 46ec2bd5bacdcd10ae5078ced8d12f2c8b9ed1ec
2021-10-06 17:14:03 -07:00
svcscm svcscm
0933801b3f Updating submodules
Summary:
GitHub commits:

9750820dff
88154179a8
8a0411b242
cefbd83b6c
e173ada6e4
24b292792a
72c726016e
1c7ef64f63
37115340ff
c31d54e309
23fc7498f0

Reviewed By: jurajh-fb

fbshipit-source-id: fc1c146bfcd9c0a88fbc64b38f9c9ad33599a464
2021-10-06 16:58:39 -07:00
svcscm svcscm
d06550c630 Updating submodules
Summary:
GitHub commits:

fef639cfb7
6cfd907442
eaf47652d1
e6c19c133c
ae09531778
017308a709
e92a46afa6
044081b4e6
94ade7b624
2bf89f490c
69a8ea03bc
b99cb8e18f

Reviewed By: jurajh-fb

fbshipit-source-id: 0d2a6374858a411bc3df95c9f2b385bad11d8c7a
2021-10-06 16:27:46 -07:00
svcscm svcscm
6381107681 Updating submodules
Summary:
GitHub commits:

c4693d071b
0bc11efbc4
91d028bb59
4bd3e4e0c1
6e7cb33ee3
04d96349cc
af7c35e69d

Reviewed By: jurajh-fb

fbshipit-source-id: 51e729002095b29edb7e642fb132ae7d3a26a5d6
2021-10-06 15:57:23 -07:00
Jun Wu
c14f3bd128 debugresetheads: make "no head left" error more clear
Summary:
The error is most likely a misconfiguration. Prompt the user to check the
message.

Differential Revision: D31383947

fbshipit-source-id: c58c2b026048266fc0a8c90f31928c97a2381258
2021-10-06 15:29:59 -07:00
svcscm svcscm
0c0f6a3539 Updating submodules
Summary:
GitHub commits:

24337d2dba
9154601dca
e45d343727
3661e2baab
f8a14d9768
f9785f913f

Reviewed By: jurajh-fb

fbshipit-source-id: a2abe9dd0848cf1c9ca579da321a6ff6d97daf23
2021-10-06 15:21:52 -07:00
svcscm svcscm
a947c776c9 Updating submodules
Summary:
GitHub commits:

bb6b98ef38
fe12079092
b95ba773d5
2166e1fbd6
038dbe4e18
1b3394be6b
007576f631
a38501249b
a40ca2710b

Reviewed By: jurajh-fb

fbshipit-source-id: 26a22ca3a3dcf2be2b00ade82201f7f361cc832a
2021-10-06 14:48:27 -07:00
svcscm svcscm
59c1dc7bf8 Updating submodules
Summary:
GitHub commits:

00ecea49b9
9b518a98e2
8bc302eea7
04c5230a10
b337b2cb35
d5b885a8b4
3d31f6c1fd
c4b3669b6b
6f88181953
905513b4ac
411f1aacf8

Reviewed By: jurajh-fb

fbshipit-source-id: eebf169812be46b81e1c7b66fa38204b88b4aa4d
2021-10-06 14:16:47 -07:00
svcscm svcscm
6fe6c3101b Updating submodules
Summary:
GitHub commits:

9e1ea2179b
50370846d5
d60070aa53
4dbcd7baf2
1d93a656b7
d91aea7546
e1474f38b4
1c3fe37cab
f80527f048
092bdd79f7

Reviewed By: jurajh-fb

fbshipit-source-id: 84d1c1845619b26a4dceae3fd55dfecea48a59da
2021-10-06 13:44:07 -07:00
svcscm svcscm
9c078f51eb Updating submodules
Summary:
GitHub commits:

6c2e5ef145
278276e24f
651e52327c
ff09a91d0e
cdc52b9e78
1e971b1f3a
7ebdb13060
bfb5e86920
3f9d44640a
48dfec58b2
2e58b6faa8

Reviewed By: jurajh-fb

fbshipit-source-id: 5c2b818e979fdeed9d8cbed34acbe7f48ea4dfed
2021-10-06 13:11:41 -07:00
svcscm svcscm
4aafac45dc Updating submodules
Summary:
GitHub commits:

0c4bf7b437
c15766d09d
d2d3f8761e
2274d9d8e2
a0d81894b5

Reviewed By: jurajh-fb

fbshipit-source-id: 7d7160c641567c2eff2b9f7a88625d544d84fec0
2021-10-06 12:45:22 -07:00
Yan Soares Couto
30d4c8fc2d Make RNG in 'arbitrary' calls more correct
Summary:
Using modulo on arbitrary integers to get random numbers [isn't correct](https://www.internalfb.com/diff/D31305392 (da13975a4f)?dst_version_fbid=311037904117090&transaction_fbid=550270779610744), as the distribution between numbers isn't fair (unless the size is a power of two).

This was raised on D31305392 (da13975a4f), but we decided to land that quickly to unblock builds before doing these changes.

I'm applying the changes suggested on D31305392 (da13975a4f). This is what this diff does:
- For all cases where we generate small numbers (up to 5), replace with call to `Gen::choose`, so `u32::arbitrary(g) % 3` becomes `g.choose(&[0, 1, 2]).unwrap()`.
- For generating numbers in range 0..=1, I instead replaced with generating a boolean, which gets rid of the `unreachable!` calls.
- I removed the code to generate numbers in range 0..=0.
- For generating larger numbers, I used `u64::arbitrary` instead, which should make things "less wrong".

Some things I assumed, but am happy to change before landing, just let me know:
- Theoretically we don't *need* to change the code for `% 2` and `% 4`, as the math checks out there. I changed it for consistency there, but am happy to change it back.
- Using boolean also wasn't suggested initially, I'm happy to change back.

Reviewed By: krallin

Differential Revision: D31379381

fbshipit-source-id: a0bac26ebabd32a6c65f717512de998ef5dc37c8
2021-10-06 09:39:23 -07:00
Ilia Medianikov
acca78ca5f mononoke/scs: make commit_lookup_pushrebase_history more precise by using sync direction
Summary:
`commit_lookup_pushrebase_history` is an endpoint that tries to traverse Pushrebase and Commit Sync mappings to find the commit's pushed version for a landed commit. But currently it traverses Commit Sync mapping blindly because it doesn't know the sync direction. This can (very rare) lead to an inaccurate result.

Let's use the `source_repo` column I've introduced in this diff stack and don't traverse in the wrong direction if we know it is wrong.

Reviewed By: StanislavGlebik

Differential Revision: D30975759

fbshipit-source-id: 9c5ecf059dcdebf0c91f0c5545f0c6e95610c2ec
2021-10-06 09:22:33 -07:00
svcscm svcscm
81f79513e3 Updating submodules
Summary:
GitHub commits:

fd8e528b75
1a3908c3b8
995a2ec24c
53e595d1f3
2e83add899
e87ff3c7f8

Reviewed By: jurajh-fb

fbshipit-source-id: 761f07d8c698b904fa7d765ef3149babc9bec6bd
2021-10-06 08:46:26 -07:00
Liubov Dmitrieva
055afa0ca2 modernise tests by using moder newserver function
Summary:
modernise tests by using moder newserver function

the function is shorter and it will also allow us to run the tests with Mononoke in the future

Reviewed By: yancouto

Differential Revision: D30773102

fbshipit-source-id: 994cbcfb2688aef3e96446e1cb021db72bc70c67
2021-10-06 08:14:05 -07:00
Yan Soares Couto
07d0da77d8 Fix quickcheck mincode test
Summary:
Another test that was broken by quickcheck update. I notice it breaking a run of `hg_windows` [here](https://www.internalfb.com/intern/sandcastle/log/?instance_id=4503600123928895&step_id=4503604846860319&step_index=9&name=Run%20cargo%20test#479) (though it's not windows specific).

The problem is quickcheck started using NaN on floats, which surfaced some invalid code. In roundtrip tests, we need our struct to implement `Eq`, which f32 does not (since NaN != NaN). Workaround was implementing something that also considers NaN == NaN.

Question: Do I also fix the hg-server version of the test?

Reviewed By: krallin

Differential Revision: D31401277

fbshipit-source-id: b3eef1a3aef395a1194308788ec74f1bb5a33a42
2021-10-06 07:33:34 -07:00
svcscm svcscm
815e57d238 Updating submodules
Summary:
GitHub commits:

c64b0339c5
9801b00298

Reviewed By: jurajh-fb

fbshipit-source-id: 1d67378a5fb4ddaea9d39dea1c813a6d55bbc582
2021-10-06 07:18:15 -07:00
Mark Juggurnauth-Thomas
8f83d39d17 backfill_derived_data: use background session class
Summary:
The backfiller should use the background session class so that we ensure data
is written to all blobstores in a multiplex.

Reviewed By: yancouto

Differential Revision: D31429168

fbshipit-source-id: 32c767dbef291771565f73cedf3cd01c1a3cce40
2021-10-06 06:31:21 -07:00
Mark Juggurnauth-Thomas
2b6c4ae767 derived_data_manager: mark batch-backfilled commits as derived
Summary:
When rederiving batches of commits, the batch derivation process must mark
these commits as derived so that rederivation will continue with the next
batch.

Reviewed By: yancouto

Differential Revision: D31429169

fbshipit-source-id: e9f6a84a0391ee8d72a0007f39e755410bfac724
2021-10-06 06:31:20 -07:00
Yan Soares Couto
b3b2e16f97 Cleanup old derived data
Summary: Since we migrated all derived data types to use manager, we can now delete a bunch of code.

Reviewed By: krallin

Differential Revision: D31344999

fbshipit-source-id: db864bdc3ba0f95cb34be6e554d629d254f09608
2021-10-06 06:01:42 -07:00
Liubov Dmitrieva
c14d68f17b fix test
Summary: The test output was previously incorrect due to wrong rounding from jq tool

Reviewed By: ahornby

Differential Revision: D31429221

fbshipit-source-id: 2979e393c6f6c1b52e41d732f155275166062bff
2021-10-06 04:40:18 -07:00
svcscm svcscm
d37115f51f Updating submodules
Summary:
GitHub commits:

1efee5e824
ad39eaccd9
004699824d
67ce9dc888

Reviewed By: jurajh-fb

fbshipit-source-id: a9259b21b00f11a8365478a627a7833320e0cd48
2021-10-06 03:40:06 -07:00
Liubov Dmitrieva
d541aea36b fix the values in the test
Summary:
fix the values in the test, the test was broken due to changes in jq

jq used to provide incorrect rounding.

Reviewed By: ahornby

Differential Revision: D31390426

fbshipit-source-id: ab4d7014109d23aa5b4fb95db4f485cea70e5b05
2021-10-06 03:32:56 -07:00
Egor Tkachenko
be8d3b9f5e Extract DerivedGeneration into library
Summary: I'm going to reuse that derived type for unit-test in 2DService. And for that I need to make it library.

Reviewed By: HarveyHunt

Differential Revision: D31340518

fbshipit-source-id: 3960c0d3ae9a72e1fa6dc9afb170c0c708b3cdf8
2021-10-06 03:20:05 -07:00
svcscm svcscm
470ea7395c Updating submodules
Summary:
GitHub commits:

d9a3c941c8

Reviewed By: jurajh-fb

fbshipit-source-id: a0f8e81023352b429f84a8955f89297cfd890542
2021-10-06 03:13:52 -07:00
svcscm svcscm
6869d6f238 Updating submodules
Summary:
GitHub commits:

49a43af9bf
e0dba3001a
694dbd1b86
562dd8260a

Reviewed By: jurajh-fb

fbshipit-source-id: 81968c634e2463585d7dc6110f9a6567a31b79d8
2021-10-06 02:32:12 -07:00
svcscm svcscm
f4cff25f9f Updating submodules
Summary:
GitHub commits:

061aa995d2
40686919c0
bab4d31dd4
77c04ce426
5150e3772e
5b08064683

Reviewed By: jurajh-fb

fbshipit-source-id: dd774f5a649616c9eb945035bdcb2b5d12134404
2021-10-06 02:09:25 -07:00
CodemodService Bot
c2564498eb Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D31426792

fbshipit-source-id: 11c5e29f3c4deaa74e7b2f8ab2eec8940cb5fe4a
2021-10-06 02:06:23 -07:00
svcscm svcscm
80edc3a047 Updating submodules
Summary:
GitHub commits:

390e056f85
aaee4b0bfb
ec00101d5f
899e1992cd
00a2a3a4b2
eb4eff7480
f7553630df
7d3b73b956
5e101d9c7e

Reviewed By: jurajh-fb

fbshipit-source-id: d8caca9dfa20e9d9225af5128df774a99253a10f
2021-10-06 01:42:41 -07:00
svcscm svcscm
a50853fb42 Updating submodules
Summary:
GitHub commits:

9095e97be6
348d246ae6
10640839a7
bd566c1cc4
a6314cc4ce
c6de2d797c
860285e168
e43434e477
b2c8c4a430
014f6ff79e

Reviewed By: jurajh-fb

fbshipit-source-id: 46c4a09e68a8e355f4f07ea212ac892bff41eeeb
2021-10-06 01:18:58 -07:00
svcscm svcscm
41aec76544 Updating submodules
Summary:
GitHub commits:

a79234f073
df6ba03889

Reviewed By: jurajh-fb

fbshipit-source-id: 5a37dffac8e071b4ada71335a7da3eb06004266c
2021-10-06 00:51:39 -07:00
svcscm svcscm
30513415e4 Updating submodules
Summary:
GitHub commits:

b26d912b78
96b71f6db2
8cb6dc13cc
1213017d64

Reviewed By: jurajh-fb

fbshipit-source-id: b7c977bd00978ca73be414207dd23b41570cc2fb
2021-10-05 23:45:45 -07:00
svcscm svcscm
d182fb3597 Updating submodules
Summary:
GitHub commits:

1315e65665

Reviewed By: jurajh-fb

fbshipit-source-id: 2fcc5068919e0486d50ff5cd07f8ab53b6194579
2021-10-05 23:09:23 -07:00
svcscm svcscm
d8431969db Updating submodules
Summary:
GitHub commits:

7489b94310
93b89afbd1
8864c68c23
86d533df9a

Reviewed By: jurajh-fb

fbshipit-source-id: 1df8f496525e397e729a8eb9f9c195fb915a2ba8
2021-10-05 22:47:11 -07:00
svcscm svcscm
6842c83f6b Updating submodules
Summary:
GitHub commits:

8161c2d400
6332ea33a1

Reviewed By: jurajh-fb

fbshipit-source-id: 52d750b83d9d552a9c0fa1959178bbbc42cd2f4b
2021-10-05 22:17:07 -07:00
Xavier Deguillard
11c0481570 store: remove LocalStore usage from BackingStore::getRootTree
Summary:
Writing to the LocalStore is purely the responsability of the
LocalStoreCachedBackingStore and not of the individual BackingStore. Thus, they
cannot assume that the root Tree is actually stored in it and should just
directly import it.

Reviewed By: chadaustin

Differential Revision: D31340206

fbshipit-source-id: 0f485ceb9fa71f7a7bdc8aaefaa850540075c88c
2021-10-05 19:59:27 -07:00
svcscm svcscm
e7c720f580 Updating submodules
Summary:
GitHub commits:

f85abb0087
df7e125a5b
9459dc3ede
f80c6bba54
475bb6538c

Reviewed By: jurajh-fb

fbshipit-source-id: c78bc8fe2c136a7c56f6f0d9464541bbb4d4dbe7
2021-10-05 19:15:58 -07:00
Xavier Deguillard
7ebfd3791f service: speedup glob handler by 26%
Summary:
Looking at Instruments, when issuing tons of glob queries to EdenFS, EdenFS
appears to be spending a very large amount of time adding tasks to the
UnboundedTaskExecutor. Since globs are expected to be fast, we can afford to
execute them inline, reducing this overhead and speeding up glob queries.

Reviewed By: chadaustin

Differential Revision: D31289485

fbshipit-source-id: 428fff9f5fea65073b2a061dc7070d63ae36d95d
2021-10-05 19:10:52 -07:00
Xavier Deguillard
0965da43b3 inodes: eliminate quadratic copies of GlobResult
Summary:
The globbing algorithm is recursive and returns its own glob results merged
with its children's glob results. The merging is done by simply copying the
children's glob result and returning it. What this means is that a single
GlobResult will be copied K times, with K being the recursion depth at which it
was created. This makes the total number of copies be O(K*N) with N the result
length.

Since we can simply avoid these copies by simply creating the GlobResult in a
shared vector, we can avoid the copies entirely at the expense of taking a
lock.

Reviewed By: chadaustin

Differential Revision: D31288036

fbshipit-source-id: ae8a98a01eab2ba7f23908d347d7a4ec199cdfab
2021-10-05 19:10:52 -07:00