Commit Graph

65117 Commits

Author SHA1 Message Date
Mark Juggurnauth-Thomas
a32ccfc5cc blobrepo: delete BlobRepo::new_dangerous
Summary: This is no longer needed, as all construction is performed by facet factories.

Reviewed By: StanislavGlebik

Differential Revision: D28001390

fbshipit-source-id: 237dd4f7b8b08bec5b85360edc3be7018d9161de
2021-04-29 06:11:20 -07:00
Mark Juggurnauth-Thomas
139d93bedb changesets: split implementation to a separate crate
Summary:
Keeping the `Changesets` trait as well as its implementations in the same crate means that users of `Changesets` also transitively depend on everything that is needed to implement it.

Flatten the dependency graph a little by splitting it into two crates: most users of `Changesets` will only depend on the trait definition.  Only the factories need depend on the implementations.

Reviewed By: krallin

Differential Revision: D27430612

fbshipit-source-id: 6b45fe4ae6b0fa1b95439be5ab491b1675c4b177
2021-04-29 06:11:20 -07:00
Mark Juggurnauth-Thomas
d66e56c407 changesets: remember repo_id in changesets
Summary:
The changesets object is only valid to access the changesets of a single repo
(other repos may have different metadata database config), so it is pointless
for all methods to require the caller to provide the correct one.  Instead,
make the changesets object remember the repo id.

Reviewed By: krallin

Differential Revision: D27430611

fbshipit-source-id: bf2c398af2e5eb77c1c7c55a89752753020939ab
2021-04-29 06:11:20 -07:00
Mark Juggurnauth-Thomas
b935836e32 changesets: replace get_sql_changesets with enumeration methods
Summary:
The `get_sql_changesets` method on `Changesets` is an abstraction violation,
and prevents extraction of `SqlChangesets` to a separate crate as it would
introduce a circular dependency.

It is used to allow bulk queries to enumerate changesets by integer unique ID,
so promote this to a full feature of `changesets`, and remove the
`get_sql_changesets` method.

Reviewed By: krallin

Differential Revision: D27426921

fbshipit-source-id: 2839503029b262dd5e6a8be09bb35bb143b4c5ac
2021-04-29 06:11:20 -07:00
svcscm svcscm
cdeaae40c2 Updating submodules
Summary:
GitHub commits:

4582c9d90d
fe2d29abc6
bfb1f93067
224e93ee9c
58567289f8
c7df5c045d

Reviewed By: jurajh-fb

fbshipit-source-id: d225a14c2f00f491ea4317cbdbb111844b65cad4
2021-04-29 05:38:40 -07:00
svcscm svcscm
bffc218e04 Updating submodules
Summary:
GitHub commits:

67b4e543bb
9fbf6364a0
7d8b799fba
05344317b3
a4be575e69

Reviewed By: jurajh-fb

fbshipit-source-id: 89d1f9b170a4ffae5761947ab82bf22812841fc7
2021-04-29 03:21:10 -07:00
svcscm svcscm
716a665543 Updating submodules
Summary:
GitHub commits:

0d927e0f7c
d58f87cd48
192432c203
8e7aa3f2c2
d73aa074c4
273257d6f9

Reviewed By: jurajh-fb

fbshipit-source-id: 29910bf41a26ffd207540a234b89bb08164d1970
2021-04-29 02:18:06 -07:00
svcscm svcscm
12a9678a7b Updating submodules
Summary:
GitHub commits:

1f48717717
b84e18e5be
bbb8c0f97b
5efbebbdd8
ab82698c2b
0a7e24d669
e6cf80618d
637e31003e
1943d4047b

Reviewed By: jurajh-fb

fbshipit-source-id: 970b5b68699bc21b07b9b2355f5f013aa3be9df0
2021-04-29 01:35:46 -07:00
svcscm svcscm
1bf85935a3 Updating submodules
Summary:
GitHub commits:

