Commit Graph

63312 Commits

Author SHA1 Message Date
Jun Wu
ceb965456b dag: fix benches/segment_sizes
Summary:
Benchmark code is out of sync.  Fix it.
Two example runs:

Run 1:

  segments: 50039  log len: 1237879
  ancestor calcuation segment_size=4                449.747 ms
  segments: 41174  log len: 999428
  ancestor calcuation segment_size=8                606.643 ms
  segments: 39708  log len: 958176
  ancestor calcuation segment_size=10               612.112 ms
  segments: 38816  log len: 932717
  ancestor calcuation segment_size=12               684.228 ms
  segments: 38138  log len: 911815
  ancestor calcuation segment_size=14               682.280 ms
  segments: 37642  log len: 895854
  ancestor calcuation segment_size=16               727.111 ms
  segments: 37279  log len: 884784
  ancestor calcuation segment_size=18               654.083 ms
  segments: 37012  log len: 876470
  ancestor calcuation segment_size=20               641.833 ms
  segments: 36794  log len: 869558
  ancestor calcuation segment_size=22               698.835 ms
  segments: 36600  log len: 863383
  ancestor calcuation segment_size=24               752.355 ms
  segments: 36128  log len: 847833
  ancestor calcuation segment_size=32               726.615 ms
  segments: 35466  log len: 825696
  ancestor calcuation segment_size=64               770.747 ms
  segments: 35154  log len: 814629
  ancestor calcuation segment_size=128                1.075 s

Run 2:

  segments: 50039  log len: 1237879
  ancestor calcuation segment_size=4                423.746 ms
  segments: 41174  log len: 999428
  ancestor calcuation segment_size=8                571.049 ms
  segments: 39708  log len: 958176
  ancestor calcuation segment_size=10               610.347 ms
  segments: 38816  log len: 932717
  ancestor calcuation segment_size=12               656.025 ms
  segments: 38138  log len: 911815
  ancestor calcuation segment_size=14               647.035 ms
  segments: 37642  log len: 895854
  ancestor calcuation segment_size=16               674.061 ms
  segments: 37279  log len: 884784
  ancestor calcuation segment_size=18               687.186 ms
  segments: 37012  log len: 876470
  ancestor calcuation segment_size=20               635.952 ms
  segments: 36794  log len: 869558
  ancestor calcuation segment_size=22               679.665 ms
  segments: 36600  log len: 863383
  ancestor calcuation segment_size=24               781.148 ms
  segments: 36128  log len: 847833
  ancestor calcuation segment_size=32               741.290 ms
  segments: 35466  log len: 825696
  ancestor calcuation segment_size=64               761.951 ms
  segments: 35154  log len: 814629
  ancestor calcuation segment_size=128                1.049 s

Seems a good default can is in the 10 to 20 range.

Reviewed By: sfilipco

Differential Revision: D26360560

fbshipit-source-id: 1a2c0d97fe55c9f7e4621ab87da26072cd854bf8
2021-02-10 12:28:29 -08:00
Alex Hornby
9f8457f605 mononoke: add options to override repo bounds for walker
Summary: Its useful to be able to set the repo bounds used for a walk so that issues can be reproduced with the same inputs as a failing chunk.

Differential Revision: D26342439

fbshipit-source-id: b486387be59a3f4d21e3d3dc407420fc339c150d
2021-02-10 12:21:02 -08:00
svcscm
66197e12ad Updating submodules
Summary:
GitHub commits:

af3fd11ee7
998ef79ab9

Reviewed By: jurajh-fb

fbshipit-source-id: ce6ec4075631d9641075c3e0d00d802fef383484
2021-02-10 12:16:02 -08:00
Xavier Deguillard
62076b545e inodes: move dispatchers around
Summary:
Instead of having one "Dispatcher" type that the various backend overload,
let's simply have a per-mount type dispatcher type. The previous model worked
fine when EdenFS supported only one way of mounting a repository, but with NFS
coming, unix platform will support both FUSE and NFS, making the Dispatcher
overload nonsensical.

