Commit Graph

8071 Commits

Author SHA1 Message Date
Mark Juggurnauth-Thomas
1e288e8ea4 fsnodes: clean-up new async code
Summary:
Now that fsnodes is async, convert more functions to use references, and tidy
up imports and type names.

Reviewed By: krallin

Differential Revision: D24726145

fbshipit-source-id: 75a619777f19754daf494a3743d26fa2e77aef54
2020-11-04 08:39:57 -08:00
Mark Juggurnauth-Thomas
d5b88409a4 fsnodes: convert fsnodes::mapping to new futures
Summary: This completely removes `futures-old` from `fsnodes`.

Reviewed By: krallin

Differential Revision: D24726147

fbshipit-source-id: f9d5d36664deb808185a6cb2f4b382ee762d0e25
2020-11-04 08:39:57 -08:00
Mark Juggurnauth-Thomas
866275e626 fsnodes: convert fsnodes::collect_fsnode_subentries to new futures
Reviewed By: krallin

Differential Revision: D24726148

fbshipit-source-id: 7e37156b73aaea22280b6e3322520c5eab9e71fe
2020-11-04 08:39:57 -08:00
Mark Juggurnauth-Thomas
320f0edfe5 fsnodes: change fsnodes::derive_fsnode to use new futures
Summary:
Update `fsnodes::derive_fsnode` and its immediate utility functions to use new style
futures and `async`/`.await` syntax.

Reviewed By: krallin

Differential Revision: D24726146

fbshipit-source-id: 0b0d5b1162a73568ef5c47db6e8252267e760e7f
2020-11-04 08:39:57 -08:00
Lukas Piatkowski
948f671e6b mononoke/unbundle changegroup module: use quickcheck_async for testing async code
Reviewed By: farnz

Differential Revision: D24724933

fbshipit-source-id: 82c8ae73fdf59dcab9e86a9360bc809c71fb4c91
2020-11-04 05:29:08 -08:00
Egor Tkachenko
a4d5c2c172 Remove old future from bonsai_generation
Summary: Into the bright new future

Reviewed By: farnz

Differential Revision: D24715795

fbshipit-source-id: 8e0b9df136373c99de77809db31f3e6847507704
2020-11-04 05:20:38 -08:00
Simon Farnsworth
1daa1d80cf Switch tests_utils to only use new futures
Summary: We're retiring the old ones, forever!

Reviewed By: ahornby

Differential Revision: D24706191

fbshipit-source-id: 96e4aff5461d9aab8f7e68d46aff23331c09442e
2020-11-04 03:11:59 -08:00
Kostia Balytskyi
ab76c9d22a infinitepush: add more measurements to infinitepush bundles
Summary:
The goal of this diff is to provide more visibility into how long the client
takes to create/upload an infinitepush bundle. This is done in two ways:
- by adding more `perftrace` calls (useful when invistigating individual slow
  pushes)
- by adding `ui.timesection` scopes (useful for aggregation purposes)

Two main things that are measured:
- creation of the bundle purely on the client
- sending of the bundle over the wire

In addition, in the perftrace recording, this measures how long it takes to
process the reply handlers, how much bytes are sent over the wire, what are the
part names and sizes (when available). These changes mostly do not distinguish
whether the code is infinitepush push or not, but they are always related to
some sort of a wireproto scenario, which means that the performance impact is
negligible (writing things to thread-local storage is *much* cheaper than
sending them over the network).

Reviewed By: DurhamG

Differential Revision: D24683484

fbshipit-source-id: 53fdfb63dcdfcf38924237c59a1e8f5e24ff96c0
2020-11-04 02:12:00 -08:00
Simon Farnsworth
93c92dae38 Remove old futures from test fixtures
Summary: We're getting rid of old futures - remove them as a dep here

Reviewed By: StanislavGlebik

Differential Revision: D24705787

fbshipit-source-id: 83ae938be0c9f7f485c74d3e26d041e844e94a43
2020-11-04 02:05:52 -08:00
Egor Tkachenko
f44014de6f Add new command create bonsai
Summary:
We can have different bonsai changesets hash for the same hg changeset. Consider situation - we have hg repo:
```
  o  B (Add file "b")
  │
  o  A (Add file "a")
```
The correct bonsai changeset for B will have only entry `(<Path_to_b>,Some(<hash_b>))` in `file_changes`. But we can also have bonsai changeset for B with 2 entries `(<Path_to_b>,Some(<hash_b>)), (<Path_to_a>,Some(<hash_a>))`. This diff provides the functionality to manually create such situation. And later it will be used for verification blobimport backups

Reviewed By: StanislavGlebik

Differential Revision: D24589387

fbshipit-source-id: 89c56fca935dffe3cbfb282995efb287726a3ca9
2020-11-04 01:29:42 -08:00
Lukas Piatkowski
e8a550cabf mononoke/unbundle changegroup module: replace 0.1 future_ext::BoxStream usage with 0.3
Reviewed By: farnz

Differential Revision: D24706575

fbshipit-source-id: ea2b7eb28b1dbf8f79f2a25de9a130c044dcd6bc
2020-11-04 01:16:30 -08:00
Durham Goode
5cec109afd pullcreatemarkers: don't mark reverts as landed
Summary: We were incorrectly marking reverts as landed during pullcreatemarkers.

Reviewed By: quark-zju

Differential Revision: D24608217

fbshipit-source-id: f919f49469d6933c17894b3b0926ba2430a5947a
2020-11-03 20:03:26 -08:00
Durham Goode
d2e3736f67 procinfo: fix buck build on OSX
Summary:
As part of getting buck build to work on OSX, we need procinfo to
include it's OSX specific library.

Reviewed By: sfilipco

Differential Revision: D24513234

fbshipit-source-id: 69d8dd546e28b4403718351ff7984ee6b2ed3d1d
2020-11-03 17:40:19 -08:00
Lukas Piatkowski
e0c7333e94 mononoke/unbundle resolver module: replace 0.1 future_ext::BoxStream usage with 0.3
Reviewed By: farnz