c8b1d4182b
a8fbfdf1c1
1e10e458f4
bb9134d252
797d541796
d0d64ca7a6
1db393a91f
24faa1a8c0
70ab2b5ee4
351eadb947

Reviewed By: jurajh-fb

fbshipit-source-id: 59b963f7d439c31ccb2374443f62d1caee1b82af
2021-04-28 23:56:10 -07:00
svcscm svcscm
f3f1f82fb0 Updating submodules
Summary:
GitHub commits:

0b19393baf

Reviewed By: jurajh-fb

fbshipit-source-id: 564db0a5e5766915f5516633f5eb2372fc53b49e
2021-04-28 23:06:11 -07:00
svcscm svcscm
01b67acb96 Updating submodules
Summary:
GitHub commits:

4d5ebf1602
9a84a03beb
11dfb69937
68c0d0bd4a

Reviewed By: jurajh-fb

fbshipit-source-id: 6b749c3a5030d5504cf303559b2943cf8e4c1836
2021-04-28 22:04:52 -07:00
svcscm svcscm
65aa4bab7c Updating submodules
Summary:
GitHub commits:

1046ed6779
de97c5e4fd
df40ab771e
7d25576e09
9c505c8afd
365edc2402
6ab8873c07

Reviewed By: jurajh-fb

fbshipit-source-id: 2d3dae5fe972fe241a3f994993174851bdc7ea7d
2021-04-28 21:21:58 -07:00
svcscm svcscm
2e3ab3d387 Updating submodules
Summary:
GitHub commits:

b98c2d4700
44b457e1b9
8c3994c213
fddf4bac1e
4a9f2cdd4d
f9df3a0c25
237d614191
e002140ee6
458b89986b

Reviewed By: jurajh-fb

fbshipit-source-id: fefb5a0b0d687c7fd18ce64fdad56023c4427b06
2021-04-28 18:31:58 -07:00
svcscm svcscm
16df1caaa2 Updating submodules
Summary:
GitHub commits:

3a47a97951
916de2270b
ec89079c7d
a5a30d7342
481504cf2e
b0e6c7856a
bcafb639aa
e9d080fef9
06d58087a2
82cb5439f4

Reviewed By: jurajh-fb

fbshipit-source-id: 8af9bd36cbc6524f643485d0a87dfcde687dbcaa
2021-04-28 17:46:16 -07:00
svcscm svcscm
d4228a866e Updating submodules
Summary:
GitHub commits:

2a80218d46
e093c49f75

Reviewed By: jurajh-fb

fbshipit-source-id: 840a9cd01e93a5b218044ccffbfd7fa3409686aa
2021-04-28 17:10:09 -07:00
Xavier Deguillard
42b17dfa1c nfs: add to Executor directly without creating a future
Summary:
folly::via is a Future API, and thus it creates one, which requires allocating
it and then attaching it to the Executore. Since the code to dispatch a request
isn't Future based, we don't need to use folly::via, and we can simply add the
lambda to the Executor directly. This removes expensive memory allocations from
the EventBase.

Reviewed By: kmancini

Differential Revision: D27976674

fbshipit-source-id: 8fa9724a94ba69b071ab894cdbbad0d33733c098
2021-04-28 17:06:23 -07:00
Xavier Deguillard
72b4096a06 nfs: remove multi-fragment O(N^2) complexity
Summary:
Neither macOS, nor Linux are sending multi-fragment requests to the NFS server.
Since supporting these means calling into memmove, which can be expensive for
large requests, let's just remove support for them for now. If somehow macOS
and/or Linux start sending these, the XCHECK(isLast) will catch this and we can
fix the code by then.

Reviewed By: kmancini

Differential Revision: D27976671