As a behavioral change, the dispatcher lifetime and ownership is changed a bit.
It used to live for the duration of the EdenMount object, but is now tied to
the channel lifetime, as it is now owned by it.

Reviewed By: kmancini

Differential Revision: D26329477

fbshipit-source-id: 3959b90a4909e3ab0898caa308f54686f59a943c
2021-02-10 11:52:06 -08:00
svcscm
b842d11153 Updating submodules
Summary:
GitHub commits:

78adf935a0
501d701b57
6fe168b951
7ebde3da45
c697c87fcf
e4be3e5672
57c7cc19a5
b27b68bf86

Reviewed By: jurajh-fb

fbshipit-source-id: f145a6a78f27e96d1d0be7473c07cba6c17a4e08
2021-02-10 11:47:26 -08:00
Alex Hornby
9ad29a97ed mononoke: remove BoxStream from walk.rs
Summary: The requirement for boxing is in tail.rs so do the boxing there.

Reviewed By: StanislavGlebik

Differential Revision: D26365153

fbshipit-source-id: 65974fd1e90ca9709ba58200a319ffc6b0fae5db
2021-02-10 10:41:35 -08:00
Stefan Filip
9394e9d035 edenapi_server: add /commit/hash_to_location
Summary:
This endpoint is used by the lazy Segmented Changelog to understand the
location of commit described by hashes. For example users may say that they
want to check out an older commit by hash. The client would then call this
endpoint to understand the relationship of the destination commit relative to
the graph.

Reviewed By: quark-zju

Differential Revision: D26289622

fbshipit-source-id: 4bbfd4bd4f91c984384fff5a6480b8d9d77cf8d3
2021-02-10 10:19:05 -08:00
Stefan Filip
508e226da1 edenapi: add hash-to-location types
Summary: Types for the future /commit/location_to_hash endpoint.

Reviewed By: quark-zju

Differential Revision: D26289621

fbshipit-source-id: 4dddf8fdefa891e6cc35ad692fdd616f2f2eee3f
2021-02-10 10:19:04 -08:00
Stefan Filip
34ff38fe8c mononoke_api: add RepoContext::many_changeset_ids_to_locations
Summary:
Exposes Segmented Changelog changeset to location translation functionality.
This is going to be used by EdenApi endpoints. Those endpoints will be used
by "lazy" Segmented Changelogs on client repositories.

Reviewed By: quark-zju

Differential Revision: D26289620

fbshipit-source-id: 6fb78abab465efd34e2768c8648f438647e9b91c
2021-02-10 10:19:04 -08:00
Stefan Filip
9c6b9af8e0 segmented_changelog: add SegmetedChangelog::changeset_id_to_location
Summary:
Get the graph location of a given commit identifier.

The client using segmented changelog will have only a set of identifiers for
the commits in the graph. The client needs a way to translate user input to
data that it has locally.  For example, when checking out an older commit by
hash the client will have to retrieve a location to understand the place in the
graph of the commit.

Reviewed By: quark-zju

Differential Revision: D26289623

fbshipit-source-id: 4192d91a4cce707419fb52168c5fdff53ac3a9d0
2021-02-10 10:19:03 -08:00
Stefan Filip
f256b5b752 segmented_changelog: add IdMap::find_many_vertexes
Summary: Batch variation for `find_vertex`. Useful for batching hash to location.

Reviewed By: quark-zju

Differential Revision: D26289618

fbshipit-source-id: b5e642d77715651f44acf64b5eb07529301a493f
2021-02-10 10:19:03 -08:00
Alex Hornby
f04913ab67 mononoke: fix flaky test of checkpoint age in test-walker-checkpoint.t
Summary:
Couldn't reproduce this race locally, but the check for age in tail.rs is ```Duration::from_secs(age_secs as u64) > tail_params.state_max_age`` so the tests existing sleep of 1 second isn't quite enough