Differential Revision: D24706576

fbshipit-source-id: 3f6438961f52810b4ef59aba3c4dabb753ffb50b
2020-11-03 13:38:09 -08:00
Liubov Dmitrieva
719b637925 improve ux for setting a token
Summary:
Improve ux for setting the token.

This extra bits would help to figure out prompt issues on Windows

Reviewed By: markbt

Differential Revision: D24706085

fbshipit-source-id: 6101b8d7b90aad2d687465a09cc69670ca4a46f6
2020-11-03 12:31:51 -08:00
Katie Mancini
de729d337c Avoid overfetching in checkout
Summary:
Eden can often overfetch files during checkout. There may be multiple things
going on here, but at least one of them is tied to aux data prefetching.

Responding to a FUSE request for aux data will result in the inode for that
file being loaded. During checkout if we don't short circuit the checkout
then we will create a CheckoutAction for each loaded inode. And previously
CheckoutActions will always load their inodes contents.

To fix this we have two options
1. avoid creating the CheckoutAction in the first place.
2. Avoid downloading in CheckoutAction.

1 Turns out to be more difficult. I did some thinking through this here if
you want to see: https://fb.quip.com/LeqSAb3OlpWb

2 We don't actually need to be downloading blob data here, we only really
need the eden hash and content sha1 of the blob in this code path (this is
all that is used to compare the old and new file). So we should really only
be fetching the metadata (which should be avaiable locally since the inode
was loaded unless the caches have been cleared).

This implements fix 2.

I think there is likely still over fetching having to do with trees in checkout.
And potentially we can avoid looking at metadata at all in some cases.
I will look at this next.

Reviewed By: chadaustin

Differential Revision: D23432810

fbshipit-source-id: 17c0503bf95eb360de902a370948338bf04c1887
2020-11-03 10:58:22 -08:00
Mark Juggurnauth-Thomas
6b8a832433 derived_data: change BonsaiDerivedMapping to use new futures
Summary:
This changes the methods from ones that return old `BoxFuture`s to an async method
using `async_trait`.

Reviewed By: krallin

Differential Revision: D24689506

fbshipit-source-id: 7b13010924369f81681e6590898af703c5423385
2020-11-03 09:15:18 -08:00
Mark Juggurnauth-Thomas
6a12bcc562 derived_data: change BonsaiDerived::derive_from_parents to use new futures
Summary:
This changes the trait method from one that returns an old `BoxFuture` to an async
method using `async_trait`.

Reviewed By: krallin

Differential Revision: D24686888

fbshipit-source-id: 0ac231cdbb60d256b6d5ad5aafbe8779b96905f3
2020-11-03 09:15:18 -08:00
Kostia Balytskyi
6f9d9c5c91 cross_repo_sync reporting: start passing contexts to sync fns
Summary: This is to be able to see in Scuba why a given sync function was called.

Reviewed By: StanislavGlebik

Differential Revision: D24689366

fbshipit-source-id: f868fc1b6fcbf6c692e1373cbe8da8cd4a230780
2020-11-03 05:18:38 -08:00
Lukas Piatkowski
2a779e82d8 mononoke/mercurial_bundles: use futures 0.3 in Bundle2Item
Summary: This is a step towards modernizing unbundle crate to use futures 0.3.

Reviewed By: farnz

Differential Revision: D24682963

fbshipit-source-id: 55c17fd699846a24647a23ea1c22888407643dfd
2020-11-03 00:12:21 -08:00
Xavier Deguillard
1ed7eeef95 inodes: unload inodes before checkout on Windows
Summary:
On Windows, we never unload any inodes until EdenFS is restarted, thus,
checkout times go up over time as more and more inodes are being loaded. While
on Windows we don't keep track of what is referenced by the kernel, the
checkout code will use the "precise inodes" code path when deciding what to
update. This means that every inode that is in the overlay will get updated
properly, and since the overlay is a superset of what is hydrated, we are
guaranteed to always invalidate what we need to.

Due to the above, this shouldn't result in any changes as we never gc the
overlay, but that will come later, at which point checkout times will stop
being more and more expensive as time goes.

Reviewed By: chadaustin

Differential Revision: D24634253

fbshipit-source-id: c7b838edc20589bbf92ff4e2b3abd079b9a4443d
2020-11-02 21:03:58 -08:00
Xavier Deguillard
e3c3133fd3 inodes: rename future notification should be run non-inline
Summary:
Futures are by default run inline, meaning that when the previous future is
completed, the future will run in the same context as the previous one. In the
case where the previous one is completed by another thread setting up its
promise, the future will be completed in the context of that other thread.