fbshipit-source-id: 77c758b2bb36517d22d5b637e6f0ebf84cc19e5b
2021-04-28 17:06:23 -07:00
Xavier Deguillard
32ee50d702 nfs: move some code out of the event base
Summary:
The EventBase is single threaded, and for heavily concurrent client workflows,
it could see a lot activity, thus every cycle saved can be used to drive more
client requests. The construction of the IOBuf doesn't need to be done while in
the EventBase, thus let's build it outside.

Reviewed By: kmancini

Differential Revision: D27976670

fbshipit-source-id: c6c015ef26df1dcb3fc0c5f179e474bafbd71fac
2021-04-28 17:06:23 -07:00
Xavier Deguillard
04ba04fe88 nfs: bump buffer preallocation size
Summary:
Passing 64 to preallocate means that the AsyncSocket code will issue reads of
64 bytes, even though the IOBufQueue has significantly more space available. We
can thus pass a bigger size to preallocate to reduce both the cost of
allocation, and the syscall cost. For heavily concurrent client code, this will
allow us to read more than one request per syscall.

The careful reader may have noticed that for very small requests the code may
reallocate more often that it should as it will always reallocate when falling
under 4KB. This is likely to not be an issue in practice.

Reviewed By: kmancini

Differential Revision: D27976672

fbshipit-source-id: 4c7e3aecc4763ab20854f3c466ce0872332f9b77
2021-04-28 17:06:23 -07:00
Xavier Deguillard
4daf57cab6 nfs: various cleanup of Server.cpp
Summary:
These are various cleanups that should make the code easier to read, there is
no behavior changes.

Reviewed By: kmancini

Differential Revision: D27976673

fbshipit-source-id: 470eb628ca75bf1712a93c6e9aa3a27c3f314d01
2021-04-28 17:06:23 -07:00
Xavier Deguillard
3185c2f83e inodes: cache size for non-materialized inodes
Summary:
Running `rg foobar` in a loop and profiling EdenFS shows that we're spending a
significant amount of time collecting the size of non-materialized files. Since
this will never change, we can easily cache it for much faster access.

Reviewed By: chadaustin

Differential Revision: D27924804

fbshipit-source-id: 8b8af63dcb82664db2ecd81b3fcdc006a3a52d72
2021-04-28 17:06:23 -07:00
Alex Hornby
a709d203e4 mononoke: fix build
Summary: fix the build

Reviewed By: sfilipco

Differential Revision: D28069668

fbshipit-source-id: f50c302807b7b18ab3e8d7a9600a6e9f4d6a4a71
2021-04-28 16:53:10 -07:00
Yipu Miao
85b9f8ed3d creating RE CAS Digest proxy
Summary: Create a proxy that stored RECAS-> Eden Hash, similar to SCS and HG proxy.

Reviewed By: chadaustin

Differential Revision: D27873498

fbshipit-source-id: 0b3e50e3a74b8f0914547178789cb6684b780866
2021-04-28 14:59:39 -07:00
Yipu Miao
10dd235a48 creating RE CAS backing store with everything unimplemented.
Summary: Create a RE-CAS backing store with all APIs unimplemented, and Linux only.

Reviewed By: chadaustin

Differential Revision: D27771047

fbshipit-source-id: de00c6e290f924872eae7290b1945e6b3f40d610
2021-04-28 14:59:39 -07:00
svcscm svcscm
d1df99261c Updating submodules
Summary:
GitHub commits:

151f8bb0db
31adf4cbc6
a0e0feca62
b438f2f4fd
17e63ca51a

Reviewed By: jurajh-fb

fbshipit-source-id: 10d6f432826064009592cf592e06859648da1c59
2021-04-28 14:04:44 -07:00
svcscm svcscm
d0d7786f0a Updating submodules
Summary:
GitHub commits:

52537f781e
e73be5ab5d
4da4a63d7f
080c3a4a98
9351a56eb2
0db4cde6e2
5b59b05f50
7edaba207c

Reviewed By: jurajh-fb

