Commit Graph

64355 Commits

Author SHA1 Message Date
svcscm
34f9f145cf Updating submodules
Summary:
GitHub commits:

eaf50223c3
71d8f5350e
71ed22f5e4
2ff2165608
8146e7910a
cda8791261
96205baa63
e2778d8a45
be574b06d6
dcf16bec59
0e51fda45b
9d75cdf3a6
b2996f337c
917d5dd5eb
c565348fdc
7ae34103b9

Reviewed By: wittgenst

fbshipit-source-id: 49cfa65accdab7f94922ed42733c39604f9ec995
2021-04-05 20:30:14 -07:00
Jun Wu
2118b02db2 reset: avoid using %s for rev number
Summary:
This crashes with `ui.ignorerevnum=1`.

Rev number should use `%d`. Or use node and `%n`. `%s` is not the right way.

Reviewed By: kulshrax

Differential Revision: D27527470

fbshipit-source-id: 115385d8bb8dd006fcbf62dee1099b8f9d5262c7
2021-04-05 16:22:05 -07:00
Durham Goode
6d9f0b1f06 clone: make resumable checkout optional
Summary:
Since we're rolling out native checkout and resumable checkout around
the same time, let's make resumable checkout optional so we can turn it off it
causes issues, without turning off native checkout.

Reviewed By: quark-zju

Differential Revision: D27481986

fbshipit-source-id: a0a3e68567ca2a468e852dce95c03c4b606aaf22
2021-04-05 15:35:08 -07:00
Jun Wu
f6e9c4db96 edenapi: re-export edenapi_types
Summary: This makes it easier to use.

Reviewed By: kulshrax

Differential Revision: D27406589

fbshipit-source-id: 11bef407ab620859381c6ee952e6ef00494551e1
2021-04-05 12:55:41 -07:00
Jun Wu
6cba98986a dag: fix path response with batch_size >= 2
Summary:
The issue is that `mut i: usize` is no longer shared across multiple `async
move` blocks (introduced by D27308798 (0df4efa969)).

Rewrite the logic to collect `ids` first, then use `vertex_name_batch`
query instead.

Reviewed By: sfilipco

Differential Revision: D27406586

fbshipit-source-id: b41fe3a13114dc34aa5763e6e2bebe0571decc87
2021-04-05 12:55:41 -07:00
Jun Wu
9342556e54 dag: merge adjacent x~n queries
Summary:
Merge paths like `x~n` and `x~(n+1)` to `x~n (batch_size = 2)`.
This could be more efficient bandwidth-wise and algorithm-wise.

Reviewed By: sfilipco

Differential Revision: D27406587

fbshipit-source-id: f2a67352ad627945685e33667e8299a2bc652930
2021-04-05 12:55:40 -07:00
Jun Wu
775899c0f2 dag: make protocol use IdSet instead of Vec<Id>
Summary: IdSet is more compact. This changes the order a bit.

Reviewed By: sfilipco

Differential Revision: D27339279

fbshipit-source-id: e9b50a47beba081b892eccd7711dbd6ab5c3a886
2021-04-05 12:55:40 -07:00
Jun Wu
c515d1f54f dag: show AnestorPath batch size in debug output
Summary: This will be used by the next change.

Reviewed By: sfilipco

Differential Revision: D27406591

fbshipit-source-id: fcacc35a9ae8ed96cebb2af804d26d1e5e83ad9e
2021-04-05 12:55:40 -07:00
Jun Wu
95ece1d6fe dag: add a way to flush the overlay map
Summary:
Add a way to flush the overlay map to disk so we can avoid network fetches over
and over.

Reviewed By: sfilipco

Differential Revision: D27406592

fbshipit-source-id: 7086ad665119cc3a0834f533690325c7a2363442
2021-04-05 12:55:40 -07:00
Jun Wu
dd042424f3 dag: move (x~n, name) -> (id, name) calculation to a function
Summary: It will be reused elsewhere.

Reviewed By: sfilipco

Differential Revision: D27406593

