Commit Graph

64060 Commits

Author SHA1 Message Date
Jun Wu
5e412629ee io: provide a way to disable progress rendering
Summary:
In some cases (ex. using an external pager). The IO states are changed outside
the IO struct's control. Ideally we should implement the external pager logic
on IO too but for now let's just add an API so the Python external pager logic
can disable progress output after starting an external pager.

Reviewed By: kulshrax

Differential Revision: D27149242

fbshipit-source-id: ff51fc153d3cc211cfa8ef697923d36f7c0f0d9b
2021-03-18 13:00:23 -07:00
Durham Goode
560bb0bfbd dynamicconfigs: fix prod check for Windows
Summary:
Detecting prod on Windows wasn't working because we used a posix path.
Let's add the Windows equivalent.

Also moves us to use the new hostcaps crate.

Reviewed By: chadaustin

Differential Revision: D27126497

fbshipit-source-id: 4035012fb7701378fb6e2e902c0efcd54ef42ea9
2021-03-18 11:26:06 -07:00
Durham Goode
b8ca876ee0 configs: add --configfile's to new .hg/hgrc during clone
Summary:
We've been seeing issues where repositories end up with incorrect
dynamic configuration since there's a window of time after they're cloned where
they don't have %include /etc/mercurial/.../repo.rc and therefore generate an
incorrect dynamicconfig which gets used for 15 minutes until we regen the
dynamicconfig.

Let's change hg clone to write the %include as part of the initial hgrc, so we
remove that window of time and the repo will always be correctly configured.

Reviewed By: quark-zju

Differential Revision: D27093772

fbshipit-source-id: a9ca0ec54e06549546d532d1c49a80d49981decf
2021-03-18 10:23:07 -07:00
Thomas Orozco
21e170f6de thrift/rust: pass service_name and fn_name to call() on clients
Summary:
I'd like to add support for event handlers in the Rust ServiceRouter client (I
need this in order to inject CATs in calls made by the SMC client). To do so, I
need to be able to instantiate a `ContextStack`, and to do so, I need a static
c-string representing the service name & function name, which is what this diff
does.

Note that we actually do the same thing for Rust servers already.

#forcetdhashing

Reviewed By: farnz

Differential Revision: D27088187

fbshipit-source-id: be2ad541d5123b31f0dab73da16b35dbfd308d6f
2021-03-18 10:19:40 -07:00
Xavier Deguillard
ec5a6ef1f0 nfs: implement the READDIR RPC
Summary:
The NFS readdir turns out to be pretty similar to the FUSE one, with a couple
of differences. For one, it only populates the directory entry name, it also
puts a limit on the total size of the serialized result, including all the
NFS/XDR overhead.

It is not specified if the . and .. entries need to be returned, but since the
NFS spec is usually pretty explicit about these and makes it clear that this is
for the most part a client burden, I didn't add these. I may have to revisit
this later when I get to manually browse a repository.

Since the READDIR RPC doesn't populate any filehandle, the client will have to
issue a LOOKUP RPC for each entries, potentially leading to some
inefficiencies. A future diff will implement the READDIRPLUS to fix these.

Reviewed By: chadaustin

Differential Revision: D26802310

fbshipit-source-id: b821b57021d0c2dca33427975b1acd665173bc5c
2021-03-18 10:08:50 -07:00
Xavier Deguillard
a7a8778dcf nfs: add a serializedSize to XdrTrait
Summary:
This simplifies a handful of tests and will make writing the READDIR RPC a bit
less magic when computing the amount of memory needed per entry.

Reviewed By: chadaustin

Differential Revision: D26802312

fbshipit-source-id: fc66cb68f721ed34c8f9879cdda2cd8db6ed8daa
2021-03-18 10:08:50 -07:00
Xavier Deguillard
35ecddf6c0 nfs: add RPC types for READDIR
Summary: This merely adds the types for the READDIR RPC.

Reviewed By: chadaustin

Differential Revision: D26802313

fbshipit-source-id: 634ff9b3f97dc4dba56d225c1fb9eae0a94c02d5
2021-03-18 10:08:50 -07:00
Xavier Deguillard
df4713369e privhelper: disable READDIRPLUS
Summary:
Looking at the spec, READDIRPLUS appears to be more complex to implement than
READDIR, for now, let's force the use of READDIR. Future changes will have to
implement READDIRPLUS as that will likely be a perf improvement.

