Commit Graph

23 Commits

Author SHA1 Message Date
Arun Kulshreshtha
5f0181f48c Regenerate all Cargo.tomls after upgrade to futures 0.3.5
Summary: D22381744 updated the version of `futures` in third-party/rust to 0.3.5, but did not regenerate the autocargo-managed Cargo.toml files in the repo. Although this is a semver-compatible change (and therefore should not break anything), it means that affected projects would see changes to all of their Cargo.toml files the next time they ran `cargo autocargo`.

Reviewed By: dtolnay

Differential Revision: D22403809

fbshipit-source-id: eb1fdbaf69c99549309da0f67c9bebcb69c1131b
2020-07-06 20:49:43 -07:00
Lukas Piatkowski
f9eb013d43 mononoke/configerator structs: change the OSS folder where configerator structs are saved
Summary:
Due to Thrift design of "include" statements in fbcode the thrift structures has to be contained in folders that are identical to the folder layout inside fbcode.

This diff changes the folder layout on Cargp.toml files and in fbcode_builder, there will be a next diff that changes this for ShipIt as well.

Reviewed By: ikostia

Differential Revision: D22208707

fbshipit-source-id: 65f9cafed2f0fcc8398a3887dfa622de9e139f68
2020-06-24 09:38:46 -07:00
Stanislau Hlebik
8ff0c411cc mononoke: yield if we do a lot of skips in skiplist
Summary:
During expensive getbundle request traversing skiplist uses a lot of cpu, and
in fact it's blocking the whole CPU. krallin suggested to yield since it
should avoid blocking cpus, and that's what this diff is doing.

Reviewed By: krallin

Differential Revision: D22160477

fbshipit-source-id: 5bd881d5c50f4d8e64f2cc90389abc8568ec1df6
2020-06-22 09:20:40 -07:00
Stanislau Hlebik
dc84f9741d mononoke: try to compress values if they above cachelib limit
Summary: If a value is above cachelib limit let's try to compress it.

Reviewed By: krallin

Differential Revision: D22139644

fbshipit-source-id: 9eb366e8ec94fe66529d27892a988b035989332a
2020-06-20 01:05:54 -07:00
Simon Farnsworth
5f2b7259cd Run hooks in the large repo as well as the small when pushredirection is in place
Summary: Megarepo is simplified if we can avoid copying hooks everywhere - run megarepo hooks as well as small repo hooks during pushredirection.

Reviewed By: StanislavGlebik

Differential Revision: D20652331

fbshipit-source-id: f42216797b9061db10b50c1440253de1f56d6b85
2020-06-18 07:33:46 -07:00
Jeremy Fitzhardinge
1b4edb5567 eden: remove unused Rust dependencies
Summary:
Remove unused dependencies for Rust targets.

This failed to remove the dependencies in eden/scm/edenscmnative/bindings
because of the extra macro layer.

Manual edits (named_deps) and misc output in P133451794

Reviewed By: dtolnay

Differential Revision: D22083498

fbshipit-source-id: 170bbaf3c6d767e52e86152d0f34bf6daa198283
2020-06-17 17:55:03 -07:00
Jeremy Fitzhardinge
c530d32056 rust: clean up some warnings
Summary: Prep for 1.44 but also general cleanups.

Reviewed By: dtolnay

Differential Revision: D22024428

fbshipit-source-id: 8e1d39a1e78289129b38554674d3dbf80681f4c3
2020-06-15 16:50:40 -07:00
Stanislau Hlebik
4c15790b84 mononoke: return FilenodeResult from get_all_filenodes_maybe_stale
Summary:
Let's return FilenodeResult from get_all_filenodes_maybe_stale and change
callers to deal with that.

The change is straightforward with the exception of `file_history.rs`.
get_all_filenodes_maybe_stale() is used here to prefetch a lot filenodes in one
go. This diff changes it to return an empty vec in case filenodes are disabled.
Unfortunately this is not a great solution - since prefetched files are empty
get_file_history_using_prefetched() falls back to fetching filenodes
sequentially from the blobstore. that might be too slow, and the next diffs in
the stack will address this problem.

Reviewed By: krallin

Differential Revision: D21881082

fbshipit-source-id: a86dfd48a92182381ab56994f6b0f4b14651ea14
2020-06-10 19:29:16 -07:00
Stanislau Hlebik
af1f3a0d8d mononoke: add filenodes_disable tunable
Summary:
We'd like to serve read traffic even if filenodes are disabled. Let's add a
tunable that can control it.

Reviewed By: HarveyHunt

Differential Revision: D21839672

