Commit Graph

66119 Commits

Author SHA1 Message Date
Jun Wu
ed7c8931fa dag: make parents_and_head include roots
Summary:
An alternative to D29363808 (e396cab669). The benefit is that parents_and_head is used by
both the client and the server. So we don't need to duplicate D29363808 (e396cab669) in
Mononoke code.

Reviewed By: andll

Differential Revision: D29365079

fbshipit-source-id: bca60ba2b3df477929d8e72b2363e5a0f744b35d
2021-06-24 17:54:46 -07:00
Jun Wu
ac63c8df22 dag: forbid pull fast path with pending changes
Summary:
Pull fast path uses `reload` which drops pending changes.
To avoid misuse, raise an error if pending changes are present.

Reviewed By: andll

Differential Revision: D29363799

fbshipit-source-id: 8f520d2c5553432abc452bc7b2b59d7af80e0a99
2021-06-24 17:54:46 -07:00
Jun Wu
29d07f8f73 dag: reduce round-trip looking up remotely in pull
Summary: Reduce network round-trip by prefetching missing parents and roots.

Reviewed By: andll

Differential Revision: D29363797

fbshipit-source-id: ba9201ba4a22e08effaa82026398e16f69b7c0c6
2021-06-24 17:54:46 -07:00
Jun Wu
d4e08f7345 dag: check overlapped vertexes during pull
Summary: Resolve an issue demonstrated by test_pull_overlap.

Reviewed By: andll

Differential Revision: D29363800

fbshipit-source-id: 4ba2490e9c9f0d659974177bac19480c8aeef62b
2021-06-24 17:54:45 -07:00
Jun Wu
4ee4d0be21 dag: store resolved parents in pull fast path
Summary:
The import pull data logic used low-level locking, persisting APIs, it does not
write cached idmap to disk. So we need to manually insert the idmap remote
lookup result to the actual local idmap explicitly.

This addressed an issue that verify_missing fails in the pull fast path.

Reviewed By: andll

Differential Revision: D29363813

fbshipit-source-id: 2749855a6c8c924bd1b772173de066d400f73764
2021-06-24 16:20:14 -07:00
Jun Wu
10d6c23b83 dag: resolve names remotely in pull fast path
Summary:
For a NameDag, `IdConvert` on `self.map` cannot resolve names remotely, but
`IdConvert` on `self` can. Use the latter. This is similar to D27547584 (af3c3b3fd0) where
some `self.map` are updated to `self`.

This addressed an issue found in the pull fast path test. Note there is another
issues to solve.

Reviewed By: andll

Differential Revision: D29363810

fbshipit-source-id: 28ba583ed14bbc5d52af81d4128d965f24eef011
2021-06-24 16:20:14 -07:00
Jun Wu
677097aca1 dag: add a more complex test about pull fast path
Summary: The test pulls when the client has a lazy graph, and the server has a few merges.

Reviewed By: andll

Differential Revision: D29363806

fbshipit-source-id: 09bc3c4c3d21924f500ca86e8d86f58a15159169
2021-06-24 16:20:14 -07:00
Jun Wu
16796c9fb5 dag: add TestDag::debug_segments
Summary:
`fmt::Debug` for a NameDag is too verbose. Separate part of it so we can debug
print segments for a given (group, level).  This will be used by upcoming
changes.

Reviewed By: andll

Differential Revision: D29363805

fbshipit-source-id: e1c6713be10b8b64fc7a42178117e724e0d691d0
2021-06-24 16:20:14 -07:00
Victoria Tsai
ad9e1b0d4b Fix rust lint errors
Summary: unused import and unused variable

Differential Revision: D29365367

fbshipit-source-id: 39d625eba232deeb8e70e8ba11c6043b4ea60122
2021-06-24 15:54:45 -07:00
Jun Wu
b5b41b733c test-fb-hgext-treemanifest-peertopeer: fix test on macOS
Summary: macOS's `wc -l` prints extra spaces. Remove them.

Differential Revision: D29367789

fbshipit-source-id: 23ccacd015a1c5cdc186fcb0c282dd63f4171021
2021-06-24 15:17:06 -07:00
Jun Wu
73ab6e9e6f dag: ensure TestDag::pull updates client's remote
Summary:
The client TestDag might have outdated server Dag as the remote protocol,
because it is a static "snapshot". Ensure the remote Dag is updated when
using the pull API.