fbshipit-source-id: 296cf5f50830bb7285e0cb9c7c15a9b374689819
2021-04-05 12:55:40 -07:00
Jun Wu
5326b18c2b dag: track x~n paths in NameDag
Summary:
I spent some time thinking about how to flush the "overlay_map" to disk.
It is a bit tricky because the on-disk IdMap might have changed in an
incompatible way. I tried a few ways to verify the on-disk IdMap remains
compatible and didn't find a way that looks good (either slow - calculating
universal_ids, or is not 100% correct in corner cases).

Now I come up with this "just track x~n" idea. It trades memory usage (~2x
overlay_map) for easy-to-verify correctness, and efficient overlay_map
flush.

Reviewed By: sfilipco

Differential Revision: D27406583

fbshipit-source-id: 0b7fb3186a9c15f376c1dc4afe7f0516c25d3dec
2021-04-05 12:55:39 -07:00
Jun Wu
e6d231818d dag: add more comments about NameDag locking
Summary: It is not obvious. So let's add more comments.

Reviewed By: sfilipco

Differential Revision: D27406584

fbshipit-source-id: 9ce1215efc1a6d4849180c6693616613c08f2a51
2021-04-05 12:55:39 -07:00
Jun Wu
2b5f78d0ac dag: add a test about sparse dag
Summary:
A sparse dag does not have full IdMap. Its IdMap only contains "universally known" entries.

Add a basic test about cloning from a sparse clone data and resolve vertex <-> id mapping
on the fly.

Reviewed By: sfilipco

Differential Revision: D27352018

fbshipit-source-id: 4a3f5f50be52e91bf7b2021cdc858bcab9c99e80
2021-04-05 12:55:39 -07:00
Jun Wu
d5b5e1ea93 dag: make import_clone_data flush the dag directly
Summary:
The `NameDag::flush` API will actually rebuild the graph using a "parent" function.
That is not necessary if we got clone data, and won't work well for a lazy graph
(since the parent function talks about vertex names and some names are missing).

Let's bypass the `flush` function and write data directly in `import_clone_data`.

Reviewed By: sfilipco

Differential Revision: D27352019

fbshipit-source-id: a79569d25d858447b8c5eb86902b8d39ae0429a3
2021-04-05 12:55:39 -07:00
Jun Wu
cdbc0b9bb1 dag: add ways to use a NameDag as an implementation of the remote protocols
Summary: This will be used in tests.

Reviewed By: sfilipco

Differential Revision: D27343882

fbshipit-source-id: 5a2d94a9f755eed0fc27e5a11093b55c810dc8da
2021-04-05 12:55:39 -07:00
Jun Wu
13c9880eca dag: add logic to export clone data
Summary:
Implement logic to export the clone data. This allows us to construct a sparse/lazy
dag via export + import CloneData.

Reviewed By: sfilipco

Differential Revision: D27343885

fbshipit-source-id: 71dc0d31e36876a8b6a8c3d7f3498be3262ce297
2021-04-05 12:55:39 -07:00
Jun Wu
ec2c1a7928 dag: add verification importing clone data
Summary:
Clone data can only be imported to an empty Dag and universally known vertexes
should be present in the IdMap.

Reviewed By: sfilipco

Differential Revision: D27343888

fbshipit-source-id: ba150d6afdbe15f0902ec20ff150a70657e24c80
2021-04-05 12:55:39 -07:00
Jun Wu
429b0e1e15 dag: make import_clone_data async
Summary: It'll use some async functions.

Reviewed By: sfilipco

Differential Revision: D27406585

fbshipit-source-id: e757796f712a5f95f1227f88e797e43551039f0b
2021-04-05 12:55:38 -07:00
Jun Wu
fed4cdbe50 dag: implement Id prefetch for IdStatic set
Summary: Make IdStatic prefetch Id -> Names on iteration.

Reviewed By: sfilipco

Differential Revision: D27343886

fbshipit-source-id: 7957b574c8c14cfea476b9c42cbf9f11fefa39be
2021-04-05 12:55:38 -07:00
Jun Wu
8364f23186 dag: make IdConvert batch API on NameDag use less network requests
Summary: Collect "missing" items and only use one request to fetch them.