fbshipit-source-id: 4ec4dd16b9e6e3ffb1ada0d812e1153e1a33a268
2020-06-02 09:22:43 -07:00
Stanislau Hlebik
cdbb734b29 mononoke: remove scs_enable_history_across_deletions tunable
Summary: It was replaced with a parameter

Reviewed By: HarveyHunt

Differential Revision: D21839397

fbshipit-source-id: e75900b3da80985cd762659993b8b285411fe928
2020-06-02 09:22:43 -07:00
Stanislau Hlebik
a5eaa551e8 mononoke: support history across deletions
Summary:
now fastlog will be able to show a history of file like that:

```
Added
|
Deleted
|
Added
```

We do it by using deleted file manifest to find where a file was deleted. We do
it in case we find a unode which doesn't have a parent.

Differential Revision: D21664248

fbshipit-source-id: 8e80fccc87361e66e4e00ae2da3671ed8327f1f8
2020-05-21 02:46:21 -07:00
Stanislau Hlebik
d09e107e1d mononoke: add merge commit validation
Summary:
Follow up from D21596758 - current logic of pushrebasing a merge is very
complicated. To prevent repo corruptions let's do a very simple validation -
generate hg changeset from a rebased bonsai changeset.

Given that generating hg changeset is an expensive operation let's do it only
after the first rebase attempt - otherwise we might risk constantly losing the
pushrebase race.

Differential Revision: D21659187

fbshipit-source-id: f43a855cf0fbdbd11a40d3ec38283af344cde5e6
2020-05-20 11:17:21 -07:00
Mark Thomas
85d00edafa tunables: only log tunables when they change
Summary:
Rather than logging `Refreshing tunables` all the time, log only when they
change, and include the values that they are changing from and to.

Reviewed By: farnz

Differential Revision: D21641191

fbshipit-source-id: b0b5edd687e2e41074ce1c8be13fd6918dff924d
2020-05-20 03:56:49 -07:00
Stefan Filip
60966c93e7 autocargo: regenerate
Summary: maintenance

Reviewed By: StanislavGlebik

Differential Revision: D21640322

fbshipit-source-id: d0b2ce604735c05d540d06835c8e4c8a940fbf5c
2020-05-19 16:08:40 -07:00
Harvey Hunt
c45b4541e2 mononoke: Add with_tunables function to allow overriding tunable values
Summary:
Currently, there isn't a way to override the value of a tunable during
a unit test. This is unfortunate and may push people to creating integration
tests when unit tests would be best.

Add `with_tunables`, which allows callers to override the tunables values that
a closure accesses. Further, add an example unit test that shows the behaviour.

Thanks to krallin for suggesting this and helping with the implementation
details.

Reviewed By: krallin

Differential Revision: D21595220

fbshipit-source-id: c31da88fb4fcfd38f761960ffe8025132025e6c9
2020-05-18 04:31:40 -07:00
Stanislau Hlebik
211032d5af mononoke: log undesired file/tree fetches
Summary:
Let's add an option to log how many files and trees were fetched in a
particular repo that start with a prefix.

Reviewed By: farnz

Differential Revision: D21617347

fbshipit-source-id: a57f74eadf32781e6c024e18da252c98af21996d
2020-05-18 04:12:54 -07:00
Stanislau Hlebik
fc7b25b0a2 RFC: mononoke: add support for string tunables
Summary:
Just as for ints and bools, let's add support for strings.
A few notes:
1) we don't have AtomicString, so I decided to use ArcSwap<String>.
However to make code generation simpler (see tunables-derive) I've added a type
alias for that
2) Return type is Arc<String> to avoid unnecessary copies.Another option that we might have here is to put the whole Tunables structure inside ArcSwap, and changing `tunables()` to return Arc<MononookeTunables>
instead of &'static MononokeTunables. However that's a bigger change to make.

Reviewed By: markbt

Differential Revision: D21592390

fbshipit-source-id: 6d3cf340b13f7aef9adb2b1b99ed2bf260033285
2020-05-18 03:35:54 -07:00
Thomas Orozco
15de5707ca mononoke/repo_client: log commands in progress
Summary:
This adds support for periodically logging that a command is in progress in
Mononoke. The underlying motivation is to make sure that if something is taking
a long time, we can still show some feedback to the user (and log to Scuba). We
might want to log this every 30 seconds.

That said, this is more of an RFC at this stage. I'm thinking it might make
sense to log to Scuba more often and to users less often. It might make sense
to also restrict this to specific commands, such as unbundle:
https://fburl.com/scuba/mononoke_test_perf/atik5959

Reviewed By: StanislavGlebik

Differential Revision: D21549862