```sleep 2``` should make sure that check is at least 2>1 and thus the checkpoint too old logic will run as expected.

Reviewed By: farnz

Differential Revision: D26369058

fbshipit-source-id: 6660c20697bb8e06e693ea1eba048400ee414513
2021-02-10 10:03:56 -08:00
svcscm
f623a9d23c Updating submodules
Summary:
GitHub commits:

ed045172c2
a265f234e9
c16d5a4fda

Reviewed By: jurajh-fb

fbshipit-source-id: 0cd36a469e4506579d6c5ee1c0cadb77ef469824
2021-02-10 09:33:38 -08:00
Xavier Deguillard
c41bf98c58 test: type-check cli_test
Summary:
As I'm modifying the definition for CheckoutConfig, I'm heavily relying on
`pyre` to tell me about the places I need to fix, but this test not being type
checked means that pyre misses it.

Reviewed By: chadaustin

Differential Revision: D26356268

fbshipit-source-id: 2139c0053b182e656074de3117ee1950e519f19a
2021-02-10 08:49:51 -08:00
svcscm
a024f343ac Updating submodules
Summary:
GitHub commits:

070b4242fb
5e1e8c9337
2cfe5751fb

Reviewed By: jurajh-fb

fbshipit-source-id: bfba7d07c8764364dc31073bae38077082e53abf
2021-02-10 07:48:05 -08:00
Alex Hornby
3291f638bc mononoke: add a new test for bounded_traversal_stream's parents
Summary: New test to check that the path to each unfolded node is as expected

Differential Revision: D26319141

fbshipit-source-id: e67052fd8de3e2e8c6d9287a25f52f9511e9d6c8
2021-02-10 07:34:01 -08:00
Alex Hornby
8cb43ffde8 mononoke: extract bounded_traversal_stream tests in preparation for a new variant
Summary:
Split out the bounded_traversal_stream test in preparation for a new variant so we can be sure same expectations apply to both.

The code to build a test tree was common in a few places I touched, so extracted it to a function.

Differential Revision: D23757523

fbshipit-source-id: fbc7844d8445586b13de3a3ccf4f0fb0041bcd6f
2021-02-10 07:34:01 -08:00
svcscm
0ea67055f4 Updating submodules
Summary:
GitHub commits:

49926b98f5
5eb4f0b373

Reviewed By: jurajh-fb

fbshipit-source-id: 5d407abc664918bedd45d8679a38fcf6e14c393c
2021-02-10 06:52:10 -08:00
Thomas Orozco
2a92a037e0 mononoke: add more futures_watchdog
Summary: SCS is still having issues starting up. This might help.

Reviewed By: StanislavGlebik

Differential Revision: D26344057

fbshipit-source-id: 499cee9f28d55856dd156dd83307f72a63d5b30b
2021-02-10 04:02:09 -08:00
svcscm
9f99a9bbca Updating submodules
Summary:
GitHub commits:

7308b449c7
6b2ab4da23

Reviewed By: jurajh-fb

fbshipit-source-id: 5c83bde4867bb5d50fe26b566eb55b3bb032b71e
2021-02-10 04:02:09 -08:00
svcscm
df7ca6fb9a Updating submodules
Summary:
GitHub commits:

c832e926c8

Reviewed By: jurajh-fb

fbshipit-source-id: c7b6d8fd071ac98bdfb1bbd52290ffe1a0549bb5
2021-02-10 02:50:47 -08:00
Aida Getoeva
e90cfe98bb mononoke/hooks: resolve owners rule
Summary:
This diff adds a function that for a given path and a parsed path tree of owners files finds a rule that is going to be applied for the path to check permissions.

Because of how the owners files work, we care about the closest owners file rule to the path. So in the implementation I go from the bottom to up in the owners files path tree.

Reviewed By: StanislavGlebik

Differential Revision: D25379330