In most cases, this is OK, in others, this can cause a deadlock. And this is
exactly what we're seeing here. When a file is renamed concurrently to an `hg
update`, the inode the rename operates on might not be loaded, and thus both
update and the rename callback will race to load that inode. When update wins
that race, the rename callback will wait on a promise that update will then
set. When that happens, the rest of the rename callback will be run in the
update context, but that will in turn cause update to try to re-acquire the
rename lock that it already holds...

To fix this, we need to make sure that the rename callback doesn't run inline.

Reviewed By: chadaustin

Differential Revision: D24657422

fbshipit-source-id: 23b08765afae7bda4a628f0c23675bff9f486b6b
2020-11-02 21:03:58 -08:00
Xavier Deguillard
8c4429a4f5 integration: fix merge tests
Summary:
I'm not entirely sure why these started failing, but enabling ui.allowmerge
made these run again.

Reviewed By: chadaustin

Differential Revision: D24697462

fbshipit-source-id: ec5ca987e7116edb12658eb7b4d03f1cf0f876d3
2020-11-02 20:47:29 -08:00
Chad Austin
b3413ee2d3 always immediately fetch HgProxyHash in HgQueuedBackingStore
Summary:
For logging and analytics, it's convenient for the
HgQueuedBackingStore to know the manifest hash and path early in the
import process. Since every object fetch requires looking up the
HgProxyHash anyway, fetch it immediately and thread it down to the
importer.

Reviewed By: kmancini

Differential Revision: D24524319

fbshipit-source-id: 0d91d55655e5ee25a010f7664e80125b7c50cf84
2020-11-02 20:18:26 -08:00
Chad Austin
0fa8c8add3 make HgProxyHash move noexcept
Summary:
Use the empty string to indicate the moved-from state, which makes
HgProxyHash moves noexcept. I plan to look up HgProxyHash early and
move it into HgImportRequest.

Reviewed By: kmancini

Differential Revision: D24522612

fbshipit-source-id: 037b4012ad6a51ad7ebd6a96de2e391cd570771b
2020-11-02 20:18:26 -08:00
Chad Austin
77b00f1b87 HgBackingStore is not a BackingStore
Summary:
Stop pretending that HgBackingStore is a standalone backing store
implementation, and instead indicate it's an implementation class used
by HgQueuedBackingStore.

Reviewed By: kmancini

Differential Revision: D24514247

fbshipit-source-id: 90c3a442d01647fa6d1337cfd814f5bf4b480137
2020-11-02 20:18:26 -08:00
Chad Austin
a5de6e754d name some threads
Summary:
We had some unnamed threads that made profiling performance on macOS a
bit harder. Give them a semblance of a useful name, at least.

Reviewed By: kmancini

Differential Revision: D24640223

fbshipit-source-id: 7dd74b30a081753006df681bf97ac96147b1896c
2020-11-02 15:22:53 -08:00
Chad Austin
93238b82b4 skip InodeTable entries with zero InodeNumbers
Summary:
Until fanzeyi gets InodeMetadata moved over to SQLite, remove some
excessive logging when the InodeMetadataTable contains zeroes because
its buffers weren't flushed to disk.

Reviewed By: genevievehelsel

Differential Revision: D24377026

fbshipit-source-id: e6ffa54244730388aaf66dc53cd29a0069fba685
2020-11-02 14:57:13 -08:00
Chad Austin
c06d3deb23 add eden debug modified command
Summary:
Add a very simple debug command that simply prints all materialized
inodes under the given path. It is a quick way to uncover unexpected
writes (or unexpected failed dematerializations after checkou).

Reviewed By: xavierd

Differential Revision: D24378759

fbshipit-source-id: dc393d65506c74dbc0779732cdefd915cbbf9948
2020-11-02 13:52:38 -08:00
Chad Austin
87def59c62 remove dead getDebugStatus
Summary: Kill some dead code.

Reviewed By: xavierd

Differential Revision: D24300170

fbshipit-source-id: 86748dc58046f22c3116d64d8674684538c16e4a
2020-11-02 13:52:38 -08:00
Chad Austin
20c77da782 implement debugInodeStatus with traverseObservedInodes
Summary:
Replace the old implementation of debugInodeStatus with the more
general traverseObservedInodes functionality, and add the ability to
customize its results with flags.

Reviewed By: xavierd

Differential Revision: D24300122

fbshipit-source-id: 0fbd3aa02575faa515fd7852441547d7de13426d
2020-11-02 13:52:37 -08:00
Chad Austin
a6ac98a5a7 thriftfmt
Summary:
Apply automated Thrift formatter. Even if the format is a bit off in a
couple places, and the bikeshed is still being painted, this avoids
unrelated formatting changes later in the stack.

Reviewed By: xavierd

Differential Revision: D24511057

fbshipit-source-id: f1b23578733a8ecf788509e407bc419fa073428d
2020-11-02 13:52:37 -08:00
Durham Goode
0830e9a481 Add --cfg=fb_buck_build to all builds
Summary:
In Mercurial we're finding use cases for conditioning on buck vs
non-buck builds. For instance, in some cases we specify #[link] directives for
non-buck builds, but don't need to for buck builds
(https://fb.workplace.com/groups/rust.language/permalink/4568487309866515/).  In
other cases we want to depend on internal buck libraries when building with
buck, and not otherwise.

Let's add a fb_buck_build cfg so other projects may distinguish the same.

Reviewed By: jsgf

Differential Revision: D24493974

fbshipit-source-id: 1d558cbe0ae01ab4a7b4b5d6d4be75bb8ab0f41a
2020-11-02 12:51:56 -08:00
Xavier Deguillard
a16e62b234 inodes: add missing override
Summary: This method is an override of its parent class, thus the need for the override.

Reviewed By: chadaustin

Differential Revision: D24657424

fbshipit-source-id: 5ce7200eeb4ef28fb51fabbe0ebb38ded51ae34e
2020-11-02 12:26:56 -08:00
Xavier Deguillard
d42a8c971d inodes: move path into the Dispatcher callbacks
Summary:
Dealing with non-owned path in futures is mind bending and can lead to use
after free fairly easily if not careful. It turns out that this code is
actually a bit buggy and in some cases will attempt to use a path that is
already freed. Since the callsite doesn't need to hold onto the paths, let's
just move them, which resolves the issuue.

Reviewed By: chadaustin

Differential Revision: D24657423

fbshipit-source-id: 47bbaccf18cd86e53860491e3cbfeadb4363499c
2020-11-02 12:26:56 -08:00
Durham Goode
50304e4ed0 rage: hide dynamicconfigs from local config output
Summary:
The rage local config output was getting polluted by dynamic config.
Let's filter them out.

Reviewed By: farnz

Differential Revision: D24626564

fbshipit-source-id: df5ac04cd549595ecdccc0b2438d4e7c72b80e88
2020-11-02 10:24:53 -08:00
Genevieve Helsel
c999fead34 unify uptime cli command
Summary: When I added `eden uptime`, I did not see that we already had `eden debug uptime`! Instead of having two, lets just use the one and remove it from debug. There seems to be a regression of the uptime I had implemented, so thats why I opted to use the implementation of the debug version.

Reviewed By: kmancini

Differential Revision: D24566844

fbshipit-source-id: d948a5303d475a543f51abbaea59f9c481dfeca2
2020-10-30 16:40:08 -07:00
Mateusz Kwapich
1021cd1238 py3: fix hanging read of SSH subprocesses
Summary:
Previously, reading from SSH subprocesses did’t return on Python 3.  bufsize=0
is default on Python 2, but not Python 3.

This is a backport of: 0fc8020ebe

Reviewed By: krallin

Differential Revision: D24652418

fbshipit-source-id: 1140c76b6f711bfe1726108bd4fe6948e6ee41a0
2020-10-30 13:11:03 -07:00
Xavier Deguillard
1aeb62309f inodes: remove one ifdef from processCheckoutEntry
Summary:
We don't need an ifdef here as folly::kIsWindows works just as well. The astute
reader will notice that we now call isInodeRemembered while we weren't before.
On Windows, this will pretty much always return false as this can only return
true if the fuse refcount is positive. Since we don't keep track of a fuse
refcount on Windows, this is OK to do.

Reviewed By: genevievehelsel

Differential Revision: D24636432

fbshipit-source-id: c6db7c66f7eb27894cdd276a9368149ec8056cf4
2020-10-30 12:34:46 -07:00
Xavier Deguillard
09276388bf cli: start edenfs without inheriting the console
Summary:
One of the unforseen effect of D24393690 (c5d631fd09) is that EdenFS was tied to the console
that ran `edenfsctl start`. As a result, killing that console would also kill
EdenFS, which is a bit unexpected.

Console in Windows are a bit complicated, and in theory, EdenFS could simply
call `FreeConsole` once it is started, but the side effect of this is that any
process started by EdenFS (say Mercurial), would create its own console as its
parent doesn't have one, specifying CREATE_NO_WINDOW when creating these would
lead to not having any output in the edenfs logs from Mercurial (D21820195 (223846d313))...
We could solve this if we could tell Windows to allocate a hidden console
window, but that API unfortunately doesn't exist.

So, the best we can do for now is to simply start EdenFS with the
CREATE_NO_WINDOW flag, this fixes the above issue, allows for the original
console to be killed without affecting EdenFS, but it brings another issue:
`eden start` no longer shows what is going on...

For now, this is the least worst solution, so we'll go with that. In the
future, we can imagine fixing EdenFS startup code to send its output to a pipe
that edenfsctl would read and print to its standard output.

Reviewed By: chadaustin

Differential Revision: D24607540

fbshipit-source-id: c18590052a96b7dd2938b589e92e808f38b5ef59
2020-10-30 12:32:50 -07:00
Simon Farnsworth
fb9283c378 Remove old-style futures from cmdlib::args and fix up build failures
Summary: The more we remove, the easier it'll be to remove the last few problem cases.

Reviewed By: StanislavGlebik

Differential Revision: D24592052

fbshipit-source-id: de6371305991d54bf2802fd904850b49aeb11bbd
2020-10-30 11:55:15 -07:00
Stanislau Hlebik
4b734eaa1d mononoke: return an error if a parent hasn't been remapped
Summary:
This didn't matter much in practice because we've never pushrebased a rewritten
commit where one of the parents rewrites to nothing. Nevertheless I think it's
cleaner to return an error in this case

Reviewed By: ikostia

Differential Revision: D24621105

fbshipit-source-id: 8cf62efd28e0c9aed945f727b1872db6922cfeb3
2020-10-30 10:26:45 -07:00
Stanislau Hlebik
cda77b42c4 mononoke: add unsafe_sync_commit_with_expected_version
Summary:
This stack has a goal of cleaning up how commits with no parents and
consequently merges are treated in CommitSyncer. At the moment it always uses current version
to rewrite them, and this is incorrect. See example below (here N means "new
commits" i.e. commits that weren't remapped yet but we need to remap them now)

```
large repo