This is an issue solved by tracking down issues in tests added in upcoming
diffs.

Reviewed By: andll

Differential Revision: D29363807

fbshipit-source-id: a560b2e91999873338604907a6d83cc7d2ff5c58
2021-06-24 15:12:58 -07:00
Jun Wu
27f864cc5b dag: extract TestDag::set_remote from client
Summary: It will be used by the next change.

Reviewed By: andll

Differential Revision: D29363802

fbshipit-source-id: 842735ac05ea5fea4ea0c3625a68d06d27bc37d5
2021-06-24 15:12:58 -07:00
Jun Wu
c908ead7fa dag: add TestDag::drawdag_async
Summary:
It is useful when drawdag itself triggers remote fetches.

This was used but is not used after some refactoring. I think it might be useful
in the future so kept it.

Reviewed By: andll

Differential Revision: D29363803

fbshipit-source-id: fa178ac9783d1dc1b73525eeb8cd3d766cf46a0f
2021-06-24 15:12:58 -07:00
Jun Wu
63619fd27b dag: add test about pull checking overlapped vertexes
Summary: The test will be used to verify upcoming changes.

Reviewed By: andll

Differential Revision: D29363809

fbshipit-source-id: d34d13123914cfabb5c82dee3873b6e0c4979ee2
2021-06-24 15:12:58 -07:00
Jun Wu
367ce3dbc3 dag: add TestDag::pull_ff_master
Summary: Make it easier to write more tests around pull.

Reviewed By: andll

Differential Revision: D29363804

fbshipit-source-id: 5b2cf8675343898fabc1d8845228e240e463edf8
2021-06-24 15:12:58 -07:00
Jun Wu
d3b87c6861 indexedlog: resolve a warning
Summary: Follow up of D29035913 (63884d65c1).

Reviewed By: singhsrb

Differential Revision: D29363811

fbshipit-source-id: 1147b5e28f73bf893c30f3bea5a617fc116885bf
2021-06-24 15:12:58 -07:00
Jun Wu
e396cab669 dag: include roots in pull data
Summary:
The roots data will be useful for the client to check if the pulled commits are
going to overlap with its existed DAG.

Reviewed By: andll

Differential Revision: D29363808

fbshipit-source-id: e09d924d65537f59fd4ea209b568265d07a80e46
2021-06-24 15:12:58 -07:00
Jun Wu
21e2bdd709 dag: sever => server
Summary: Minor spelling fix.

Reviewed By: andll

Differential Revision: D29363812

fbshipit-source-id: 58393ddac058e1e63182aa5bc4a85e5dcf04c599
2021-06-24 15:00:35 -07:00
Jun Wu
f8af66d7d2 dag: x..y+1 => x..=y
Summary: Minor change to make the code a little bit more straightforward.

Reviewed By: andll

Differential Revision: D29363801

fbshipit-source-id: 2c4bd6ece07282f044622227a3c077cb31db6d17
2021-06-24 15:00:35 -07:00
Jun Wu
77e8dcc21d dag: minor updates on iddag docstring
Summary: Make the docstring a bit more consistent.

Reviewed By: andll

Differential Revision: D29363798

fbshipit-source-id: 1b4e2a7a1af4c4cffe3693e437a831bab1b43fd7
2021-06-24 15:00:35 -07:00
Andrey Chursin
7ed94dde6a OnDemandUpdateSegmentedChangelog: build up master before generating pull data
Summary: This is required to make sure segmented changelog has all the data needed

Reviewed By: quark-zju

Differential Revision: D29347285

fbshipit-source-id: 82ee1ffca178492b7ad363c53cee7ec57058733f
2021-06-24 13:58:02 -07:00
Andrey Chursin
568237d11c eden_api: implementation for pull_fast_forward_master client request
Reviewed By: quark-zju

Differential Revision: D29342432

fbshipit-source-id: 1a371e707b2e75b155f5abdc343bfb42ba53df5a
2021-06-24 13:58:02 -07:00
Andrey Chursin
dc97c2544a edenapi_service: add fast forward pull handler
Reviewed By: quark-zju

Differential Revision: D29342138

fbshipit-source-id: 056dad3bb7c207b1f0e9d0ee50a95e96ad690254
2021-06-24 13:58:02 -07:00
Andrey Chursin
49bd00fe2c types: introduce fast forward pull wire types
Reviewed By: quark-zju

Differential Revision: D29342139

