Commit Graph

62036 Commits

Author SHA1 Message Date
Thomas Orozco
6b04c4d7d2 mononoke/warm_bookmarks_cache: don't initialize ALL bookmarks at once
Summary:
All the bookmarks is *a lot* of bookmarks. Don't do them all at once. Also, add
some logging output so we can tell how far along we are.

Reviewed By: HarveyHunt

Differential Revision: D25397297

fbshipit-source-id: c19b99123f88e05e99bff61e2399a62d378a6671
2020-12-08 08:30:56 -08:00
svcscm
cdc41a700f Updating submodules
Summary:
GitHub commits:

b1270a8cfd

Reviewed By: bigfootjon

fbshipit-source-id: 0ec17df481885714b8a39f992588ea332464594f
2020-12-08 08:30:56 -08:00
svcscm
60b5a44e7f Updating submodules
Summary:
GitHub commits:

d8bd9fc7b3
a683d80cc4

Reviewed By: bigfootjon

fbshipit-source-id: 39759bddedde1de1d268e9d60f026928908fb702
2020-12-07 21:10:31 -08:00
Lukas Piatkowski
00fe313eff mononoke/unbundle: get rid of futures 0.1
Summary: Also added a TryShared future to futures_ext. The problem with regular Shared is that if you want to share anyhow::Result the Error part of it is not cloneable. This TryShared will work nicely when returning anyhow::Result, which most of our code does.

Reviewed By: aslpavel

Differential Revision: D25223317

fbshipit-source-id: cf21141701884317a87dc726478dcd7a5a820c73
2020-12-07 20:41:26 -08:00
svcscm
b7828997b3 Updating submodules
Summary:
GitHub commits:

bf48781272
8a06fe278f
63517e7ee8

Reviewed By: bigfootjon

fbshipit-source-id: 6adbfaf5f0037bed2dc672adf6867d0645b48a83
2020-12-07 20:41:26 -08:00
svcscm
56ec743dda Updating submodules
Summary:
GitHub commits:

b0400ea229
20006c6017
f69a58c123
8b93e5b315

Reviewed By: bigfootjon

fbshipit-source-id: 65854068ca06c56a0a53d49eefe62540ba9e78f5
2020-12-07 17:33:02 -08:00
svcscm
c6c78f7bb9 Updating submodules
Summary:
GitHub commits:

50d301e9e0

Reviewed By: bigfootjon

fbshipit-source-id: 5830bc613fa63ac9c1d9200e37828335be6fabb2
2020-12-07 17:33:01 -08:00
svcscm
f54ccf1b08 Updating submodules
Summary:
GitHub commits:

a183ecb30a
bf3b5e1e01
ec58e38aaa
9c3fa2152b

Reviewed By: bigfootjon

fbshipit-source-id: 75e523a70aa2ed15dfc172b6b67d59d1fc8f7cc7
2020-12-07 12:49:18 -08:00
Wez Furlong
7470b6023b eden: add config and awareness for our edenfs.kext
Summary:
This commit adds a new eden configuration option that
controls whether we try to load our edenfs.kext in preference to
an alternative fuse implementation on macOS.

The majority of this diff is plumbing to convey the configuration
value through to the privhelper, which is relatively restrictive
due to its root-ness.

I've also updated watchman and mercurial to be aware of the new
filesystem type that shows up in the mount table.

Reviewed By: genevievehelsel

Differential Revision: D25065462

fbshipit-source-id: 4f35b9440654298e2706a0d0613d97eb63451999
2020-12-07 11:18:09 -08:00
svcscm
3b746c2dd7 Updating submodules
Summary:
GitHub commits:

747ad65179
10081b6ef1
b77569f18b
e6440da900
2a967fdd90
8a14a3ae98
d92da39bf0
e58d1120a6

Reviewed By: bigfootjon

fbshipit-source-id: c797361affa04f501bd3a4908dc0c17e23ffbe08
2020-12-07 11:18:09 -08:00
svcscm
983c110cef Updating submodules
Summary:
GitHub commits:

c28cdc279d

Reviewed By: bigfootjon

fbshipit-source-id: bd2ca7bbebd241611b1cb14dfd515c07e479d984
2020-12-07 09:38:47 -08:00
Thomas Orozco
16bac45a07 mononoke/bonsai_globalrev_mapping: set perf counters
Summary:
Like it says in the title. This is helpful to measure the number of SQL queries
we make. This required actually threading in a CoreContext, which we didn't
have before.

Reviewed By: StanislavGlebik

Differential Revision: D25336069

fbshipit-source-id: 35677c55550e95b5126de29c2a824b4eda32092c
2020-12-07 08:23:19 -08:00
Thomas Orozco
482ab2d2a6 eden/mononoke: allow turning on the bonsai / globalrev cache
Summary: Like it says in the title.

Reviewed By: StanislavGlebik

Differential Revision: D25336068

fbshipit-source-id: 113050215c28a28c820d938348a0a3e54c14c3ee
2020-12-07 08:23:19 -08:00
Thomas Orozco
13255301b0 mononoke/bonsai_globalrev_mapping: add caching
Summary:
Like it says in the title, this adds a caching layer around Globalrevs using
our existing `GetOrFillMultipleFromCacheLayers` abstraction.

Note: I've opted to not track dedicated metrics for this (compare to the hg
mapping to see them), since I don't believe we really ever look at them.

I'd like to do a little bit of refactoring of
`GetOrFillMultipleFromCacheLayers` to a) track them without having to ad-hoc
code it, b) convert it 0.3 futures, and c) require less ceremony to call it.
However, I'll do so in another diff.

Reviewed By: StanislavGlebik

Differential Revision: D25334478

fbshipit-source-id: 1385298b8fdf1cd081b6e509c6c3e03b3abbfa5b
2020-12-07 08:23:19 -08:00
Thomas Orozco
ec0bff0b82 mononoke/bonsai_globalrev_mapping: split out sql module
Summary: This lib.rs is getting too big. Split it.

Reviewed By: StanislavGlebik

Differential Revision: D25333510

fbshipit-source-id: ea15664d2de21a24ee107162e030b7762b1d413e
2020-12-07 08:23:19 -08:00
Thomas Orozco
00c3297c49 mononoke/bonsai_globalrev_mapping: make point queries default impl methods
Summary:
I'd like to add a caching variant for this. Might as well not have to rewrite
those methods on an ad-hoc basis.

Reviewed By: StanislavGlebik

Differential Revision: D25333461

fbshipit-source-id: 632c0307189fe15a926d808c1eeca1e3f240eb19
2020-12-07 08:23:18 -08:00
Thomas Orozco
1ec5537e9e mononoke/bonsai_globalrev_mapping: update to futures 0.3
Summary: Like it says in the title.

Reviewed By: StanislavGlebik

Differential Revision: D25333450

fbshipit-source-id: 49ad4b1964a4dfd9f3e0108fa421d451ef905256
2020-12-07 08:23:18 -08:00
Johan Schuijt-Li
58f5b6a263 mononokepeer: fix incorrect error check
Summary: If response is not HTTP/1.1 or isn't Weboscket upgrade we should report error.

Reviewed By: HarveyHunt

Differential Revision: D25368729

fbshipit-source-id: 62dcd93240902924312f4de2965f58357c46c98b
2020-12-07 05:49:10 -08:00
Johan Schuijt-Li
37078cadc7 use integers in comparison for readauthforuri
Summary:
Further down the following check is executed:
  priority > bestpriority

When priority are strings, this leads to wrong expectations:
  $ python3
  >>> a = "90"
  >>> b = "100"
  >>> a > b
  True

Reviewed By: krallin

Differential Revision: D25334682

fbshipit-source-id: 48287d57ae6a938e9f2619babf49d073534f46d7
2020-12-07 05:49:09 -08:00
Stanislau Hlebik
40b67f9d09 mononoke: do not use batched in derived_data_tailer
Reviewed By: ikostia