fbshipit-source-id: 43b95938c90fdd2e1ef4fe80ed400d171e1df459
2021-02-10 01:48:52 -08:00
Aida Getoeva
c104a929f3 mononoke/hooks: fetch owners files
Summary:
This diff introduces abstractions for the OWNERS files and the rules. For now rules don't have any acl checkers and just store the parsed user and group names as a lists of strings.

Now we find and fetch all the possible owners files using `FileContentFetcher` new API.

Reviewed By: StanislavGlebik

Differential Revision: D25379329

fbshipit-source-id: 0933ef4e5e960102b46af9ed2f3e0b12d9761000
2021-02-10 01:48:52 -08:00
Aida Getoeva
6c4de32589 mononoke/hooks: rename file content fetcher into manager
Summary: The `FileContentFetcher` trait with the new API like `find_content` or `file_changes` looks more like a "manager" rather than a "fetcher".

Reviewed By: StanislavGlebik

Differential Revision: D26040535

fbshipit-source-id: 20ab3b0730e4a2b1cbe2991c3c13a9d8a8ec8f35
2021-02-10 01:48:52 -08:00
svcscm
50cd4f1a69 Updating submodules
Summary:
GitHub commits:

ce1823065e
4cb97e5e01

Reviewed By: jurajh-fb

fbshipit-source-id: 5c80ebdedbb0c154ea32cdd49937f3de0aaaca14
2021-02-10 00:38:15 -08:00
Arun Kulshreshtha
9ddae21be2 edenapi: ensure url ends with slash
Summary: If a URL's path does not end in a trailing slash (e.g., https://example.com/foo/bar.html), `Url::join` will strip off the final path component under the assumption that it is a filename. This is problematic in the case of EdenAPI base URLs, since the endpoints might be under some base URL (e.g., https://example.com/edenapi/v1). This change ensures the final path component will not be stripped off in such cases.

Reviewed By: quark-zju

Differential Revision: D26353232

fbshipit-source-id: 2ec3dc56fd6d5a0ccaf522fcfc34e6741ec95c68
2021-02-09 23:34:54 -08:00
svcscm
61a9943671 Updating submodules
Summary:
GitHub commits:

a7bbceb93f

Reviewed By: jurajh-fb

fbshipit-source-id: 822facdb889cb0a31984ba93eabb837ff8c747ab
2021-02-09 23:03:51 -08:00
svcscm
61496d2cc7 Updating submodules
Summary:
GitHub commits:

5e22daa09d
1248d44095
65487da1f5

Reviewed By: jurajh-fb

fbshipit-source-id: 9621b3eefc48c289d11454d8bd5bfec2b77bb299
2021-02-09 23:03:50 -08:00
svcscm
d1b8476c20 Updating submodules
Summary:
GitHub commits:

1e63a88c83
45e51f7637

Reviewed By: jurajh-fb

fbshipit-source-id: 01e7c6c999d16427075003507961aa04504e6475
2021-02-09 20:31:38 -08:00
Durham Goode
465d10436a grep: fix biggrep integration again
Summary:
The biggrep revision string has changed again. Let's update our code to
handle the old and new format. Filed T84566856 to track why it changed and how
to prevent breakages.

Reviewed By: quark-zju

Differential Revision: D26351188

fbshipit-source-id: aeb53f54e6e23af47c5eedfa32268c043c02088d
2021-02-09 18:29:20 -08:00
Andrey Chursin
fc37800267 checkout: generalize CheckoutPlan::apply for testing
Summary: Allow different type of storages for CheckoutPlan::apply

Reviewed By: quark-zju

Differential Revision: D26291577

fbshipit-source-id: a1c9ba4dbef09e844727ae32eac25c37dd01358e
2021-02-09 17:04:30 -08:00
Andrey Chursin
713af03e97 checkout: track checkout stats
Reviewed By: quark-zju

Differential Revision: D26262590