fbshipit-source-id: 848eceaf5d4a7e88e9830155c0763321ea275c82
2021-06-24 13:58:02 -07:00
Robin Håkanson
4056944213 Add git LFS support to gitimport and grepo branch_forest.
Summary:
Add git LFS support to gitimport and grepo branch_forest.

I did not want to add the parsing of .gitattributes and .lfsconfig to the gitimport library. This needs to be done by the users of gitimport before the import is started, And the GitImportLfs object needs to be configured accordingly. Currently we are extrating this data from the manifest files for the "g"repo imports.

I am not sure the simple git-lfs download client works with other git-lfs server back ends then Dewey. But it is a fairly simple implementation and it should be easy to extend to be more generic.

Reviewed By: farnz

Differential Revision: D29082867

fbshipit-source-id: a7b0272147b3d44a0b6b9782d2a1b8ec94653b8f
2021-06-24 13:49:20 -07:00
Jun Wu
03003242b0 debuginternals: new command to list or export internal states
Summary:
Sometimes we need repo internal states for deeper investigation. Right now
the process is quite adhoc - telling people to figure out where the "backing"
repo is, excluding unwanted files like 00changelog.d, etc. Let's just make
it easier so we have a dedicated command to tar up selected internal states.

Reviewed By: andll

Differential Revision: D29242716

fbshipit-source-id: 85604d0df5b3a12f1aed29e4f31fcd5c166f9066
2021-06-24 12:31:47 -07:00
Stanislau Hlebik
129d4fa88f mononoke: support multiple directories in mononoke_admin rsync
Summary: It's useful to be able to copy multiple dirs at once

Reviewed By: markbt

Differential Revision: D29358375

fbshipit-source-id: f1cc351195cc2c19de36a1b6936b598e314848c3
2021-06-24 11:44:34 -07:00
Stanislau Hlebik
1044dd545d mononoke: support mononoke admin convert for git
Summary:
Previously only conversion between bonsai and hg was supported. Let's add git
as well.

Obviously you can use `scsc lookup`, but mononoke_admin can be useful for repos
that are not on scs yet.

Reviewed By: farnz

Differential Revision: D29360793

fbshipit-source-id: eb2b71eab192b3456ba3d580f7eb8c4a85b2fd1d
2021-06-24 07:32:51 -07:00
Yan Soares Couto
a3e0290fe1 Move CoreContext creation in repo_factory to a new function
Summary: Very simple refactor. This logic was already used twice and I will use it another time in following diffs.

Reviewed By: markbt

Differential Revision: D29033594

fbshipit-source-id: 96040a2eee2b58f6851646e51b67c46c6bf334fe
2021-06-24 06:33:04 -07:00
Mark Juggurnauth-Thomas
728f145e78 ephemeral_blobstore: add ephemeral blobstore
Summary:
Implement get and put for the ephemeral blobstore.  This allows blobs to
be stored and retrieved in bubbles.

Ephemeral bubbles always have a repo associated with them when they are opened,
to simplify blob prefixing.  It is valid for a bubble id to have multiple repos
associated with it, but they must be accessed separately, and in practice this
won't be used.

Reviewed By: StanislavGlebik

Differential Revision: D29067722

fbshipit-source-id: d870f695fc1d0c825fdaec9337c82a13209165ce
2021-06-24 04:13:58 -07:00
Mark Juggurnauth-Thomas
3c9bf458be metaconfig: add ephemeral blobstore config
Summary:
Extend metaconfig to include configuration for the ephemeral blobstore.

An ephemeral blobstore is optional: repos without an ephemeral blobstore cannot
store ephemeral commits or snapshots.

Reviewed By: StanislavGlebik

Differential Revision: D29067719

fbshipit-source-id: fe7d42173d5c34a937c99c72f4b2bd08af503889
2021-06-24 04:13:58 -07:00
Mark Juggurnauth-Thomas
b001dd9ea1 sync repos.thrift from configerator
Reviewed By: StanislavGlebik

Differential Revision: D29067721

fbshipit-source-id: f7d792205d0dfa9ad6b2b1ce0845f978f5f3f008
2021-06-24 04:13:58 -07:00
Mark Juggurnauth-Thomas
5716174f8f packblob: generalise key prefixes
Summary:
Packblob currently expects key prefixes of the form `repoNNNN.` to be stripped , but also allows keys without this prefix. For the ephemeral blobstore we want to allow prefixes of the form `ephXXX.repoNNNN.` as well.