Differential Revision: D25366938

fbshipit-source-id: 9b10853b1fdf5ee281187067aa768fa52e6d3074
2020-12-07 02:51:45 -08:00
svcscm
ea7cb10e03 Updating submodules
Summary:
GitHub commits:

7a881340b7
0b9e21cfa5
62773985c3

Reviewed By: jurajh-fb

fbshipit-source-id: 438c23020800e485c7dbadbdc7cbe8e79ed717d6
2020-12-05 22:23:12 -08:00
svcscm
59932391e7 Updating submodules
Summary:
GitHub commits:

8f3147777b
e102de7318
a5d166abbc
8e3e907c69

Reviewed By: jurajh-fb

fbshipit-source-id: c2dbc7432ebaa4d92b1368fc248c2b55049fd1fe
2020-12-04 21:38:42 -08:00
Durham Goode
23daa7f90f targets: remove python 2 targets
Summary:
Now that we don't ship Python 2 rpms, let's remove the build and test
targets.

Reviewed By: singhsrb, xavierd

Differential Revision: D25313325

fbshipit-source-id: 876385ccb6cb7675fef8d93978b372a3085764b0
2020-12-04 21:19:13 -08:00
svcscm
780b493eb3 Updating submodules
Summary:
GitHub commits:

d7ed39abac

Reviewed By: jurajh-fb

fbshipit-source-id: 00b4e9a2c26ab5267b3dd98027999b472901c393
2020-12-04 21:19:13 -08:00
svcscm
a97f1920c2 Updating submodules
Summary:
GitHub commits:

82f1fa7fcc
239d285ff9
ee4bd4780b
04a06b3307
d23e389217

Reviewed By: jurajh-fb

fbshipit-source-id: 369aec88620330ef560c6b0fc87ad523d8ae1cea
2020-12-04 17:09:37 -08:00
Wez Furlong
7d8dbdaf69 edenfs: fixup doctor kerberos advice
Summary:
if you have no cache to destroy `kdestroy` will not succeed
and thus the `kinit` portion won't run.

Reviewed By: genevievehelsel

Differential Revision: D25340727

fbshipit-source-id: f20d882b95face17c5ee4b0b5b1b1267fd4bb2c8
2020-12-04 15:50:31 -08:00
svcscm
f1744d30f7 Updating submodules
Summary:
GitHub commits:

d85d8e903c
ae03ef8388

Reviewed By: jurajh-fb

fbshipit-source-id: e43c520521675d6dbc94e6e5b1222286cd0578e7
2020-12-04 15:12:28 -08:00
Durham Goode
c1659751c9 shelve: add buck kill warning to shelve and unshelve
Summary:
T53602763 is about hg shelve and other similar
move-off-then-back-on-a-commit situations to get reported incorrectly to
watchman on eden checkouts. This can cause issues with buck and other tools.

The bug is in Eden, but let's try to save people time debugging by telling them
of the risk.

Reviewed By: fanzeyi

Differential Revision: D25337932

fbshipit-source-id: e293c43b5c87bea26564e1efd45b7a983862a442
2020-12-04 14:33:03 -08:00
Kostia Balytskyi
3ed778a5ea observability: add dynamic level drain
Summary:
This makes logs go through a `Drain` which queries `ObservabilityContext` (introduced in a previous diff) for current logging level.  ATM I did not add any tests, and it's pretty easy to add a unit-test checking that the drain indeed respects the level, but it's so simple that I am not 100% convinced that test would be all that valuable.

Note that currently `ObservabilityContext` is enabled in a `Static` variation.

Reviewed By: mitrandir77

Differential Revision: D25232400