fbshipit-source-id: fcf96070d167390b60c31392720344fd66732e77
2021-02-09 17:04:30 -08:00
Andrey Chursin
14064f8582 vfs: move conflict handling from pyworker to vfs write
Summary:
Previously, `write` can fail because the destination file exists as a
directory, or the parent directory is missing. pyworker handles those cases
by calling `clear_conflicts` to remove conflicted directories and create
missing parent directories and retry `write`. Practically, for all `write`
usecases (including checkout) we always want the `clear_conflicts` behavior.
Therefore, move `clear_conflicts` to vfs `write` and make it private.

Reviewed By: quark-zju

Differential Revision: D26257829

fbshipit-source-id: 03d1da0767202edba61c47ae5654847c0ea3b33e
2021-02-09 17:04:30 -08:00
Andrey Chursin
d9232f1db3 checkout: handle more complex flag changes
Summary: Currently we pick simple approach and just delete existing file before re-creating it if there is some non-trivial flag change

Reviewed By: quark-zju

Differential Revision: D26239977

fbshipit-source-id: 167efa1bf6018e7f967ef3a9e3c8c62781486ec9
2021-02-09 17:04:29 -08:00
svcscm
ca2be84ea4 Updating submodules
Summary:
GitHub commits:

dd8a44d2da
10537c365b

Reviewed By: jurajh-fb

fbshipit-source-id: 3eff0e3c65175461837455ccc20bb32da4f4a00c
2021-02-09 17:04:29 -08:00
svcscm
d0944e0107 Updating submodules
Summary:
GitHub commits:

a9871a5e47
48669be618

Reviewed By: jurajh-fb

fbshipit-source-id: c8d8f504bcdc6772dff1eb8ac6dec42ad7834012
2021-02-09 13:17:17 -08:00
Xavier Deguillard
c30d62253c nfs: implement PATHCONF
Summary: The PATHCONF call gather various POSIX attribute for the passed in file-handle.

Reviewed By: kmancini

Differential Revision: D26270239

fbshipit-source-id: 96a46c58402ce169cacc789c1df3f05f969dcd33
2021-02-09 12:47:14 -08:00
Xavier Deguillard
e28b909fa6 nfs: add various enums/structs for the PATHCONF call
Summary: This just adds them.

Reviewed By: kmancini

Differential Revision: D26270240

fbshipit-source-id: cae9ff0278ab9a542b5ad7a5c6c2e8c3cc26b1b0
2021-02-09 12:47:14 -08:00
Xavier Deguillard
578ceb1cf0 nfs: fill in the FSINFO procedure
Summary:
The FSINFO procedure is used to collect information about this mount point and
its limits. For now, I've just used random values for most of these, I'll come
back to it later to figure out the ones that makes sense.

Reviewed By: kmancini

Differential Revision: D26269947

fbshipit-source-id: e5fdd961ea7772926208916de0179721930daeab
2021-02-09 12:47:13 -08:00
Xavier Deguillard
25a1ebc16b nfs: store and use straceLogger
Summary: Instead of using a plan DBG7, let's use the strace logger to log the RPC calls.

Reviewed By: kmancini

Differential Revision: D26269946

fbshipit-source-id: e8ab7acc658463b9f0f1d4c420f63b2e0c88f46a
2021-02-09 12:47:13 -08:00
Xavier Deguillard
b8f628d344 nfs: add various enums/structs for the FSINFO call
Summary: These will be needed when implementing FSINFO.

Reviewed By: kmancini

Differential Revision: D26268588

fbshipit-source-id: 8160f00e988a088769ad682a6de062f6c0443c73
2021-02-09 12:47:12 -08:00
Xavier Deguillard
a7741ba0a3 nfs: add std::monostate to XdrVariant
Summary:
Variant are default constructed with the first variant alternative, which means
that when deserialization would not deserialize anything, the first variant
would be initialized. This would mean that deserialize(serialize(myVariant))
would be different from myVariant, which is unexpected.

Reviewed By: kmancini

Differential Revision: D26268586