Reviewed By: chadaustin

Differential Revision: D26802311

fbshipit-source-id: cb784d74507e6c2c2ba4dc0aebe69cfcd69db40b
2021-03-18 10:08:49 -07:00
Xavier Deguillard
ef798f8e3b fuse: rename DirList into FuseDirList
Summary:
This type is very specific to Fuse, let's make it obvious. The readdir method
has also been renamed as it is also very specific to Fuse.

Reviewed By: chadaustin

Differential Revision: D26802309

fbshipit-source-id: c2acdfd1c0006935c59b685fcda729e1bef88928
2021-03-18 10:08:49 -07:00
Stefan Filip
38a9add1da segmented_changelog: add test for update::assign_ids
Summary:
This test verifies that the issue we had previously with assign_ids does not
creep up again.

Reviewed By: quark-zju

Differential Revision: D27105741

fbshipit-source-id: 49b385b2026b599c92c406331a2299931a2eae46
2021-03-18 09:51:48 -07:00
Stefan Filip
822209122f segmented_changelog: update logging for seeder
Summary: Update the logs so that it's more clear what is going on.

Reviewed By: quark-zju

Differential Revision: D27145099

fbshipit-source-id: 11ec7b467157d07dd41893dc82f251a1c555365f
2021-03-18 09:51:48 -07:00
Stefan Filip
cd6d171167 segmented_changelog: update idmap version before writing idmap in seeder
Summary:
We are also going to make update the IdMapVersionStore before we start writing
the IdMap.  This means that if we crash while writing the IdMap, future runs
don't try to use the same IdMapVersion that we used previously.

Reviewed By: quark-zju

Differential Revision: D27145097

fbshipit-source-id: b911e2dca32d0fe8ae0aead3de75373dd2f936c4
2021-03-18 09:51:48 -07:00
Stefan Filip
11454ae053 segmented_changelog: update iddag before writing idmap in seeder
Summary:
We are going to build the iddag before starting to write the idmap.
This means if the iddag fails to build for whatever reason we would not have
written a potentially useless idmap.

Reviewed By: quark-zju

Differential Revision: D27145098

fbshipit-source-id: c9045abea2a1f5a8b96c524d546776fdc693b56a
2021-03-18 09:51:47 -07:00
Stefan Filip
d8736b7cf2 segmented_changelog: inline update::build
Summary:
`update::build` is only used by the Seeder. The steps in this function are not
isolated enough from the seeder to have a separate function. The seeder has the
role of builing it's own type of StartState. It is also the only process that
deals with the IdMapVersionStore. The seeder is particular enough that it makes
sense to inline it's build order.

Reviewed By: quark-zju

Differential Revision: D27099265

fbshipit-source-id: f86b8d7d4637a5f2582e70fc58b60c2041b93548
2021-03-18 09:51:47 -07:00
Stefan Filip
ef294cb359 segmented_changelog: check that parents are assigned smaller ids
Summary:
The most important invariant for IdDag is that parent nodes have ids that are
smaller than child nodes. We had a couple of issues that resulted in failing
this invariant so we are adding these extra checks. They will help us diagnose
issues faster and proctect protect production data against faulty updates.

Reviewed By: quark-zju

Differential Revision: D27092204

fbshipit-source-id: 1f052b290a494e267fac2f551ba51582baa67973
2021-03-18 09:51:47 -07:00
Stefan Filip
014b80dc5d segmented_changelog: minor, remove variable shadowing in update_iddag
Summary: Shadowing can end up being more confusing.

Reviewed By: quark-zju

Differential Revision: D27143481

fbshipit-source-id: 0a1913d8952fe913cc7596b9aea84df2d62cc3fe
2021-03-18 09:51:47 -07:00
Stefan Filip
834e35d278 segmented_changelog: move head not assigned error
Summary:
Check that head has a dag id assignment after finishing the process. This was
done at a later point but it is better to group it with assignment process so
that we have a clear source of the error.

Reviewed By: quark-zju

Differential Revision: D27143482