fbshipit-source-id: 7499916e0a3ddab43538343e6ed215818517eaf7
2020-12-04 14:30:29 -08:00
Kostia Balytskyi
c60fcebc12 observability: introduce ObservabilityContext
Summary:
`ObservabilityContext` is a structure that helps logging facilities within Mononoke to make logging decisions. Specifically, the upcoming `DynamicLoggingDrain` and already existing `MononokeScubaSampleBuilder` will have this structure as a component and decide whether a particular logging statement (slog or scuba) should go ahead.

Internally, `ObservabilityContext` is a wrapper around data received from a [configerator endpoint](https://www.internalfb.com/intern/configerator/edit/?path=scm%2Fmononoke%2Fobservability%2Fobservability_config.cconf).

This diff makes a few unobvious decisions about how this is organized. My goals were:
1. to have production (i.e. reading from configerator), static (i.e. emulating current prod behavior) and test variants of `ObservabilityContext`
1. to avoid having consumers know which of these variants are used
1. to avoid making all consumers of `ObservabilityContext` necessarily generic
1. to avoid using dynamic dispatch of `ObservabilityContext`'s methods

Points 3 and 4 mean that `ObservabilityContext` cannot be a trait. `enum` is a common solution in such cases. However, if `ObservabilityContext` is an `enum`, consumers will know which variant they are using (because `enum` variants are public). So the solution is to use a private enum wrapped in a struct.

Reviewed By: mitrandir77

Differential Revision: D25287759

fbshipit-source-id: da034c71570137e8a8fb7749b1e4ad43be482f66
2020-12-04 14:30:29 -08:00
Wez Furlong
52076f801f eden: improve validation for eden redirect add
Summary:
A user ran into an issue where some buck/build related automation had
added a redirection named `../../../Users/username/reponame/.lsp-buck-out`.

The valid name for this is `.lsp-buck-out` because redirections must always be
repo-root-relative.

This commit adds missing validation for this, and makes it slightly more
convenient for consuming tools to work with by allowing an absolute path to the
redirection to be specified.

Why not simply resolve the path from the cwd and use that?  The command has
always been defined in terms of repo-root-relative paths, and there are a
number of cases where CI and other build tools can start in unexpected
subdirectories and that means that paths like `../buck-out` can have an
ambiguous or surprising resolution.  There are tools that follow the
documentation and correctly specify repo-root-relative paths that would either
be broken outright or left with newly ambiguous behavior if we suddenly started
to accept and resolve relative paths for ourselves.

I'm not opposed to changing the behavior in that way in the future, but it
requires a bit more of a coordinated effort than I have time to wrangle right
now, so this diff is aimed at surfacing breakage rather than magically
resolving it.

This commit fixes up the behavior so that paths like `../foo` are explicitly
checked for and generate an error, but absolute paths like
`/Users/username/reponame/foo` (which are unambiguous) are now resolved to the
appropriate repo-root-relative path automatically.

That makes it a bit easier for consuming tools to swing through a behavior
change; they can now simply pass the absolute path rather than messing around
with trying relativize the paths to the repo root.

Reviewed By: kmancini

Differential Revision: D25261490

fbshipit-source-id: 1706b54fc15c2dad334cdf6c75cca5e6e44ed97a
2020-12-04 14:28:29 -08:00
Xavier Deguillard
2bfdf6f481 prjfs: handle concurrent file/directory removal
Summary:
A while back, we saw that concurrent directory creation would lead to EdenFS
being confused and failing to record some of the created directories. This then
caused EdenFS to no longer being in sync with what was on disk. To handle this
case, we've had to manually creating these directories recursively.

What I didn't realize at the time was that these concurrent notifications could
also happen on removal this time, and if a directory removal notification wins
the race against the removal of its last children, that directory wouldn't be
removed and EdenFS would once again be confused about the state of the
repository.

Fixing this is a bit trickier than directory creation as it's more racier.
Consider a directory that is being removed, and then immediately recreated with
a file in it in a different process. The naive approach of simply force
removing all of the children of a directory when handling the removal
notification would clash with the file creation. We could argue that nobody
should be doing this, but there would be an unhandled race, and thus a bug
where data would potentially be lost[0].

We can however fix this bug slightly differently. For file/directory removal,
we can actually hook onto the pre-callback, ie: one that happens before the
file/directory is no longer visible on disk. This inherently eliminate the race
altogether as the callback will be guaranteed to run when none of its children
are present, and if a race happens with a file creation in it, we can simply
fail the removal properly.

The only tricky bit is for the renaming logic, as renaming a file is logically
a removal followed by a creation. For that reason, I've moved part of the
renaming bits to the pre-callback too.

In theory, this change may negatively affect workloads that do concurrent
directory removal as the duration during which a file/directory is visible
ondisk now includes the EdenFS callback while it didn't before. Such workflows
should be fairly rare and/or redirected to avoid EdenFS altogether if
performance matters.

[0]: This left-over file that EdenFS wouldn't be aware of would also later
cause the checkout code to fail due to invalidation failures triggered when
trying to invalidate that directory. This would be fairly hard to debug.

Reviewed By: fanzeyi

Differential Revision: D25112381

fbshipit-source-id: 9300499ce872ad93d0a687f0e61b7e2a9caf9556
2020-12-04 14:25:44 -08:00
svcscm
adda102104 Updating submodules
Summary:
GitHub commits:

13ed0bc5b7
b832314372

Reviewed By: jurajh-fb

fbshipit-source-id: 5d75e614eb609f3ec48d09e430195c593a2201e0
2020-12-04 14:25:44 -08:00
svcscm
663f9b4211 Updating submodules
Summary:
GitHub commits:

4c2692fac9

Reviewed By: jurajh-fb

fbshipit-source-id: de1b0e1202bcd8e62b685fb50cd6656c511936e4
2020-12-04 12:13:15 -08:00
svcscm
7e58cd531a Updating submodules
Summary:
GitHub commits:

d57ef43304
2c4ef03640

Reviewed By: jurajh-fb

fbshipit-source-id: 473ef2deefe3bd9c21d8d550e1327ee0a4a416d1
2020-12-04 12:13:15 -08:00
svcscm
0aea82c846 Updating submodules
Summary:
GitHub commits:

b526ea4439

Reviewed By: jurajh-fb

fbshipit-source-id: 98af46e0e9aa8d37490ce655f443fa3c37ffa7a2
2020-12-04 10:51:22 -08:00
Arun Kulshreshtha
3c63f41868 auth: migrate crate to autocargo
Reviewed By: singhsrb

Differential Revision: D25323754

fbshipit-source-id: 655a2f525f0f5267b6166310d8cb9598ae2f7b1b
2020-12-04 09:24:18 -08:00
svcscm
628388f87a Updating submodules
Summary:
GitHub commits:

e035909fbe
f45cb4fe37
85afaeebe8

Reviewed By: jurajh-fb

fbshipit-source-id: 4cef37fd2d51fe1b7175112e1c76620d77c04c5e
2020-12-04 09:20:50 -08:00
Xavier Deguillard
446ae54b71 inodes: increment and decrement the fs refcount on Windows
Summary:
On Windows, the FS refcount is used to indicate that ProjectedFS knows about
this inode and either has a placeholder on disk, or a plain file. The first
event only occurs on lookup (similarly to Linux/macOS), while the second one
happens when files are created by the user and we receive a notification about
it.

In order to avoid races and to miss necessary invalidation, the refcount has to
be incremented after the placeholder has been created, and the refcount is
decremented before the invalidation is performed. This is straightforward to
achieve for notifications, but requires passing a callback to the PrfsChannel.

Reviewed By: chadaustin

Differential Revision: D24800819

fbshipit-source-id: 0e7ea7ed3a9ca0414e3e727fba975045546d82d1
2020-12-04 09:13:38 -08:00
Xavier Deguillard
b2bfbe2300 inodes: make the fs refcount a flag on Windows
Summary:
On Windows, the refcount will be increased when a placeholder is written on
disk, and decremented when it is invalidated. Since the invalidation completely
clears the inode on disk, we need to make sure we don't keep an inode loaded
after it is invalidated. For that reason, let's just allow the refcount to be
either 0 or 1.

Reviewed By: chadaustin

Differential Revision: D24764567

fbshipit-source-id: 5d09fb9f53bf36d517d0bfb083107f176c33c2a7
2020-12-04 09:13:37 -08:00
svcscm
6604289265 Updating submodules
Summary:
GitHub commits:

adba3e9e4c
8a47844f1f
5a2072f6f0
9f6fd61842
11d2dc31d5
b3cc745358
c377f57b09

Reviewed By: jurajh-fb

fbshipit-source-id: e16085bc2ea9b38b2b4c68861b63fa691a3227aa
2020-12-04 08:48:02 -08:00
Alex Hornby
28d4471f75 mononoke: no need to collect walker iterators
Summary: Can just pass on the iterator

Reviewed By: ikostia

Differential Revision: D25216892

fbshipit-source-id: 79c08737477ac7ed1f824c50105d5977ee592126
2020-12-04 03:07:05 -08:00
Alex Hornby
c1a563a1c6 mononoke: remove --cachelib-only-blobstore from walker test cmdlines
Summary: Its now the default for this binary, might as well shorten the test command lines

Reviewed By: ikostia

Differential Revision: D25219717

fbshipit-source-id: 8074145c6f05f26ab7fa18d2ff399482ad592885
2020-12-04 03:07:05 -08:00
Alex Hornby
591363e1c4 mononoke: allow binaries to specify a default for cachelib-only-blobstore
Summary: Reduces boilerplate for binaries usually run in this mode, notably the walker

Reviewed By: ikostia

Differential Revision: D25216883

fbshipit-source-id: e31d2a6aec7da3baafd8bcf208cf79cc696752c0
2020-12-04 03:07:04 -08:00
Alex Hornby
54bda6537d mononoke: allow binaries to default a blobstore read qps
Summary: This is useful to prevent accidentally consuming too much.  Enabled it for the walker

Reviewed By: ikostia

Differential Revision: D25216880

fbshipit-source-id: e80f490d6ece40d64cc8609e7d6b80d0ecbb1671
2020-12-04 03:07:04 -08:00
Alex Hornby
f814075cee mononoke: allow binaries to default blobstore-cachelib-attempt-zstd option
Summary: Reduces boiler plate on command line for binaries like walker that want different default

Reviewed By: krallin

Differential Revision: D25216876

fbshipit-source-id: 0df474568d28e0726be223e9dc0a760523063d21
2020-12-04 03:07:04 -08:00
svcscm
ed2643115a Updating submodules
Summary:
GitHub commits:

f73476433c

Reviewed By: jurajh-fb

fbshipit-source-id: ecd66059a65f6e432b4499900d4d459e18151655
2020-12-04 03:07:04 -08:00
svcscm
0ada344324 Updating submodules
Summary:
GitHub commits:

50ce1038ad
ea2cb28ef1
70f2e0916a
03576091b5
69facbc276

Reviewed By: jurajh-fb

fbshipit-source-id: 5ddb3fc49660158745943720ae537a22a49a4571
2020-12-03 20:35:37 -08:00
Stefan Filip
f1b78f6afb thrift: update generated thrift assets
Summary: Regen

Reviewed By: singhsrb

Differential Revision: D25320884

fbshipit-source-id: bd3ce800257450b6cd32fb42a3c49e5ead01d4e3
2020-12-03 19:48:04 -08:00
Egor Tkachenko
8c5d77f0f8 Adding connection pool for darkstorm
Summary: Darkisilon cell consists of multiple hosts which shares underlying storage, so write to one of them is visible for all hosts. Lets spread requests between all these hosts. I'll get list of hosts from the smc tier and will randomly connect to one on each request.

Reviewed By: krallin

Differential Revision: D25163782

fbshipit-source-id: b28085dd37b15972469b7334a47def473e10f34e
2020-12-03 17:10:42 -08:00