Reviewed By: sfilipco

Differential Revision: D27406588

fbshipit-source-id: a5cd091b39d90c1ad0e7c5d509673c4665232304
2021-04-05 12:55:38 -07:00
Jun Wu
55b0132518 dag: implement ExactSizeIterator on SpanSet
Summary: This allows something like `iter.rev().take(n).rev()`.

Reviewed By: sfilipco

Differential Revision: D27343887

fbshipit-source-id: 06c095eb448272dca6add0e707cdf38f0daee252
2021-04-05 12:55:38 -07:00
Jun Wu
0326d38c75 dag: add batch id <-> name API in IdConvert
Summary:
This will be used by upcoming changes. Sparse/Lazy NameSet will override it
to reduce network round-trips.

Reviewed By: sfilipco

Differential Revision: D27406590

fbshipit-source-id: a44a73b4aec6e14d6e82d55285fe1cfc0fcfd482
2021-04-05 12:51:38 -07:00
Jun Wu
7c8056ae38 dag: add APIs to test if Id or Vertex is present in IdMap locally
Summary: This will be used by upcoming changes.

Reviewed By: sfilipco

Differential Revision: D27343884

fbshipit-source-id: 0938b1fb3d90b35f9d51c468cffca53e3f421bb8
2021-04-05 12:51:38 -07:00
Jun Wu
47e1c97dc9 streams: drop mut from resolve_remote
Summary: The `mut` was unused. Remove it to make the interface more flexible.

Reviewed By: sfilipco

Differential Revision: D27406594

fbshipit-source-id: 1cfa4921015fc89b6c71ed4a97d9c351f56c7370
2021-04-05 12:51:37 -07:00
Jun Wu
0ff3c9109d dag: make NameDag::IdConvert resolve vertexes remotely
Summary:
Remove some TODOs. This serves as fallback paths where batch prefetch didn't happen.
I'd expect most use-cases will trigger IdStatic set's batch prefetch logic (to be
added).

I haven't decided what to do exactly with "contains". Fetching remotely there seems
to require some kind of negative cache (ex. in mutation records there might be nodes
not in the graph). But it _might_ be okay to say the "contains" is a local-only
operation, too. I leave it as-is and we'll see how the Python world uses "contains"
later.

Reviewed By: sfilipco

Differential Revision: D27339275

fbshipit-source-id: ba70b3c84a391a8e395c73ccd1d7e08f92b0cbd0
2021-04-05 12:51:37 -07:00
Jun Wu
b7c63d192d dag: add methods to resolve id <-> names remotely on NameDag
Summary:
Put everything together. I used "programming error" extensively to
provide more context if we have to investigate issues in the future.

Reviewed By: sfilipco

Differential Revision: D27339278

fbshipit-source-id: 574a2c048dc1d24dbe690f862fec3e5078cb067a
2021-04-05 12:51:37 -07:00
Jun Wu
8a381893db dag: improve error message in protocol
Summary: Provide more context about what invariants we expect. Not just show "vertex not found".

Reviewed By: sfilipco

Differential Revision: D27339273

fbshipit-source-id: 1c6c92537ff37666ff603783adfd8f9ea770fbaa
2021-04-05 12:51:37 -07:00
Jun Wu
c85c750baa dag: add a remote protocol field to NameDag
Summary:
Makes NameDag own the state (logic) about how to send remote requests.
So NameDag can send requests on its own.

Reviewed By: sfilipco

Differential Revision: D27339282

fbshipit-source-id: 3cb6327dfeaefae45d4e7b88a3535463a84b195b
2021-04-05 12:48:34 -07:00
Jun Wu
79b40c5ce8 dag: define remote protocol
Summary: Define a trait for implementing the remote protocol elsewhere.

Reviewed By: sfilipco

Differential Revision: D27339281

