Summary: Have constructor do init() instead. I can't think of any valid reason to have this API other than confusing everyone who decides to use it.
Reviewed By: praihan
Differential Revision: D32302228
fbshipit-source-id: 136e0d2919291acd60be953337309cd006bd674b
Summary: I had previously change `repo_changeset` method to take bubble into account, but forgot to also change `repo_changeset_pair`. This should fix most of the usages of snapshots in SCS.
Reviewed By: markbt
Differential Revision: D32396469
fbshipit-source-id: 5760974df92ec7e9049cf51164a006f9198015b5
Summary: Snapshots already have a bit of `scsc` support, but you needed to specify `--bubble-id` argument, which is not really good as that is not visible to users. This diff makes it possible to query a snapshot simply by using `--snapshot-id`. The bubble can still be provided to make the query faster.
Reviewed By: markbt
Differential Revision: D32395199
fbshipit-source-id: 8f89ae86b56d3789a5cbf69b6a4d98979e79ec4d
Summary: Sha1 computation show up in many profilers, we can skip this step entirely if we are using metadata from hg.
Reviewed By: xavierd
Differential Revision: D32396312
fbshipit-source-id: 928f8458a91bba4d18da6730d3fc244eb5499489
Summary:
This diff allows eden to fetch blob metadata from hg cache.
Combined with previous diffs in stack, it allows to entirely skip scs metadata import, saving whole additional network round trip for operations like ls -lr or parsing buck files.
This diff adds hg:use-aux-metadata config that controls this behaviour.
When config is set, we instruct hg backing store to fetch file aux metadata along with get tree request.
Later when blob metadata is requested we are checking hg cache to get the metadata.
For trees that were imported prior to this config we fallback to reading scs metadata cache.
In terms of performance effect, this diff reduces traffic on laptops during listing/stating files significantly, because x2p client sends significant amount of extra data.
It does not improve end to end speed significantly though, because scs queries run in parallel with tree request.
Before
```
ls -lR fbsource.eden/fbcode/admarket 0.97s user 8.02s system 3% cpu 4:47.42 total
Traffic usage: 77Mb 25Mb down, 52Mb up
```
After
```
ls -lR fbsource.eden/fbcode/admarket 0.98s user 8.19s system 3% cpu 4:33.65 total
Traffic usage: 40 Mb, 22Mb down, 18Mb up
```
On laptops with worse network this likely to improve speed too, because some networks have much lower uplink latency
Additionally, this allows to efficiently use metadata on windows (where previously entire blob needed to be downloaded in order to calculate blob size)
Reviewed By: xavierd
Differential Revision: D32371710
fbshipit-source-id: 8ac962ea0136bc3bc4e30d0bf31692e65c35c43f
Summary:
When unwrapping Try it is convenient to be able to build an ImmediateFuture
directly from the .exception() call.
Reviewed By: chadaustin
Differential Revision: D32333774
fbshipit-source-id: 0066ca7eddc4a57010f60974c234b57691b73d77
Summary:
For some reason, in some cases the compiler wants to use the folly::collectAll
function instead of the ImmediateFuture one. Adding the namespace solves this
issue.
Reviewed By: chadaustin
Differential Revision: D32329807
fbshipit-source-id: 22ee9b20cf33e5718c9bb0270dd93f3f857b0967
Summary:
In every test setup, writing a file to the repository will always call `hg add`
in order to this newly added file to be added in subsequent `hg commit`. Since
`hg add` can be very expensive (in particular on Windows), some tests are
spending most of their time calling `hg add` instead of running the body of the
test. As an easy way to avoid this, let's stage the added files in memory
first, and then call `hg add` once just before `hg commit`.
Reviewed By: genevievehelsel
Differential Revision: D32333775
fbshipit-source-id: 8cc6cfad7ec73f6f0c50d7d1e6affa6cdd828e2f
Summary:
This reduces disk flushes, and is more efficient.
The main motivation is to avoid a situation where each added commit becomes
part of `visibleheads`. For example, drawdag:
C
|
B
|
A
would previously have visibleheads change from `A` to `B` to `C`, but now
`visibleheads` is only `C` without having the `B` or `A` state.
Reviewed By: singhsrb
Differential Revision: D32436069
fbshipit-source-id: 30274b1158c5eb796bc24101dc892c334c0f0287
Summary:
The new sparse profile config logic was triggering during an Eden code
path, where sparse doesn't exist. This caused a crash. Let's check for sparse
before trigging the path.
This only occured if there was another exception during checkout.
Reviewed By: quark-zju
Differential Revision: D32436881
fbshipit-source-id: 6d5da888e4f8a62a05a390c7e87bbc3061356fc2
Summary: The hg runlog causes every hg command to write out a runlog file (and create the runlog directory if it doesn't exist). If hg is run as root this can cause permission issues for subsequent hg commands. To mitigate this issue, the runlog feature now disables itself on unix platforms if the process's effective user id is 0 and the .hg directory is _not_ owned by root. The presumption is that if .hg is owned by root then it is normal for hg commands to be run as root.
Reviewed By: quark-zju
Differential Revision: D32368400
fbshipit-source-id: e6cbeb37e28a414a705b7a4eb350e87e34f6faf5
Summary: Due to hard-to-predict permission issues, creating the runlog directory or writing the runlog files can fail. The runlog is not essential, so runlog failures should not abort hg commands.
Reviewed By: DurhamG
Differential Revision: D32368401
fbshipit-source-id: 6a95150c49deffb26ef11c0690ceedce6d02286e
Summary: This is driven by eden config because other eden behavior depends on it (see next diff)
Reviewed By: quark-zju
Differential Revision: D32371709
fbshipit-source-id: de921283d3f44229909641f3bda00fe43a0822cb
Summary:
When file store is configured to store aux metadata, we also want to fetch child metadata when reading trees.
This only takes effect if store_aux_metadata is enabled(disabled by default).
Reviewed By: quark-zju
Differential Revision: D32371712
fbshipit-source-id: 4ad380946ecfa59a4999f4ea951228fe7c84525d
Summary: backingstore will be requesting tree child file aux data via TreeStore, and in the future TreeStore should check for locally available file aux data first, and write fetched file aux data to cache.
Reviewed By: quark-zju
Differential Revision: D31986375
fbshipit-source-id: b12657a15665704a8e46c4128b6330aec0b9cb47
Summary: In the future, TreeStore will need to access FileStore to read locally cached aux data and write remotely fetched aux data to cache.
Reviewed By: quark-zju
Differential Revision: D31986341
fbshipit-source-id: 4042a641e314cc192bcca31e674942bf548774f5
Summary:
I was rolling out edenapi uploads and realised they jumped up quicker than I expected. I went to take a look, and it turns out a lot of our migrations are happening incorrectly. Not that much, though.
When generating the config, we generate a shard (a 0-99 number), and use that number for all sharding operations: percentage rollouts, timed rollouts, and group decision. The problem is it means those three migrations are always correlated.
This diff fixes that by using independent shard numbers for percentage migrations and time migrations.
Reviewed By: DurhamG
Differential Revision: D32434107
fbshipit-source-id: e5a44969aab421b9c430999c633d58f5ba19191a
Summary: Add a test before I change behaviour
Reviewed By: HarveyHunt
Differential Revision: D32387113
fbshipit-source-id: 049eaeed5146ea09e1444f48e9e85a91b5f30356
Summary:
Previously it raised
``` raise TTransportException(
type=TTransportException.NOT_OPEN, message="eden not running"
)
```
even if it wasn't thrift and it wasn't eden.
Now it will raise OSError (as regular sockets do), and translate it to TTransportException if it's used as a thrift socket
Reviewed By: DurhamG
Differential Revision: D32171878
fbshipit-source-id: 290368acf8def5aec812abc88c23a946e7a0f1f4
Summary:
Doing 'node in repo' can result in very slow performance now that we're
using lazychangelog. Let's add a develwarn so we can be more aware of where
we're hitting this.
This only shows up for our team.
Reviewed By: quark-zju
Differential Revision: D32403828
fbshipit-source-id: 16e1633de68679d485d243dcb9dd402c52d5a7cb