fbshipit-source-id: 2a94cee70142967b4f8d57df43dfcc339a0b4f2e
2021-03-18 09:51:47 -07:00
Egor Tkachenko
0b88d1bf67 Restructure derived_data filenodes
Summary: Move around code, similar to other data types.

Reviewed By: StanislavGlebik

Differential Revision: D27044301

fbshipit-source-id: 6c1c104533592733e95c3976717c5ac484218c6f
2021-03-18 09:24:03 -07:00
Thomas Orozco
2e64c33037 mononoke/edenapi_service: sample trivial tree requests
Summary:
Like it says in the title. We do the same thing (with the sampling rates) in
repo client.

Reviewed By: mitrandir77

Differential Revision: D27156569

fbshipit-source-id: ffaec7e27b454650263e82fd6d18f25c1bbf88eb
2021-03-18 08:14:12 -07:00
Jan Mazur
1a56da1c6f ignore BrokenPipe error when shutting down connection
Summary:
We use srselect on hg hosts to figure out which Mononoke servers hgcli can connect to.

We were getting BrokenPipe errors most likely from srselect.

`E0318 03:51:02.558708   679 [tk] eden/mononoke/server/repo_listener/src/connection_acceptor.rs:201] connection_acceptor error: Failed to handle connection to [2401:db00:12:90c3:face:0:361:0]:57594: Failed to handle_connection: Failed to handle_http: Failed to serve_connection: error shutting down connection: Broken pipe (os error 32): Broken pipe (os error 32)
`

Tbh it isn't much different than `ErrorKind::NotConnected` because we'are shutting the connection down anyway and it doesn't matter whether client hung up or is already dead.

Reviewed By: krallin

Differential Revision: D27155123

fbshipit-source-id: 96bb2b268f116a20f16605eb04c867c9ad047b1f
2021-03-18 05:54:28 -07:00
svcscm
12abe4967b Updating submodules
Summary:
GitHub commits:

8b9f152f67

Reviewed By: jurajh-fb

fbshipit-source-id: e5dd54d51aa6840ef13987aed26cbfe2a4bc09ae
2021-03-18 05:39:44 -07:00
Alex Hornby
a7d94d3c43 mononoke: read new packblob config
Summary: We have new config fields available that can specify default compression level,  let's read and use them.

Reviewed By: StanislavGlebik

Differential Revision: D27127455

fbshipit-source-id: 27935fd58da5f1150c9caf56d9601c37f2ae3581
2021-03-18 05:31:22 -07:00
svcscm
614544c4df Updating submodules
Summary:
GitHub commits:

64b3c42ba6

Reviewed By: jurajh-fb

fbshipit-source-id: d646bf41ce86db165fbdd50de6bd2e5cf93bf45e
2021-03-18 05:09:01 -07:00
Anna Kukliansky
885f172d83 dont define MIN if it is allready defined
Summary:
to overcome this error:
```
stderr: In file included from eden/scm/edenscm/mercurial/cext/osutil.c:44:
eden/scm/edenscm/mercurial/cext/util.h:39:9: error: 'MIN' macro redefined [-Werror,-Wmacro-redefined]
#define MIN(a, b) (((a) < (b)) ? (a) : (b))

buck-out/dev/cells/fbsource/gen/03598924/xplat/toolchains/minimal_xcode/MacOSX11.1.sdk__/MacOSX11.1.sdk/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/sys/param.h:215:9: note: previous definition is here
#define MIN(a, b) (((a)<(b))?(a):(b))
```

Reviewed By: andrewjcg

Differential Revision: D27137302

fbshipit-source-id: c0ecdfe41e4f2215fb6b886a350d1e4e0224abd5
2021-03-18 04:09:20 -07:00
svcscm
bdd2fa9f7e Updating submodules
Summary:
GitHub commits:

49b7cef7ac

Reviewed By: jurajh-fb

fbshipit-source-id: 44346f85bc6bc1453af486d83900d731c49f9a1d
2021-03-18 04:09:20 -07:00
Alex Hornby
12a1c4512c mononoke: sync configerator repos thrift for packblob compression options
Summary: Bring across the thrift changes so can code against them.

Reviewed By: krallin

Differential Revision: D27116899