fbshipit-source-id: da5b316d98863507361d3bde4988fd6c9098f48c
2021-04-05 12:48:34 -07:00
Jun Wu
31ab817ba6 dag: make NameDag IdConvert consider overlay IdMap
Summary: This will make the overlay IdMap effective when query against the NameDag.

Reviewed By: sfilipco

Differential Revision: D27339276

fbshipit-source-id: 80712bf651beb6c7e9f23bd4233c6d916101696a
2021-04-05 12:48:34 -07:00
svcscm
a7cd5306e2 Updating submodules
Summary:
GitHub commits:

698edc0b01
7125536039
2241a6aac6
791ef9fb4c

Reviewed By: wittgenst

fbshipit-source-id: 337a798f6f33d715bd39d1935bcd6232f0192dc9
2021-04-05 11:42:11 -07:00
svcscm
45b358d6cf Updating submodules
Summary:
GitHub commits:

45b1dd1b52
35b22ec4ae
9c4cc5c239

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 0e094e41a37f58db39fd71d7897c9bece008ad4e
2021-04-05 11:42:11 -07:00
svcscm
f8bdee6367 Updating submodules
Summary:
GitHub commits:

1af19a96ce

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: b566b8acec8bc48a1e64c6f117efb13422eee7b2
2021-04-04 13:07:48 -07:00
svcscm
3b27461efa Updating submodules
Summary:
GitHub commits:

382f932c1d

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 0a8c139eb06a60c87845dfe1df6795514d76b195
2021-04-04 13:07:48 -07:00
svcscm
212b33621c Updating submodules
Summary:
GitHub commits:

03fa494f04

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: cb28f3a9be5789be42d98753e575db8a1a7c1ec1
2021-04-04 04:22:21 -07:00
svcscm
ca28a1fbc5 Updating submodules
Summary:
GitHub commits:

9855e3e7a8
3e38fd95b2
84005d6e62
1895941cad
bbb17b1b46
8394d5ed25

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 091c7997183469e0aca55188839b73aa26989a2d
2021-04-03 03:51:51 -07:00
Stiopa Koltsov
babc84bed6 Add sandcastle_instance_id column to scuba
Summary: To be able to quickly find all activity related to given Sandcastle job as discussed in [this workplace post](https://fb.workplace.com/groups/2120196508269853/permalink/2899040243718805).

Reviewed By: kmancini

Differential Revision: D27541803

fbshipit-source-id: a55900064bbee92da902de785ebe0c0e8738c3a2
2021-04-03 00:11:47 -07:00
Xavier Deguillard
5fae7d2ad5 merge: allow specifiying a number of threads of remove/writer phase
Summary:
When watchman is in use, removing tons of files very quickly leads to FSEvents
losing events, causing watchman to recrawl the entire repository. It's not
entirely clear today what the maximum number of threads to use is, let's make
it configurable.

Reviewed By: andll

Differential Revision: D27536577

fbshipit-source-id: 58f2bc453321fd4e7468d3324ee4df2b79b96d5d
2021-04-02 20:19:05 -07:00
svcscm
47ce40642a Updating submodules
Summary:
GitHub commits:

e5c551e493
33ef6c103d
0fccc6225e
8bdc42b0af
c1974b4ed7
55e0fa070e
7361fcbcfc

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 010d9a95c1340360cd9807d5e4a2a01628d6a5ab
2021-04-02 18:41:39 -07:00
Morgan Newman
5debd246b9 add --prefetch-metadata flag to prefetch command
Summary: As titled.

Reviewed By: kmancini

Differential Revision: D27519428

fbshipit-source-id: 00da2c8dc6647d87c935ee2db0bb11fe2f7f8103
2021-04-02 14:33:59 -07:00
svcscm
01af949ee8 Updating submodules
Summary:
GitHub commits:

3c9e54e61e
0a8487bd24

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 9fb34fade6b9a10f47ac2861084995bef0ba10d7
2021-04-02 13:00:50 -07:00
Durham Goode
82f39a44fb checkout: check HgId during resumable checkout
Summary:
We already checked size and mtime, which should allow us to identify if
a file has changed since the last update, but we need to check hgid as well, to
make sure the previously-written content is supposed to be the same as the
about-to-be-written content

Reviewed By: andll

Differential Revision: D26955401

fbshipit-source-id: 859ad35b008e68d699601217f2a4398c6789913e
2021-04-02 12:58:35 -07:00
Durham Goode
d596d1284a checkout: allow resuming an interrupted checkout
Summary:
Updates native checkout to store which files have already been written
in .hg/upgradeprogress. Then enables it to load that file and skip writing those
files if they're already on disk and their mtime and size match the previously
written values. In theory we could record and check file hashes as well, but
that'd likely slow things down quite a bit.

Future diffs will add:
- Recording and checking the hgid that was written before vs what is about to be
  written. Just an hgid comparison, not a full hash computation.
- Some UX to inform the user when hg checkout can be continued, and possibly to
  implement 'hg checkout --continue'.

Reviewed By: andll

Differential Revision: D26830249

fbshipit-source-id: 88a75080966dae5241550ed7eedbc057c65966dd
2021-04-02 12:58:35 -07:00
svcscm
0cc62a8698 Updating submodules
Summary:
GitHub commits:

06566b2280
db0244ad89
f10cbb51d8

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d53b68a1254395a8c9ff7c6c67f4444c106fc003
2021-04-02 11:55:47 -07:00
Stiopa Koltsov
ec1e6b5bea log session id on startup
Summary:
Currently eden on startup prints:

```
Starting edenfs (dev build), pid 190
Opening local RocksDB store...
Opened RocksDB store in 0.073 seconds.
Could not parse config.json file: couldn't read /var/twsvcscm/local/.eden/config.json: No such file or directory
Skipping remount step.
Started edenfs (pid 190)
Logs available at /var/twsvcscm/local/.eden/logs/edenfs.log
```

Would be convenient if it also printed session id, to be able to query scuba straight away.

Reviewed By: chadaustin

Differential Revision: D27522665

fbshipit-source-id: d7d4cf6c97bc551061761f2653375f208e393498
2021-04-02 11:36:13 -07:00
Stiopa Koltsov
afddf66676 Move getSessionId to a separate file
Summary: Refactoring to make the following diff smaller.

Reviewed By: chadaustin

Differential Revision: D27522581

fbshipit-source-id: 8f858714fcbfe4b8f8b1c3678bb2003623abbd94
2021-04-02 11:36:13 -07:00
svcscm
cbadf861cb Updating submodules
Summary:
GitHub commits:

b3f67e050d
9c0408d0b1

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: e86980c435611c030329059d30f828c2acb73f2d
2021-04-02 11:00:33 -07:00
Stiopa Koltsov
fe00ae209e Do not inherit stderr copy in scribe_cat
Summary:
Still trying to enable Scuba logging in ovrsource TD to figure out what caused Buck regression when we started working with multiple watchman instances.

Did not try previous fix of pgrp (deploying stuff on Sandcastle is not trivial), although now I'm not sure that pgrp was the issue. Hard to say.

But now I'm launching CI differently and observe different symptoms.

`eden start` command finishes in 30 seconds (according to logs), but Sandcastle waits for something for 10 minutes and then somebody kills `scribe_cat` and Sandcastle continues. I don't really know what that means, but there's another issue I discovered:

`scribe_cat` inherits a copy of stderr fs created during daemon startup.

This diff fixes the issue.

Reviewed By: kmancini

Differential Revision: D27494520

fbshipit-source-id: 069f4e9ea1efb553cf7a7f18e20ae92c27da808d
2021-04-02 09:57:16 -07:00
svcscm
37c39a3023 Updating submodules
Summary:
GitHub commits:

29c5905853

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: fc753d61e3487333410d1b3e0649b1dfcc5a819c
2021-04-02 09:57:16 -07:00
svcscm
0a4f4761fe Updating submodules
Summary:
GitHub commits:

916d7d93d4

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 73d8608afeca2339dfde2a5592909824c8d14ae7
2021-04-01 18:09:57 -07:00