Generalise packblob so that we can have multiple key prefixes.

Packblob will enforce that none of the blobs in the packblob have a prefix that matches any of the patterns - this will prevent us from accidentally storing `repoNNNN.`-prefixed blobs in an ephemeral blobstore that requires `ephXXX.repoNNNN.` prefixes, for example.

Reviewed By: liubov-dmitrieva

Differential Revision: D29067720

fbshipit-source-id: 953909d47c9c4af91b529bcc684340d26411463d
2021-06-24 04:13:58 -07:00
Alex Hornby
196ade1c06 mononoke: extract chunking params in walker
Summary: Make it clearer which of the TailParams are only required when chunking, removing parallel Option<> so that all items that should be set together are inside one optional item.

Reviewed By: farnz

Differential Revision: D29264647

fbshipit-source-id: d64cddf94b35e62d6e50cd8afe906eef2444c730
2021-06-24 01:49:39 -07:00
Alex Hornby
3d59baacd5 mononoke: check if chunking in walker defer_visit()
Summary: Makes defer_visit return result, so we can detect if it is called when not chunking.

Reviewed By: farnz

Differential Revision: D29268346

fbshipit-source-id: b8ea503c2848adb5d7ca3fb0e61399be2930c3de
2021-06-24 01:49:39 -07:00
Xavier Deguillard
b73322e5ea service: increase timeout for DaemonStartupLoggerTest.daemonClosesStandardFileDescriptors
Summary:
It looks like 20s might not be sufficient anymore as the test is failing too
frequently with `wait` completing without the process having completed:

```
eden/fs/service/test/StartupLoggerTest.cpp:352: Failure
Expected equality of these values:
  "exited with status 0"
  returnCode.str()
    Which is: "running"
eden/fs/service/test/StartupLoggerTest.cpp:363: Failure
Value of: isWritablePipeBroken(fd)
  Actual: false
Expected: true
```

Reviewed By: kmancini

Differential Revision: D29342002

fbshipit-source-id: d457b632a2666356e9053d2da66a3227e6524b68
2021-06-23 22:04:52 -07:00
Meyer Jacobs
bbe46dcf06 scmstore: avoid empty remote requests in TreeStore
Summary: Verify we actually have pending keys to fetch before attempting a remote request in scmstore TreeStore.

Reviewed By: kulshrax

Differential Revision: D29345214

fbshipit-source-id: 328bdcbc41429e59de6ceb488533bafa97518fcc
2021-06-23 19:27:26 -07:00
Arun Kulshreshtha
7ffa37c5e9 pyedenapi: use block_unless_interrupted instead of block_on_future
Summary: Previously, it was not possible to interrupt `hg` during EdenAPI fetch operations. This made it impossible to interrupt long-running fetches, which is very frustating to users. This can be simply fixed by using `block_unless_interrupted` in place of `block_on`.

Reviewed By: quark-zju

Differential Revision: D29344670

fbshipit-source-id: 3b0d36dda28f5f7cc812a07981f295f8d0fbdd8a
2021-06-23 19:01:22 -07:00
Andrey Chursin
fc47068389 debugsementpull: introduce debug command to pull using segmented chanelog
Summary:
This is simple command mostly to be used by testing before we fully integrate with hg pull

This command does not perform discovery and requires from/to revision to be passed in cmd line

Reviewed By: quark-zju

Differential Revision: D29315647

fbshipit-source-id: 26d67031e566b7c99af1e2a5ab287f02b52f7db0
2021-06-23 17:58:26 -07:00
Xavier Deguillard
27b55303ee Back out "Enable fb dynamicconfig loading inside eden backingstore"
Summary: This is breaking the Windows release, reverting.

Reviewed By: fanzeyi

Differential Revision: D29339787

fbshipit-source-id: 22d8ff5db5619194e4597754dc37343cf0bc3286
2021-06-23 16:45:43 -07:00
Meyer Jacobs
5e9a33e11e tests: fix test-fb-hgext-treemanifest-peertopeer.t on mactest
Summary: `|&` apparently fails on mactest, so I've replaced it with `2>/dev/stdout | ` which works on my devserver and macbook.

Reviewed By: andll

Differential Revision: D29337621