fbshipit-source-id: 27bf6f23bebbc43d6c4d6c668ff905b72b0eb0f9
2021-03-18 03:21:40 -07:00
Anna Kukliansky
0f06f9a092 workaround const qualifier discard
Summary:
In regular xcode this was warning and being ignores. Not the working is handled as an error.
This diff is only a workaround so we wont get those errors .
```
eden/scm/edenscm/mercurial/cext/osutil.c:745:49: error: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  ret = _listdir_batch(path, pathlen, keepstat, skip, &fallback);
                                                ^~~~
eden/scm/edenscm/mercurial/cext/osutil.c:586:11: note: passing argument to parameter 'skip' here
    char* skip,
```

Reviewed By: mzlee

Differential Revision: D27136440

fbshipit-source-id: 00d61fd00e3ed8e23643ea69b5a82dbeb5e742ce
2021-03-18 02:38:56 -07:00
svcscm
ef06f85bcb Updating submodules
Summary:
GitHub commits:

07dfd18a30

Reviewed By: jurajh-fb

fbshipit-source-id: f786d74549fd79e93fcff60ee3e7592ce3de0023
2021-03-18 02:38:56 -07:00
svcscm
042bf668ff Updating submodules
Summary:
GitHub commits:

3e4244fee7
294aed36b9
410df2e7a2
08ea8bedfc
5520ee8109
7488232dc1
08ec5e7321
a87dd57321
254c470311
e75d619276
206f5e1f39
f344a4c9e0
582f9eb826
0cae1c0d96
1e73eab515
f740477355
51bc2ecc70
582a52870f

Reviewed By: jurajh-fb

fbshipit-source-id: 0cfe4e1d0f96c7ceed1adcec7967b6fd714839ec
2021-03-17 23:57:11 -07:00
Jun Wu
9d71e83f99 smartlog: show obsoleted commit stack
Summary:
With `sl -r OBSOLETED` the intention is see the obsoleted stack instead of just
a single commit. So filter the "::heads" with "- public()", not "& draft()".

The goal is to deprecate `--hidden`. See the linked post for more context.

Reviewed By: DurhamG

Differential Revision: D27093425

fbshipit-source-id: 76e9650a809c1d94da2341e2aca31d349487610d
2021-03-17 23:23:07 -07:00
Xavier Deguillard
9ad3320272 nfs: implement the SYMLINK RPC
Summary:
When creating the .hg directory, Mercurial issues a SYMLINK RPC, thus let's
support it.

Reviewed By: kmancini

Differential Revision: D26785005

fbshipit-source-id: a760d55e6117cc3725444c604e3e4036f4a317b2
2021-03-17 21:30:06 -07:00
Xavier Deguillard
ac0a4eee2e test: add clone_nfs test
Summary:
For now, this simply clone a repo with NFS, and nothing else, more of the
protocol needs implementing to support reading directories, files, etc.

Reviewed By: kmancini

Differential Revision: D26266144

fbshipit-source-id: e379e12126162f41d8d166bb53652e1e501de2e9
2021-03-17 21:30:06 -07:00
Robin Håkanson
280bd20086 Better Git<->Bonsai conflict reporting
Summary:
Better Git<->Bonsai conflict reporting.
It now prints the conflicting mapping, so one can see if there is a 2xbcs_id -> same git_sha1 or 2xgit_sha1 -> same bcs_id conflict. This is useful when trying to sort out why this issue appeared in the first place.

Reviewed By: ahornby, krallin

Differential Revision: D27058044

fbshipit-source-id: 9db7a210c1b0be3e0e90aa78b561293d6cf29c26
2021-03-17 21:23:09 -07:00
Robin Håkanson
46f754dd9f Reduce gitimport memory usage
Summary:
Allow to use a custom accumulator inside gitimport so we selectively can decide what to save.

This was triggered mainly because we run out of memory due to the large BonsaiChangesets always collected even when not needed earlier.

Reviewed By: krallin

Differential Revision: D27117686

fbshipit-source-id: 99ce33562e76470f91ff8c0c46391bd513801afa
2021-03-17 21:23:08 -07:00
Xavier Deguillard
6aa78a0e96 fs: update fuse_kernel_linux.h
Summary:
This is mostly just copying /usr/include/linux/fuse.h from my devserver and
updating some flags in FuseChannel to display the new flags.