fbshipit-source-id: ebfd7f9e473509b2a16acdbb6914e828c67c5005
2021-02-09 12:47:12 -08:00
Xavier Deguillard
2f754b2305 inodes: attempt to NFS mount
Summary:
With the PrivHelper now being able to try to NFS mount, we can just plug it in
the EdenMount code to actually attempt to mount EdenFS via NFS.

The mount will expectedly fail due to the FSINFO RPC not being implemented just
yet, but that will be the next step.

Reviewed By: kmancini

Differential Revision: D26266143

fbshipit-source-id: a44ae98af76b55a0c24c89e766c072c1a2e1b4fd
2021-02-09 12:47:11 -08:00
Xavier Deguillard
91336a090e nfs: add NfsServer class
Summary:
This will be the main entry point for everything related to the various NFS
programs. For now, it simply starts an nfsd program when registering a new
mount point and returns the ports that mount(2) should use to connect to it.

Reviewed By: kmancini

Differential Revision: D26204060

fbshipit-source-id: 115d2d206109499d5b49c529ebf1f739fc364c23
2021-02-09 12:47:11 -08:00
Xavier Deguillard
fcffed9226 nfs: explicitely pass the EventBase to run the RpcServer on
Summary:
Using the current EventBase can lead to unexpected behavior when the RpcServer
is created on the wrong thread. For instance, if it is created on a thread
pool, and another future is running on that same thread, the RpcServer won't be
able to accept and service new connections, potentially leading to deadlocks.

To avoid this, EdenFS's EventBase is excplicitely passed in, this will ensure
that the RpcServer is created on the proper thread.

Reviewed By: kmancini

Differential Revision: D26266145

fbshipit-source-id: 23211e3aa200c32d2f6fbbfd9ae6fb307896a873
2021-02-09 12:47:10 -08:00
svcscm
fc8c54f3ba Updating submodules
Summary:
GitHub commits:

35c058e4dd

Reviewed By: jurajh-fb

fbshipit-source-id: 23cea36bea96da8777a51b83ea9abc0fb339aabd
2021-02-09 12:25:38 -08:00
Simon Farnsworth
acd24deb41 Make it possible to only set initial generations in sqlblob_gc
Summary:
It looks like the load created by GC marking can cause setting the initial generation for new blobs to fail as the DB is loaded and cannot lock the `chunk_generation` table.

Make it possible to run that before starting the mark process, and to run the sweep without marking new blobs. This will allow the Chronos job to avoid running both the initial generation set *and* the sweep concurrently, while still ensuring that any manual runs outside Chronos do both by default.

Reviewed By: ahornby

Differential Revision: D26232760

fbshipit-source-id: 94122c7b72588201800a45e41b26fbd03c6656ad
2021-02-09 11:59:00 -08:00
Simon Farnsworth
c0f4bf846a Use replication delays in sqlblob_gc
Summary: Having these bypass the normal delay mechanism means that our lag protection is not complete. Fill in the gap

Reviewed By: ahornby

Differential Revision: D26226896

fbshipit-source-id: bd907eff79c9b0387145c637c515525609214c76
2021-02-09 11:58:59 -08:00
svcscm
f2cf7f5c35 Updating submodules
Summary:
GitHub commits:

a290661b92
53e75a680c
4e70630ac3
aa95ceb6a4
f0d32bfebc
ae722ce82f
875a552b23
0b593b1d46
b29f70853b
0a31f4693b
9704efcbda

Reviewed By: jurajh-fb

fbshipit-source-id: a1e4ebc9949146515512791b45b65f1730fdf07f
2021-02-09 11:34:56 -08:00
Stefan Filip
8117a681e8 segmented_changelog: add guardrail to location_to_changeset_id
Summary:
If `location_to_changeset_id` somehow does not get a vector with one element
it will panic and our server will stop immediately. Not great for a server.
Changes are low but we already return `anyhow::Result` so no big pain here.

Reviewed By: quark-zju

Differential Revision: D26180417

fbshipit-source-id: 6986f3fdd0b34f7c2606162bc35aacb9857ea04c
2021-02-09 11:31:31 -08:00