fbshipit-source-id: eaac2592f4c7bfda6696c2500f3b08441b596c39
2021-06-23 16:11:41 -07:00
Meyer Jacobs
640767d414 scmstore: track contentstore fallbacks
Summary:
Introduce basic contentstore fallback tracking to help monitor the scmstore shim rollout.

This will be expanded to a general fetch metrics system for scmstore in a future change.

Reviewed By: kulshrax

Differential Revision: D29305839

fbshipit-source-id: c6cc3ea15a3bb7b90f4ec298febc911ec4e2af91
2021-06-23 15:26:26 -07:00
Andrey Chursin
ea95fbdee8 api: introduce segmented_changelog_pull_fast_forward_master
Reviewed By: quark-zju

Differential Revision: D29319057

fbshipit-source-id: 88ff9e1f4acc0109c8a1e4978914f84832ebeb36
2021-06-23 14:51:39 -07:00
Andrey Chursin
f9b85a5a93 segmented_changelog: impl for ReadOnlySegmentedChangelog::pull_fast_forward_master
Summary: This is rougly similar to algorithm in NameDag

Reviewed By: quark-zju

Differential Revision: D29318721

fbshipit-source-id: 51a9123daa2b4cf0fbe2346a8a0c7e75172d9afb
2021-06-23 14:51:39 -07:00
Andrey Chursin
b13454d54b segmented_changelog: introduce SegmentedChangelog::pull_fast_forward_master
Summary: The naming is used in other parts of dag crate - this introduce mononoke side binding for corresponding functions on dag side

Reviewed By: quark-zju

Differential Revision: D29318722

fbshipit-source-id: e9eea5536b041b6ab2ce578914817bca43a10d48
2021-06-23 14:51:39 -07:00
Andrey Chursin
c37c61cc0d pydag: add importpulldata binding
Reviewed By: quark-zju

Differential Revision: D29317065

fbshipit-source-id: 19597b72cd3c210f43425df30fbe7e2312e33370
2021-06-23 14:51:39 -07:00
Zhengchao Liu
1f9541251f utils: add ImmediateFuture::ensure
Summary:
We are adding tracing to nfs. To record the elapsed time of a call, we need to invoke a callback when future is ready (has value or exception). For fuse, this is done with `Future::ensure`. Nfs is using `ImmediateFuture`, so I am adding `ImmediateFuture::ensure` accordingly.

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/fbcode/eden/fs/fuse/FuseChannel.cpp?commit=64091acc4e2905bfb58b4795e705fa6b554c487c&lines=1733-1735

Reviewed By: chadaustin

Differential Revision: D29278838

fbshipit-source-id: 176d6361a0ef1dd4a89db470acbb36b4868e04ef
2021-06-23 14:23:40 -07:00
Xavier Deguillard
864ead9e24 glob: fix ** glob take 2
Summary:
In D29079762 (ea2e2f8bbd), globbing was fixed to not match the recursive glob (**) against
the entire path, as this would lead some paths to be matched while they
shouldn't. It however introduced another bug: in some cases, recursive globs
would no longer match paths that should be matched.

To fix both, a partial revert of the original diff is done with a small tweak:
the path that is matched against no longer starts at the root of the
repository. This will prevent `a/b/**/b/c.txt` to match `a/b/c.txt` as
`**/b/c.txt` would only be matched against `c.txt`, and not `a/b/c.txt` like it
was previously.

Reviewed By: fanzeyi

Differential Revision: D29175333

fbshipit-source-id: 1a4137d6f64f6cb77c4be09bd143f72630aa58d5
2021-06-23 14:11:32 -07:00
Chad Austin
2e86fbbb02 move watchman includes into their own directory
Summary:
Bring Watchman closer to the EdenFS file name convention by moving
source files and includes into watchman/.

Reviewed By: fanzeyi

Differential Revision: D29242789

fbshipit-source-id: 6e29a4a50e7202dbf6b603ccc7e4c8184afeb115
2021-06-23 12:14:35 -07:00
Katie Mancini
6147429197 cli: do not block eden rm on aux process
Summary:
When buck kill fails, eden rm will also fail. This has caused some checkouts
to not be removed when they could be. Stopping aux processes is a nice thing
to do before we unmount. It ensures these processes close file handles in the
mount, but we force unmount anyways so open file handles should not be able to
block the umount call.

Reviewed By: xavierd

Differential Revision: D29205962

fbshipit-source-id: a899940efa5cc1d960cd14a775b7053c34f5d6f2
2021-06-23 10:50:50 -07:00