Reviewed By: chadaustin

Differential Revision: D27144667

fbshipit-source-id: 4854c6edd4c793ca707db26fecd11e2a3e9d7b75
2021-03-17 20:55:43 -07:00
Stefan Filip
e3cd28089c segmented_changelog: ensure master group consistency in on demand update
Summary:
Segmented Changelog distinguishes commits into two groups: MASTER and
NON_MASTER.  The MASTER group is assumed to big and special attention is payed
to it. Algorithms optimize for efficiency on MASTER.

The current state for the segmented_changelog crate in Mononoke is that it does
not assign NON_MASTER commits. It doesn't need to right now. We want to
establish a baseline with the MASTER group. It was however possible for the
on demand update dag to assign commits that were no in the master group to the
master group because no explicit checks were performed. That could lead to
surprising behavior.

At a high level, the update logic that we want is: 1. assign the master
bookmark changeset to the MASTER group, 2. assign other commits that we need to
operate on to the NON_MASTER group. For now we need 1, we will implement 2
later.

Reviewed By: krallin

Differential Revision: D27070083

fbshipit-source-id: 922bcde3641ca25512000cd1a912c5b399bdff4b
2021-03-17 20:12:27 -07:00
Stefan Filip
9fdb3faff6 segmented_changelog: add builder with SegmentedChangelogConfig
Summary:
Pull in SegmentedChangelogConfig and build a SegmentedChangelog instance.
This ties the config with the object that we build on the servers.

Separating the instatiation of the sql connections from building any kind of
segmented changelog structure. The primary reason is that there may be multiple
objects that get instantiated and for that it is useful to be able to pass
this object around.

Reviewed By: krallin

Differential Revision: D26708175

fbshipit-source-id: 90bc22eb9046703556381399442117d13b832392
2021-03-17 20:12:27 -07:00
Stefan Filip
4217421d20 segmented_changelog: remove unused dependency
Summary:
This was lost somehow. I probably incorrectly resolved some conflict when
rebasing a previous change.

Reviewed By: quark-zju

Differential Revision: D27146022

fbshipit-source-id: 13bb0bb3df565689532b2ab5299cd757f278f26e
2021-03-17 19:49:58 -07:00
Arun Kulshreshtha
c51b647565 async-runtime: add spawn_blocking function
Summary: Add a simple wrapper around `tokio::runtime::Runtime:spawn_blocking`.

Reviewed By: quark-zju

Differential Revision: D27145094

fbshipit-source-id: 9575341dbfd90f169eba53f6c5ae2cc3e8b41c70
2021-03-17 19:23:00 -07:00
Katie Mancini
8decc4733f Update reclone instructions to include fbclone --reclone
Summary:
the reclone option code has landed for fbclone, so now we can direct
users there first, so they don't have to go through all these steps