fbshipit-source-id: a3dd1b8c0b2b3560ececead5c88eddc31c39c39f
2021-04-28 13:00:40 -07:00
Jun Wu
9bf34fe364 remotenames: pass list to pushop.remote.known
Summary:
The "known" API is expected to accept a list with ordering guarantees.
Avoid passing `set` to it. This also stabilizes debug outputs in (upcoming)
tests.

Update `setdiscovery` to pass a list with stable order too.

Reviewed By: kulshrax

Differential Revision: D27951627

fbshipit-source-id: a2718e4380f80584fc8afc35d14e524ab428f9bd
2021-04-28 12:28:28 -07:00
Jun Wu
20975cd6e7 pyedenapi: add commit graph and commit known APIs
Summary: Expose the Rust logic to Python.

Reviewed By: kulshrax

Differential Revision: D27951635

fbshipit-source-id: 541c768ccdd8d456dd82551daa3e60266373482a
2021-04-28 12:28:28 -07:00
Jun Wu
08349e7129 eagerepo: implement commit_graph and commit_known endpoints
Summary: They will be useful in the pull exchange path.

Reviewed By: kulshrax

Differential Revision: D27951625

fbshipit-source-id: 31dfd54cda7a0d0d0b2565e0ecddc2e82eebcc05
2021-04-28 12:28:28 -07:00
Jun Wu
0e501c05e1 edenapi: define commit_graph endpoint
Summary:
This will be used to migrate "pull" from bundle2 to EdenApi.
This diff just defines the interface in a minimal way.
Actual implementation is TBD.

Differential Revision: D27951634

fbshipit-source-id: 66210a833d8fc87452a19d1935e9d208a1d31b14
2021-04-28 12:28:28 -07:00
Jun Wu
e4044c718c edenapi: define commit_known endpoint
Summary:
This will be used to migrate "pull" from bundle2 to EdenApi.
This diff just defines the interface in a minimal way. Actual implementation is TBD.

I dropped the progress callback parameter since the native Rust progress bars
make it unnecessary. I also avoided the blocking API interface, since we would
like pure Rust code to not call blocking APIs which is likely a mistake, and
only use `async_runtime::block_on` in Python bindings - in that case blocking
API is not needed.

Reviewed By: andll

Differential Revision: D27951624

fbshipit-source-id: 3844dd96df265cc6e61d7cf5e79f39c891e8117d
2021-04-28 12:28:28 -07:00
Andrey Chursin
11eb0eb74e debugdryup: handle sparse profiles
Summary: This makes use of plan calculation logic in merge.py

Reviewed By: quark-zju

Differential Revision: D28045174

fbshipit-source-id: f2bfd1104ba2d010c2b911aa6c643b057e4cb91d
2021-04-28 12:26:08 -07:00
Andrey Chursin
9e05b5f6f2 checkout: factor out plan calculation in merge.py
Summary: This factors out native checkout plan calculation (including handling sparse profiles) into separate fn

Reviewed By: quark-zju

Differential Revision: D28045175

fbshipit-source-id: cd034b2c335496e5e2c6994795dd5c40d3388238
2021-04-28 12:26:08 -07:00
Jun Wu
3283fe0c4a pyeagerepo: bindings for eagerepo
Summary:
Add a way to construct the EagerRepo from Python, and use it to serve EdenApi.

Example in `hg dbsh`:

Prepare EagerRepo:

  In [2]: r=b.eagerepo.EagerRepo.open('/tmp/r1')

  In [3]: r.addsha1blob(b'1')
  Out[3]: '5j\x19+y\x13\xb0LTWM\x18\xc2\x8dF\xe69T(\xab'

  In [4]: r.getsha1blob(Out[3])
  Out[4]: '1'

  In [5]: r.addcommit?
  Docstring:
  Insert a commit. Return the commit hash.
  (parents: [node], rawtext: bytes) -> node
  Type:      builtin_function_or_method

  In [6]: c=r.addcommit([], 'commit 1')

  In [7]: c
  Out[7]: '\x8a\x8a\x0bq\x1e\xa4\x08\xd4\xa5\x14a\xc8\x95Y\xed\x8d$\xba1\x9a'

  In [8]: r.flush()