fbshipit-source-id: 1d02c5c926abc7e491ac5b8ae0244b5f4620c93e
2020-05-14 10:23:57 -07:00
Mark Thomas
5774dbde9d unbundle: accept mutation entries and store them in the mutation store
Summary:
Advertise support for `b2x:infinitepushmutation`.  When the client sends us
mutation information, store it in the mutation store.

Reviewed By: mitrandir77

Differential Revision: D20871340

fbshipit-source-id: ab0b3a20f43a7d97b3c51dcc10035bf7115579af
2020-05-13 11:00:56 -07:00
Thomas Orozco
6ac0c26e06 mononoke/context_concurrency_blobstore: use rate limit instead of semaphore
Summary:
Limits on concurrent calls are a bit hard to reason about, and it's not super
obvious what a good limit when all our underlying limits are expressed in QPS
(and when our data sets don't have peak concurrency - instead they have
completion time + # blob accesses).

Considering our past experience with ThrottledBlob has been quite positive
overall, I'd like to just use the same approach in ContextConcurrencyBlobstore.
To be safe, I've also updated this to be driven by tunables, which make it
easier to rollout and rollback.

Note that I removed `Debug` on `CoreContext` as part of this because it wasn't
used anywhere. We can bring back a meaningful implementation of `Debug` there
in the future if we want to. That triggered some warnings about unused fields,
which for now I just silenced.

Reviewed By: farnz

Differential Revision: D21449405

fbshipit-source-id: 5ca843694607888653a75067a4396b36e572f070
2020-05-12 06:49:25 -07:00
Thomas Orozco
3b14b52337 mononoke/scuba_ext: allow truncating overly long msg fields
Summary:
When we log to Scuba, we need to truncate the `msg` field if it's too long, or
we might be missing log entries in Scuba. I put this behind a tunable so we can, well,
tune it.

Reviewed By: farnz

Differential Revision: D21405959

fbshipit-source-id: 08f0d3491d1a9728b0ca9221436dee2e8f1a17eb
2020-05-05 12:28:51 -07:00
Stanislau Hlebik
c71469dc1c mononoke: add tunable for warm bookmark config
Summary: Let's make it tunable, more context in D21300885

Reviewed By: ikostia, krallin

Differential Revision: D21347636

fbshipit-source-id: 4bc91effdd212a3f5c4a0c3d4952f52a1cf417d7
2020-05-01 04:04:51 -07:00
Harvey Hunt
3cd49f9d3c mononoke: Add tunables - a simple form of config hot reloading
Summary:
Currently, Mononoke's configs are loaded at startup and only refreshed
during restart. There are some exceptions to this, including throttling limits.
Other Mononoke services (such as the LFS server) have their own implementations
of hot reloadable configs, however there isn't a universally agreed upon method.

Static configs makes it hard to roll out features gradually and safely. If a
bad config option is enabled, it can't be rectified until the entire tier is
restarted. However, Mononoke's code is structured with static configs in mind
and doesn't support hot reloading. Changing this would require a lot of work
(imagine trying to swap out blobstore configs during run time) and wouldn't
necessarily provide much benefit.

Instead, add a subset of hot reloadable configs called tunables. Tunables are
accessible from anywhere in the code and are cheap to read as they only require
reading an atomic value. This means that they can be used even in hot code
paths.

Currently tunables support reloading boolean values and i64s. In the future,
I'd like to expand tunables to include more functionality, such as a rollout
percentage.

The `--tunables-config` flag points to a configerator spec that exports a
Tunables thrift struct. This allows differents tiers and Mononoke services to
have their own tunables. If this isn't provided, `MononokeTunables::default()`
will be used.

This diff adds a proc_macro that will generate the relevant `get` and `update`
methods for the fields added to a struct which derives `Tunables`. This struct is
then stored in a `once_cell` and can be accessed using `tunables::tunables()`.

To add a new tunable, add a field to the `MononokeTunables` struct that is of
type `AtomicBool` or `AtomicI64`. Update the relevant tunables configerator
config to include your new field, with the exact same name.

Removing a tunable from `MononokeTunables` is fine, as is removing a tunable
from configerator.

If the `--tunables-config` path isn't passed, then a default tunables config
located at `scm/mononoke/tunables/default` will be loaded. There is also the
`--disable-tunables` flag that won't load anything from configerator, it
will instead use the `Tunable` struct's `default()` method to initialise it.
This is useful in integration tests.

Reviewed By: StanislavGlebik

Differential Revision: D21177252

fbshipit-source-id: 02a93c1ceee99066019b23d81ea308e4c565d371
2020-04-30 16:08:30 -07:00