(won't land until I check that this option has actually made it to production)

I also updated the wiki this points to tell users to use `eden list` to detect
EdenFs checkouts instead of looking for .eden, as these steps are also for when
an EdenFS checkout is borked and needs a reclone and `eden list` more reliably
works in this situation.

Reviewed By: StanislavGlebik

Differential Revision: D26435380

fbshipit-source-id: 9153e730e1be949d130af85d604623d2bfbd3990
2021-03-17 19:10:24 -07:00
Katie Mancini
e4f482a144 Fix environment in subprocess calls
Summary:
Some of our subprocess calls are running into dylib errors. The cause looks to
be related to our environment variables. We already have environment hygenics
for buck, so lets borrow this to use elsewhere.

This is to fix prefetch profile fetching on mac, but I ran into another error
when testing `eden du --clean`.

Reviewed By: genevievehelsel

Differential Revision: D27135268

fbshipit-source-id: 3955ddefc5e9ff60e966f63f7dc65ef737186464
2021-03-17 18:59:49 -07:00
generatedunixname89002005307016
1fbe99f5a9 Add annotations to eden/fs/py/test/dirstate_test.py
Reviewed By: xavierd

Differential Revision: D27119152

fbshipit-source-id: 42463371705f4df02445ab4c47fa3b4418c910f0
2021-03-17 14:15:25 -07:00
Durham Goode
4275cb5488 configs: stop creating .hg directories
Summary:
This creates .hg directories when there is no repository at all, which
breaks jf submit in git repos. D26801059 is the real fix, but it has some other
complications. Let's drop the creation here, since it really isn't necessary.

Reviewed By: quark-zju

Differential Revision: D27134087

fbshipit-source-id: d15048b2d1022d38393b62cc02ebf022e617ed4f
2021-03-17 13:14:32 -07:00
Stanislau Hlebik
ac6c609e01 mononoke: do not change repo_id when logging noop hg sync job iteration
Summary:
In D26945466 (7a3539b9c6) I started to use correct repo name for backup repos whenever we
sync an entry. However most of the time sync job is idle, and while doing so it
also logs a heartbeat to scuba table. But it was using wrong repo_id for that
(i.e. for instagram-server_backup it was using instagram-server repo_id). This
diff fixes that.

Reviewed By: krallin

Differential Revision: D27123193

fbshipit-source-id: 80425a56ad0a432180f420f5c7957105407e0fc9
2021-03-17 11:13:03 -07:00
Zeyi (Rice) Fan
f3f3fc546f integration: improve error reporting
Summary:
Previously the code would result an exception raised while handling another
exception which is a little confusing. This diff fixes that.

Reviewed By: chadaustin

Differential Revision: D27100659

fbshipit-source-id: 8c6be4df62214c8e8d778478de66f271f7b84d3c
2021-03-17 11:06:21 -07:00
Jun Wu
17e9512f94 log: preserve prefetch information for log -r
Summary:
When using `log -r REVS` with filtering flags like `-u`, `-d`, preserve the
prefetch information by using the `revs(subset=subset)` API.

Reviewed By: sfilipco

Differential Revision: D27119174

fbshipit-source-id: 8483d7113cfc819c6053d1429221588c3a917c12
2021-03-17 11:02:16 -07:00
Jun Wu
b98bf3873f localrepo: add subset arguments to revs
Summary:
This allows specifying subsets. So we can rewrite:

  revs & repo.revs(expr)

to:

  repo.revs(expr, subset=revs)

The latter will apply prefetch tweaks on subset when evaluating the revset
expr, while the former will lose prefetch information.

There might be a way to make `revs & repo.revs(expr)` do the right thing
for pre-fetching, too. But that could be more complicated w.r.t `&` fast
paths, over fetching (?), etc. For now I just took the fix that looks more
obvious to me.

Reviewed By: sfilipco

Differential Revision: D27119175

fbshipit-source-id: 2629d21594cf97d7c0f63cf085a2c427d8782e58
2021-03-17 11:02:16 -07:00
Jun Wu
216363e15e smartset: show progress filtering commits
Summary:
The filteredset can often be expensive filtering commits like `hg log -u foo`,
`hg log -d '2010-1-1'`. Add a progress bar to show what's going on.

Reviewed By: sfilipco

Differential Revision: D27119176

fbshipit-source-id: 458fbf331978b26e78e6a85fb194ae8b12b949d6
2021-03-17 11:02:16 -07:00
Arun Kulshreshtha
4ced7f2e6d edenapi_types: implement ToJson for various commit requests
Summary:
`CommitHashToLocationRequestBatch` and `CommitRevlogDataRequest` implemented `FromJson` but not `ToJson`. The latter is required so that the EdenAPI client can log JSON representations of all request types.

In the process of adding tests for those two types, I discovered a bug in `CommitLocationToHashRequestBatch`'s `ToJson` implementation which prevented it from passing JSON roundtrip tests (which I added because this type didn't have test coverage here). The bug is now fixed and the roundtrip test passes.

Reviewed By: krallin

Differential Revision: D27105414

fbshipit-source-id: d2e23e21f996ac8062bca948ed9abe3779e4669d
2021-03-17 10:57:48 -07:00
Arun Kulshreshtha
8686c15a53 edenapi_types: implement quickcheck::Arbitrary for CommitRevlogDataRequest
Summary: Used in next diff.

Reviewed By: krallin

Differential Revision: D27105415

fbshipit-source-id: f93990bff2c8a8bcc1293ec7db4c87f34e3b8d2e
2021-03-17 10:57:48 -07:00