Use it to serve EdenApi:

  In [9]: e=r.edenapiclient()

  In [10]: e.commitdata?
  Docstring:
  commitdata(repo: str, nodes: [bytes], progress=None) -> [(node: bytes, data: bytes)], stats

  Fetch commit data in raw HG format (sorted([p1, p2]) + text).
  Type:      builtin_function_or_method

  In [11]: e.commitdata('', [c])
  Out[11]: (<stream at 0x7f96194bcc70>, <future at 0x7f96194bf810>)

  In [12]: list(e.commitdata('', [c])[0])
  Out[12]:
  [{'hgid': '\x8a\x8a\x0bq\x1e\xa4\x08\xd4\xa5\x14a\xc8\x95Y\xed\x8d$\xba1\x9a',
    'revlog_data': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00commit 1'}]

Reviewed By: andll

Differential Revision: D27951623

fbshipit-source-id: c5423d55b6359146e5a416c440d85f817e43396d
2021-04-28 12:24:27 -07:00
Jun Wu
72dba2a6fe pyedenapi: add from_edenapi
Summary:
Add a way to construct the Python EdenApi wrapper from a native Rust EdenApi instance,
bypassing the config, etc.

Reviewed By: kulshrax

Differential Revision: D27951622

fbshipit-source-id: 2e3d16a91e20c6aab6baced3dea60db9834fa103
2021-04-28 12:24:27 -07:00
Jun Wu
999a6ac749 eagerepo: implement EdenApi "bookmarks" endpoint
Summary: Implement the endpoint.

Reviewed By: andll

Differential Revision: D27951630

fbshipit-source-id: 64511ff52eb31395a4a6c4ec3a81a3eee8053431
2021-04-28 12:24:27 -07:00
Jun Wu
b2b7a58f58 eagerepo: implement EdenApi "commit_hash_to_location" endpoint
Summary: Implement the endpoint. Most of the complexity is type conversion.

Reviewed By: andll

Differential Revision: D27929203

fbshipit-source-id: ff865ae727e383cd2b465f8bcd1e29f0c9316ff6
2021-04-28 12:24:27 -07:00
Jun Wu
5920b3b927 eagerepo: implement EdenApi "commit_location_to_hash" endpoint
Summary: Implement the endpoint. Most of the complexity is type conversion.

Reviewed By: andll

Differential Revision: D27929201

fbshipit-source-id: b96f65a0173a31f716272c8e0dd47ce8a90759cd
2021-04-28 12:24:26 -07:00
Jun Wu
fc55fab9f9 eagerepo: implement EdenApi "clone_data" endpoint
Summary: Implement the endpoint.

Reviewed By: DurhamG

Differential Revision: D27929202

fbshipit-source-id: adda6a76f3d990edf6defcf1fd0f298e225f6370
2021-04-28 12:24:26 -07:00
Jun Wu
769f54228f dag: remove head_id from CloneData
Summary: This makes CloneData possible to represent an empty repo.

Reviewed By: sfilipco

Differential Revision: D27926246

fbshipit-source-id: 0bcead224ef5b89c66d07a34d8217edaef62177f
2021-04-28 12:24:26 -07:00
Jun Wu
ea7df1711e eagerepo: implement EdenApi "commit_revlog_data" endpoint
Summary: Implement the endpoint.

Reviewed By: kulshrax

Differential Revision: D27926248

fbshipit-source-id: dea1f69f4f53927188be503e1fdc5e1a6c4487fb
2021-04-28 12:24:26 -07:00
Jun Wu
64480ea512 eagerepo: implement EdenApi "trees" endpoint
Summary: Implement the endpoint. The child_metadata remains unsupported for now.

Reviewed By: kulshrax

Differential Revision: D27926253

fbshipit-source-id: 7d3d8be458462dc6e87080ce49754cf76b731794
2021-04-28 12:24:26 -07:00
Jun Wu
333dce9fa5 eagerepo: implement EdenApi "history" endpoint
Summary: Implement the file history API.

Reviewed By: kulshrax

Differential Revision: D27926252

fbshipit-source-id: b56406101810e29904b24591d744345924bde38c
2021-04-28 12:24:26 -07:00
Jun Wu
6cf5df2983 eagerepo: implement EdenApi "files" endpoint
Summary: Implement the files API. It's just reading content from the zstore.

Reviewed By: kulshrax

Differential Revision: D27926251

fbshipit-source-id: 54d04caa63e01b6ce5b9c785990c14043f7f22ad
2021-04-28 12:24:26 -07:00
Jun Wu
e1eb399245 eagerepo: implement EdenApi "health" endpoint
Summary: Implement the health API.

Reviewed By: kulshrax

Differential Revision: D27926249

fbshipit-source-id: 1cbaf7859132387c1260ca981164549721685b9f
2021-04-28 12:24:26 -07:00
Jun Wu
540adf776f eagerepo: prepare to implement EdenApi on EagerRepo
Summary: Add blank implementation. They will be filled later.

Reviewed By: kulshrax

Differential Revision: D27926254

fbshipit-source-id: 628961c2377893bf2c44633635d4dd3b99a41be1
2021-04-28 12:24:26 -07:00
Jun Wu
d5b2bf7750 eagerepo: add ways to read or write bookmarks
Summary: The will be useful for "push" logic.

Reviewed By: kulshrax

Differential Revision: D27951633

fbshipit-source-id: 38bbdc554f017d5776df0577b82fbb0c78d18a83
2021-04-28 12:24:25 -07:00
Jun Wu
8fd660fe13 eagerepo: add a way to add a commit to the commit graph
Summary:
This will be useful for "push" related logic.

The name "eager" is to make it explicit that the repo is not lazy.

Reviewed By: kulshrax

Differential Revision: D27951618

fbshipit-source-id: 8039059beba68d269c752bc8ed3e72bde0c55790
2021-04-28 12:24:25 -07:00
Jun Wu
bdf6f6f75f eagerepo: new crate for providing a local test repo that implements EdenApi
Summary:
Currently it's hard to test EdenApi related features in hg tests. The Mononoke
test suite can do it but it's too heavyweight. Looking at the API surface of
EdenApi it's actually quite small. So let's add a minimal Rust struct that can
serve as an EdenApi server.

This diff just adds a few minimal features. EdenApi related features and
push/pull support will be added later.

The name "eager" is to make it explicit that the repo is not lazy. I thought
about names like "testrepo" or "serverrepo", but the implementation is
somewhat "sound" to be used as a client, non-test repo. It can potentially
be used as starting point for a real "repo" in pure Rust. So I didn't choose
those names.

(I'm not entirely happy with the name but it's more like a placeholder
that makes it look different from other names for now).

Reviewed By: kulshrax

Differential Revision: D27926255

fbshipit-source-id: ad7a023de5e77605a553509de82ff13ae8112439
2021-04-28 12:24:25 -07:00
Jun Wu
f527306576 edenapi: move EdenApi trait to edenapi_trait
Summary:
This allows an external crate C that implements `EdenApi` to depend on a more
lightweight library just providing `EdenApi` without things like `hg_http`.
Then the `edenapi` crate can depend on C too.

Didn't move it to `edenapi_types` because it would add extra dependencies
(http, http_client, auth, etc.)

Reviewed By: kulshrax

Differential Revision: D28006548

fbshipit-source-id: 6e828974fd3f78fec70d4a04ae7be85abc459b36
2021-04-28 12:24:25 -07:00