O <- uses current version
|
O
|
O  N
|/ |
O  | <-  uses old version
|  N
|  |
O  N <- this commit should be rewritten with old version!
```

With current logic all N commits will use current version for remapping, but
this is incorrect, and instead "old version" should be used. The goal is to fix
it and make it so that backsyncer and x-repo sync job pick the correct version
to use for remapping.

-----

As it was noted in the previous diff we need a function that overrides a
version for a commit with no parents. We need this function because for a
commit with no parents CommitSyncer can't decide which mapping version to use
because, well, there are no parents which could have hinted about the version.

So let's add this function and cleanup unsafe_sync_commit_impl function to
apply version override only to a commit with no parents. If commit has parents then we'd verify that the version from parents matches the expected version.

In the next diffs I'll make it so that if a version for commit with no parents is not specified then
unsafe_sync_commit_impl fails rather than uses current version.

Reviewed By: ikostia

Differential Revision: D24617953

fbshipit-source-id: a68f837da9d90bb18034f628b7880482a2e548b7
2020-10-30 10:26:45 -07:00
Kostia Balytskyi
608bd5a40f remove redundant clones
Reviewed By: farnz

Differential Revision: D24647186

fbshipit-source-id: 91d888bbc706886e011d04c9fa2758794f5f7cfa
2020-10-30 05:56:40 -07:00
Kostia Balytskyi
8540105a10 cross_repo_sync: log commit syncs
Summary:
This adds some basic Scuba logging to commit sync logic in Mononoke. This can be disabled via a tunable.

Note: of course, the wrapping of logging functions would have been pretty cool to do in a macro, but I don't have time atm to figure it out, so have just code.

Reviewed By: StanislavGlebik

Differential Revision: D24571702

fbshipit-source-id: f8830fc675a2a62d2204671e86ab2c819372c5cc
2020-10-30 05:56:40 -07:00
Kostia Balytskyi
9d09b815c1 CommitSyncer: add wiring for Scuba reporing support
Summary: This adds a `ScubaSampleBuilder` field to the `CommitSyncer` and ensures this field is instantiated with correct values (real vs discarding sample) depending on circumstances.

Reviewed By: StanislavGlebik

Differential Revision: D24539732

fbshipit-source-id: 37aedcff9aefcfcd6b740a0491ab35f9e5ce7c77
2020-10-30 05:56:40 -07:00
Stanislau Hlebik
80b25797d8 mononoke: remove test_unsafe_sync_commit function
Summary:
Functionality of this function can be replaced with
unsafe_always_rewrite_sync_commit, so let's do that.

However in the next diff we'll need a function similar to
test_unsafe_sync_commit but with a slightly different semantics - instead of
forcing override for every commit we'll just force it for a commit with no
parents. Because of that let's not remove unsafe_sync_commit_impl function.

Reviewed By: ikostia

Differential Revision: D24616824

fbshipit-source-id: 6969145d98cd23604920a6b490bf7ffe47938c08
2020-10-30 04:06:47 -07:00
Stanislau Hlebik
c61617d505 mononoke: use correct verssion name in integration tests
Summary:
Our integration tests do not have "test_version" version, they have only
"TEST_VERSION_NAME". This didn't make any difference because x-repo sync job
was always use the current version, but this is going to change soon. So let's
update the tests first

Reviewed By: krallin

Differential Revision: D24620364

fbshipit-source-id: 19416f6d6aba2d9c426efa545d18d4be458d3272
2020-10-30 03:15:34 -07:00
Stefan Filip
60d59253b1 tests: fix test-cmd-segmented-chagnelog-tailer.t
Summary:
Fixing test. I updated the serialization format in another stack and didn not
update the hash before I landed.

Reviewed By: lukaspiatkowski

Differential Revision: D24643831

fbshipit-source-id: 3ec888d99cbee0aa6d804740bebaf032dd28e2c9
2020-10-30 01:17:38 -07:00
Stefan Filip
18a6d2aef3 segmented_changelog: update sql query for last idmap entry
Summary:
MySQL doesn't like that the idmap table is renamed to `inner`. For good reason,
inner is a keyword, best to rename it.

Reviewed By: ahornby

Differential Revision: D24568914

fbshipit-source-id: 7a3790e835931b29658c7652cc89069c6b9b5bab
2020-10-29 17:40:19 -07:00
Stefan Filip
1089012b05 segmented_changelog: add SegmentedChangelogBuilder::with_blobrepo
Summary:
I avoided this function because it interacts in a weird ways with dependencies.
At this point I am no longer concerned about that and it can help us simplify
some code.
Looking ahead I think that we will refactor things into having fewer
dependencies.

Reviewed By: krallin

Differential Revision: D24555935

fbshipit-source-id: 994b25d90da491bb5cc593b6c33085790c4fb322
2020-10-29 17:40:19 -07:00
Stefan Filip
2391173a3f segmented_changelog: add segmented changelog tailer command
Summary:
The command reads the last SegmentedChangelog that was saved for a repository
and updates head to match a given bookmark (master).

Right now this is just a command that works on one repository. Follow up
changes will look at deployment options and handling multiple repositories.

Reviewed By: krallin

Differential Revision: D24516438

fbshipit-source-id: 8f04f9426c2f2d7748c5363d2dbdf9f3acb79ddd
2020-10-29 17:40:19 -07:00
Stefan Filip
07200876bb segmented_changelog: account for iddag lag in incremental build
Summary:
I initially saw the incremental build as something that would be run in places
that had IdMap and IdDag stored side by side in process. I am reconsidering
to use incremental build in the tailing process to keeps Segmented Changelog
artifacts up to date.

Since we update the IdMap before we update the IdDag, it is likely that we
will have runs that only update the IdMap and fail to update IdDags. This diff
adds a mechanism for the IdDag to catch up.

Reviewed By: krallin

Differential Revision: D24516440

fbshipit-source-id: 3a99248451d806ae20a0ba96199a34a8a35edaa4
2020-10-29 17:40:19 -07:00
Stefan Filip
a30217fe1b segmented_changelog: context and debug derives for easier debugging
Summary:
Nice to have things for debugging.

This isn't an exhaustive list of places that we could add context too. I'll
probably look to complete the list after the current changes are done.

Reviewed By: krallin

Differential Revision: D24516437

fbshipit-source-id: 7f29e7afde5a5918aea419181d786f48da9b8b14
2020-10-29 17:40:19 -07:00
Stefan Filip
7f274cf1ff segmented_changelog: style updates to segmented changelog seeder
Summary: Style.

Reviewed By: krallin

Differential Revision: D24516439

fbshipit-source-id: 11582b25e86b20c3e27a4ac4c299119f0b3c72a0
2020-10-29 17:40:19 -07:00
Stefan Filip
d1229b7fad segmented_changelog: update iddag store key to blake2
Summary:
The general goal is to allign segmented changelog blobstore usage with the
general pattern in Mononoke.

Reviewed By: quark-zju

Differential Revision: D24605796

fbshipit-source-id: 808985609f74ebc45f3fcc57583e55f3af9bce1d
2020-10-29 17:40:18 -07:00
Alex Hornby
511530d030 mononoke: change the default blobstore put behaviour to IfAbsent
Summary: Change the default blobstore put behaviour to IfAbsent, so that all binaries apart from admin tools using MononokeApp::special_put_behaviour() pick up the change.

Reviewed By: farnz

Differential Revision: D24619663

fbshipit-source-id: 98439513b985d2cde88ef99e5eb177974e9db5c9
2020-10-29 16:07:22 -07:00
Alex Hornby
89ace3790f mononoke: extend MononokeApp so admin apps can have a special default put behaviour
Summary:
Extend MononokeApp so admin apps can have a special default put behaviour (typically
 overwrite) vs the soon to be new default of IfAbsent

Use it from the admin tools.

Reviewed By: farnz

Differential Revision: D24623094

fbshipit-source-id: 5709c68429f8e1de0535eec132998d20411fc0e6
2020-10-29 16:07:22 -07:00
Simon Farnsworth
900b2a6982 mercurial: use repository.scm_name instead of arcanist_project_name
Summary:
mitrandir77 pointed me to this field which is exactly what I want.

Leave alias handling in place for configerator, which has a different name.

Reviewed By: mitrandir77

Differential Revision: D24628323

fbshipit-source-id: ccd01e6314feefd8ab75e8052a0a8a98b3119691
2020-10-29 14:40:38 -07:00
Katie Mancini
b13c5255eb Allow specifying and picking commits in prefetch_profile fetch CLI
Summary:
We want to be able to prefetch profiles on pull. That means we will need
to pick commits that will be good to prefetch for. This adds a flag --commits
that allows specifiying commits explicitly (mostly for testing), and a
flag `--predict-commits` which will pick good commits to prefetch for.

Reviewed By: genevievehelsel

Differential Revision: D23889882

fbshipit-source-id: 74e61c0c9d443ca396f326b0d547b9fc21a6364b
2020-10-29 13:34:06 -07:00
Katie Mancini
f616872079 Allow specifying commits to match against and prefetch in globFiles
Summary:
We want to be able to fetch prefetch profiles on pull. That means we will need
to prefetch the contents of prefetch profiles for commits that we are not
currently on. Thus globFiles (the thrift endpoint used for prefetch profiles
fetching) needs to be able to take commit hashes to match and fetch against.

Why fetch prefetch profiles on pull? This would get the prefetch started earlier so
the files are hopefully fetched by the time the user needs them.

Reviewed By: chadaustin, genevievehelsel

Differential Revision: D23858659

fbshipit-source-id: 123e423d5117274b92405dbb5c2df690298a1c18
2020-10-29 13:34:06 -07:00
Katie Mancini
e23fd00541 prefetch during prefetch profile activation
Summary:
Often a prefetch profile will be activated by a tool that uses that profile, so
we will by default prefetch a profile when activating it.

Reviewed By: genevievehelsel

Differential Revision: D23772446

fbshipit-source-id: 0b2e14cfa6ce079e8f04790ac2e0d196db5966ee
2020-10-29 13:34:05 -07:00
Katie Mancini
198b0e7451 Allow backgrounding profile prefetches
Summary:
Blocking checkout and pull to prefetch files could make these commands very
slow when large prefetches are triggered. To keep slow prefetches from causing
poor experiences we can background them by default.

Reviewed By: genevievehelsel

Differential Revision: D23831663

fbshipit-source-id: 4fba5ab894b927a6aa3359b516cff604ad524485
2020-10-29 13:34:05 -07:00
Jan Mazur
8152776a35 bypassing hooks for members of scm
Summary: Members of `scm` hipster group will be able to push to mononoke bypassing hooks when `BYPASS_ALL_HOOKS` pushvar is passed.

Reviewed By: krallin

Differential Revision: D24477468

fbshipit-source-id: ac910bf27e5510e1975c4a7cd0bfeff5216da70e
2020-10-29 10:14:25 -07:00
Kostia Balytskyi
3ff917ad64 remove get_current_reverse_mover_DEPRECATED
Reviewed By: farnz

Differential Revision: D24563248

fbshipit-source-id: cabcf29e2874e9a46b82bc118a1f08633ae46443
2020-10-29 07:48:37 -07:00
Katherine Zak
dcbf01f81c rm reading "cert" key from .arcrc
Summary: This diff removes reading the token from the "cert" property in the `~/.arcrc` and forces the caller to use either an OAuth token or CATs.

Reviewed By: quark-zju

Differential Revision: D24242614

fbshipit-source-id: 18538270102b7aa28731e82c8dd21f5da9e2f2d6
2020-10-29 06:13:26 -07:00
Alex Hornby
c359dfc022 mononoke: update walker to use MappedHgChangesetId derived data
Summary: Update walker to use MappedHgChangesetId derived data now that hg data is modeled like other derived data. This simplifies bonsai_to_hg_mapping_step

Reviewed By: aslpavel

Differential Revision: D24531553

fbshipit-source-id: 62663d8d47ec7145980c4cd567cba3009b1999cb
2020-10-29 04:29:44 -07:00
Mateusz Kwapich
cd27efe09c make @nocommit hook stricter
Reviewed By: admdikramr

Differential Revision: D24590666

fbshipit-source-id: 7a56760cfb3381d5fe84b67a9708e0dda377c31d
2020-10-29 03:43:48 -07:00
Durham Goode
2cf0157824 debug: add --wait to debuglock
Summary:
We have automation that wants to use this to hold the lock while doing
some maintenance. They want the ability to wait for the lock so they don't have
to busy loop.

Reviewed By: snarkmaster

Differential Revision: D24604466

fbshipit-source-id: be02539908655e183f334865718b68b633b069a5
2020-10-28 19:36:17 -07:00
Genevieve Helsel
8b42380d18 introduce eden logs command
Summary: Introduces an `eden logs` command to read a large chunk (1M by default) file into a paste. This is also added to the the eden rage report to get more insight into systems in which we cannot log in to view the logs (like laptops).

Reviewed By: kmancini

Differential Revision: D24146812

fbshipit-source-id: 991f1595b974eb01f77e86559a8413b0b09a24a4
2020-10-28 15:48:21 -07:00
Stefan Filip
2cce5b532b dag: update InProcessStore serialization
Summary: Removing redundant indexes from serialization.

Reviewed By: quark-zju

Differential Revision: D24580272

fbshipit-source-id: 49b1d6ae00e2f079dd0ed9d710afcd04b9744442
2020-10-28 14:55:59 -07:00
Stefan Filip
dc1edebf9e dag: benchmark for inprocess iddag serialization
Summary:
I am wondering whether we should customize the serialization format for the
InProcessStore. I want to have a basis for the comparison before I proceed.

Reviewed By: quark-zju

Differential Revision: D24580273

fbshipit-source-id: d3ddfdc029dbdd84f60acace06fddc80b4d005f4
2020-10-28 14:55:59 -07:00
Stanislau Hlebik
d40f15876d mononoke: upload missing lfs objects
Reviewed By: krallin

Differential Revision: D24595980

fbshipit-source-id: 397930e00a75b0343ed13839783501fe3d535ccd
2020-10-28 14:09:59 -07:00
Simon Farnsworth
79847775e6 Delete prototype walker
Summary: This is very old code that once acted to prototype walker-type functionality. As it's dead, delete it.

Reviewed By: ikostia, krallin

Differential Revision: D24591123

fbshipit-source-id: 663108e123d354243c2be4f00819f39d6951db93
2020-10-28 12:43:58 -07:00
Mark Thomas
c293fd3322 scs_server: add blobstore rate-limiting for requests
Summary:
Some requests can result in a large number of blob fetches.  Add rate limiting
so that these requests don't use up all available capacity.

Rate limits can be specified in tunables.

Reviewed By: ahornby

Differential Revision: D24592814

fbshipit-source-id: 9a73a92094d0ce01be5491b65b4808e3ebb05c11
2020-10-28 11:01:39 -07:00
Alex Hornby
4f2ce0cad8 mononoke: add ChangesetInfo derived data to the walker
Summary: Add ChangesetInfo derived data to the walker so that it can be scrubbed and validated

Reviewed By: farnz

Differential Revision: D24312123

fbshipit-source-id: 84b3bba87e5391339f97cd2e5ae0313761726d02
2020-10-28 10:53:15 -07:00
Alex Hornby
177e81d27f mononoke: improve walker command line parsing for node types
Summary: Add the ability to specify a group of node types in one go on the command line

Reviewed By: farnz

Differential Revision: D24526827

fbshipit-source-id: 59d2f0cd06dbbe2555625023be3725a528256005
2020-10-28 10:53:15 -07:00
Alex Hornby
e245a88486 mononoke: only walk derived data types that are configured for a repo
Summary:
Prevent the walker from trying to walk derived data node types that are not configured for a repo.

This is done by add a mapping from walker NodeType to derived data ::NAME, connect it up for existing derived data usages and using it for validation in setup.rs

Reviewed By: farnz

Differential Revision: D24391591

fbshipit-source-id: 21ae63f4f210d2e1310b0ee2c509fb492f742db7
2020-10-28 10:53:15 -07:00
Simon Farnsworth
d0110ce4a8 Support marking garbage in SQLBlob
Summary:
We want to be able to detect garbage blobs by looking at generation numbers.

Update generation numbers on put, and have a mark command exist to mark blobs as not garbage.

Reviewed By: ahornby

Differential Revision: D23989289

fbshipit-source-id: d96f38649151e3dbd5297cffc262776e74f6cc86
2020-10-28 10:23:55 -07:00
Stanislau Hlebik
a4eee3facd mononoke: check only common name in hgcli
Reviewed By: krallin

Differential Revision: D24545598

fbshipit-source-id: 7ede4f5b7119baf01e5fd4d651f9b0bd9722ab3e
2020-10-28 09:39:54 -07:00
Stanislau Hlebik
f93274ff8a mononoke: move loggers in StdioRelay
Summary:
I'm planning to use them from inside establish_connection function. So this
diff makes a refactoring to make scuba logger and slog logger available in
StdioRelay

Reviewed By: krallin

Differential Revision: D24590426

fbshipit-source-id: 5c20025295700aa91c685c47242618a20f89eb76
2020-10-28 09:39:54 -07:00
Durham Goode
e6af9b25b1 py3: fix globalrevs
Summary: The tests now pass with python 3.

Reviewed By: singhsrb

Differential Revision: D24583278

fbshipit-source-id: 7e0a0805751b1d3f1c77dfcd20df5b460994820a
2020-10-28 08:56:55 -07:00
Simon Farnsworth
71d6f02597 mercurial: phrevset should understand about repo aliases
Summary: We had some aliases for fbsource, and `fbcode` is still in use. Teach phrevset to recognise all aliases via config for ease of patching.

Reviewed By: markbt

Differential Revision: D24589906

fbshipit-source-id: bd61e86135d63ae07fa62d741e16cea4882f691b
2020-10-28 05:26:29 -07:00
generatedunixname89002005325677
913d0138ac Daily arc lint --take RUSTFMT
Reviewed By: krallin

Differential Revision: D24588052

fbshipit-source-id: 30ba91b100f9065f7dfb63f3ecdc3b550d0a84a7
2020-10-28 05:17:34 -07:00
Xavier Deguillard
9c2bb705a1 inodes: fix use after free in LookupProcessor
Summary:
The LookupProcessor class is built with the purpose of iterating all the inodes
in the passed in path. However, the LookupProcessor object may outlive the
lifetime of the path, and thus we need to build an iterator on the copied path,
not on the argument.

Differential Revision: D24581874

fbshipit-source-id: b66dc007920b7adad5272bf56d3034acb211fec6
2020-10-27 21:45:43 -07:00
Kostia Balytskyi
e606572eb3 cross_repo_sync: get rid of CommitSyncerArgs
Summary:
`CommitSyncerArgs` was useful when `CommitSyncer` did not have a way to query
existing configs from the configerator. Now that `SyncDataProvider` is part of
`CommitSyncer`, we can get rid of `CommitSyncerArgs`, which will also make
further improvements more convenient.

Reviewed By: StanislavGlebik

Differential Revision: D24565773

fbshipit-source-id: 4dd507b06d946c6018a4a4e8d5e77c6b27abe195
2020-10-27 17:00:08 -07:00
Stanislau Hlebik
0163f9dcf1 mononoke: admin rsync - add a command to delete files that exist in dest dir
Summary:
After we synced all the files from source directory into destination directory
the destination directory might have some files that source directory doesn't.

So let's add a command to remove them.

Reviewed By: ikostia

Differential Revision: D24541984

fbshipit-source-id: 7e0e21e4c8079d24e1e24adccd3a20a8bbc737ca
2020-10-27 15:12:00 -07:00
Stanislau Hlebik
e4e4b33bb8 mononoke: add --overwrite option to rsync
Summary:
Previously `mononoke_admin rsync` didn't overwrite files i.e. if a target
directory has a file with the same name as in source directory then it won't be overwritten.

This diff adds an option to make it possible to overwrite a file if a target
directory has a file with the same name but its content is different. However
note that if a file has to be overwritten then target file is going to be removed in one
commit and then copied in the second (i.e. we'll create two commits instead of
one). The reason for doing that is to preserve the history of the original file
(i.e. history from `from-directory`).

Reviewed By: aslpavel

Differential Revision: D24538199

fbshipit-source-id: 792162c4e5ad81fb6949dd95eb1322696ec011ea
2020-10-27 15:12:00 -07:00
Kostia Balytskyi
e23991ca4a SyncedCommitMappingEntry: make constructor take ..Version instead of Option<..Version>
Summary: A better fix would be to also get rid of `Option` in the struct itself, but I don't want to spend any more time on this atm, and this change is a clear improvement.

Reviewed By: StanislavGlebik

Differential Revision: D24538309

fbshipit-source-id: 6190c6936dc34d996ecd3d700e5f71282d45f651
2020-10-27 11:45:02 -07:00
Kostia Balytskyi
26e9741d32 push-redirector: borrow more instead of cloning
Summary: Same as the previous diff, but for push-redirector.

Reviewed By: StanislavGlebik

Differential Revision: D24538027

fbshipit-source-id: 392aee1b9cf0e684486c274c2b54fc2fb719bb3a
2020-10-27 11:45:02 -07:00
Genevieve Helsel
33e09c8dac add commit_multiple_path_info method
Reviewed By: krallin

Differential Revision: D24524267

fbshipit-source-id: a36bf7ca9c42285814e88aacd51aa6c3c129b3d7
2020-10-27 10:38:17 -07:00
Stanislau Hlebik
e76fa7ff9d mononoke: remove unused clone
Reviewed By: krallin

Differential Revision: D24564862

fbshipit-source-id: a03a0c5ba677bb11dce11bf06f259f6bd43dd54f
2020-10-27 09:13:43 -07:00
Stanislau Hlebik
972ce32a65 mononoke: fix warnings
Reviewed By: krallin

Differential Revision: D24564863

fbshipit-source-id: 0c461aac40ae50d7315cdcda21e9d7b003a5e536
2020-10-27 09:13:42 -07:00
Alex Hornby
a2ded99cf2 mononoke: update Phases::add_reachable_as_public to futures03
Summary:
update Phases::add_reachable_as_public to futures03

With this change all the Phases methods are futures03

Reviewed By: krallin

Differential Revision: D24531552

fbshipit-source-id: e9201621b798739d4d7dd197f15188103e9d359a
2020-10-27 08:06:12 -07:00
Alex Hornby
3ba61d5db5 mononoke: small improvement to walker command line edge type parsing
Summary: Simplify the combinator usage a little.

Reviewed By: krallin

Differential Revision: D24530950

fbshipit-source-id: 153e8a746b5a4a88c5341331f56144684e5e48eb
2020-10-27 07:44:39 -07:00
Kostia Balytskyi
7f5fb3c574 cross_repo_sync: start borrowing more instead of cloning
Summary:
Fewer clones, better code.

Note that in some cases we would previously have a fn that takes `ctx` by
ownership and just passes it through to some other fn outside of the
`cross_repo_sync`. I triead to make all such functions borrow and clone instead
in order to push cloning to the leaf fns of `cross_repo_sync`.

Reviewed By: StanislavGlebik

Differential Revision: D24538028

fbshipit-source-id: 8a3e78d4076b34d8b1767cdee1db3fdbb7acb4f7
2020-10-27 04:19:51 -07:00
Simon Farnsworth
4e59e26775 Thread ConfigStore into blobstore creation
Summary: SQLBlob GC (next diff in stack) will need a ConfigStore in SQLBlob. Make one available to blobstore creation

Reviewed By: krallin

Differential Revision: D24460586

fbshipit-source-id: ea2d5149e0c548844f1fd2a0d241ed0647e137ae
2020-10-27 04:14:24 -07:00
Alex Hornby
7b278b8bed mononoke: update Phases::get_public to futures03
Summary: update Phases::get_public to futures03

Reviewed By: krallin

Differential Revision: D24531550

fbshipit-source-id: ff60e178a58be6cc2a156b4a3685035c6a372785
2020-10-27 03:50:41 -07:00
Alex Hornby
f1f5d4b117 mononoke: update phases imports so that BoxFuture is the futures03 version
Summary: update phases imports so that BoxFuture is the futures03 version

Reviewed By: krallin

Differential Revision: D24531551

fbshipit-source-id: 1debb007456292fed1113f8c46e019bef27255c2
2020-10-27 03:50:41 -07:00
Alex Hornby
82642a9af9 mononoke: use the new BonsaiDerived::fetch_derived when scrubbing fsnodes
Summary: Use the new BonsaiDerived::fetch_derived from the walker when scrubbing fsnode derived data.   This saves a round trip to derived data and simplifies bonsai_to_fsnode_mapping_step().

Reviewed By: krallin

Differential Revision: D24311164

fbshipit-source-id: b26c6bdef548ca15c0cdbffde675f1a11d8b510e
2020-10-27 02:37:41 -07:00