Commit Graph

55543 Commits

Author SHA1 Message Date
Jun Wu
8029cd3878 minibytes: port benchmark from tokio/bytes
Summary:
Performance looks okay comparing with tokio/bytes v0.5.4:

minibytes:

  test clone_arc_vec        ... bench:      16,542 ns/iter (+/- 1,524)
  test clone_shared         ... bench:      16,211 ns/iter (+/- 596)
  test clone_static         ... bench:       1,437 ns/iter (+/- 502)
  test deref_shared         ... bench:         367 ns/iter (+/- 101)
  test deref_static         ... bench:         366 ns/iter (+/- 1)
  test deref_unique         ... bench:         367 ns/iter (+/- 4)
  test from_long_slicd      ... bench:          91 ns/iter (+/- 18) = 1406 MB/s
  test slice_empty          ... bench:      10,382 ns/iter (+/- 104)
  test slice_short_from_arc ... bench:      23,823 ns/iter (+/- 1,411)

tokio/bytes:

  test clone_arc_vec        ... bench:      16,213 ns/iter (+/- 1,864)
  test clone_shared         ... bench:      18,685 ns/iter (+/- 634)
  test clone_static         ... bench:       3,983 ns/iter (+/- 163)
  test deref_shared         ... bench:         366 ns/iter (+/- 26)
  test deref_static         ... bench:         373 ns/iter (+/- 36)
  test deref_unique         ... bench:         391 ns/iter (+/- 33)
  test from_long_slice      ... bench:          67 ns/iter (+/- 7) = 1910 MB/s
  test slice_empty          ... bench:      15,149 ns/iter (+/- 1,708)
  test slice_short_from_arc ... bench:      36,541 ns/iter (+/- 3,485)

clone_static is faster because minibytes don't call into vtable's clone.
from_long_slice is slower because minibytes uses Arc unconditionally while bytes
can avoid Arc overhead if refcount is 1.

Reviewed By: DurhamG

Differential Revision: D19770857

fbshipit-source-id: 5bafcc57a38c68baccfcafd3906f1a47b2bf4530
2020-02-07 14:21:39 -08:00
Jun Wu
108f1c947a minibytes: minimalist zero-copy Bytes with mmap support
Summary:
This crate provides the core features of the commonly known `Bytes` crate:
zero-copy slicing and cloning, while also supports mmap-backed buffers.

The main motivation is to replace `Mmap` in `indexedlog`. That has multiple
benefits:
- Handles 0-sized mmap more cleanly.
- Handles clones more cleanly.
- Gain the flexibility to zero-copy data without lifetime / reference.
- Gain the flexibility to switch to non-mmap data.

The `bytes::Bytes` crate does not yet support mmap buffers as of its latest
release (0.5.4).

Implementation wise, `minibytes::Bytes` uses `Option<Arc<dyn Trait>>` for the
"trait object". This makes implementing the mmap storage just one line.
`bytes 0.5.4` re-invents the "trait object" manually using unsafe code. It requires
about 50 lines to implement the mmap storage (in D19756122).

Reviewed By: xavierd

Differential Revision: D19770856

fbshipit-source-id: 8cfa7052a18ac2e0cd6348b77d5e2a4acc61195c
2020-02-07 14:21:38 -08:00
Durham Goode
8902d630b2 tracing: upload stack traces and link it to our main data
Summary:
Our main data table has no information about the actual failure. Let's
upload a stack trace to blob storage and link to it from the main table.

Reviewed By: quark-zju

Differential Revision: D19780653

fbshipit-source-id: acaab29a47d32dd6ab81fed0c3ae50c8eb44b760
2020-02-07 14:04:38 -08:00
Durham Goode
6e338a97d4 remotefilelog: recreate cache process after fork
Summary:
If the main process forks, the connection to the cache client is likely
unusable. Let's drop that connection and we can recreate it later if needed.

Reviewed By: quark-zju

Differential Revision: D19796387

fbshipit-source-id: 59b0d3db9655d2233b55effcdf18cbd74a3f5edd
2020-02-07 13:20:30 -08:00
Xavier Deguillard
87bd36fb46 eden: use third-party/rust for the vendored crates
Summary: All the crates are present in third-party/rust, let's use it in the OSS build instead of fetching a tarball of all the crates.

Reviewed By: fanzeyi

Differential Revision: D19770783

fbshipit-source-id: f0d74bb0807be207d599d4868f907d38099c7f5b
2020-02-07 13:10:52 -08:00
svcscm
f82802673f Updating submodules
Summary:
GitHub commits:

4ccb4c1e70
6f1a96a41e
f361cedf06
3c4349e5d2
7ea1444663

Reviewed By: yns88

fbshipit-source-id: acd16dddbbf68005392e2bc7795df22685774c2e
2020-02-07 12:52:37 -08:00
Durham Goode
f77ea84dda tests: update sparse tests
Summary:
D19776181 added more details, which breaks the tests. Let's update the
tests

Reviewed By: quark-zju

Differential Revision: D19795728

fbshipit-source-id: 80f6a47da1dd12c5d092d1f6e798a6c43eb02311
2020-02-07 12:45:29 -08:00
Durham Goode
dc9da8ef2e connectionpool: throw away the connection pool after forking
Summary:
We're seeing an error where worker processes fail to fetch data from
the server. Our theory is that the forking messes up the ssh connection, so
let's not reuse ssh connections across forks.

Reviewed By: xavierd

Differential Revision: D19794281

fbshipit-source-id: 3954cd96617fd18ecf0d0aa9b9a6ce774c494067
2020-02-07 11:45:57 -08:00
Jun Wu
3a8e77f15e run-tests: add --debug support for Python tests
Summary:
In D19581174 I made `--debug` trigger ipdb session for `.t` tests.
This diff adds similar feature for `.py` tests.

Reviewed By: DurhamG

Differential Revision: D19784795

fbshipit-source-id: 9118c74ea465320f15aa6ad5e1e04d8bc1a49966
2020-02-07 11:03:45 -08:00
Kostia Balytskyi
746cfcff24 commit_validation: validate topological order of synced commits
Summary:
Currently existing validation won't catch a bug where commits `a <- b` get
replayed as `b <- a` as long as they don't touch the same files. Let's add
such check.

Reviewed By: StanislavGlebik

Differential Revision: D19723150

fbshipit-source-id: ddc15063b9ae4fc38416ab9b96681da302fec8d4
2020-02-07 10:55:25 -08:00
svcscm
2fac725860 Updating submodules
Summary:
GitHub commits:

45de0b89c8
d4df500d88
ab1f5052ce

Reviewed By: yns88

fbshipit-source-id: 1607e1d4db95e686e6ec470228ea3667e59644ea
2020-02-07 10:55:25 -08:00
svcscm
d50bbaced2 Updating submodules
Summary:
GitHub commits:

124f7524e7

Reviewed By: yns88

fbshipit-source-id: f6c5a0d3a098ceac824889ba881ef62b6822c55d
2020-02-07 09:06:30 -08:00
Genevieve Helsel
9262283d1f diff documentation
Summary: after reviewing my stack D18647089 , chadaustin recommended some documentation surrounding this area since it is a bit more complex now, and since it was easy to deadlock and there are a lot of moving parts, I added documentation about how the diff path works, including the new code path, and other non-trivial parts.

Reviewed By: chadaustin

Differential Revision: D19688435

fbshipit-source-id: f6512340421e7c25d4fb4d27177c6187eb57ccbf
2020-02-07 07:49:35 -08:00
Harvey Hunt
6a0522aefa mononoke: Add a multiplex ID to blobstore configuration
Summary:
In order to uniquely identify a blobstore multiplexer configuration,
add an ID.

Reviewed By: krallin

Differential Revision: D19770058

fbshipit-source-id: 8e09d5531d1d27b337cf62a6126f88ce15de341b
2020-02-07 07:46:10 -08:00
Genevieve Helsel
0a2fd56bba py3 blame
Summary: plain hg blame for non-binary files

Reviewed By: quark-zju

Differential Revision: D19676073

fbshipit-source-id: 203b0421c6279ea1ca6bb6e253e7952e64b5edeb
2020-02-07 03:19:41 -08:00
Genevieve Helsel
4acc40424c hex printing on revlog match failure
Summary: fixes printing for no match found in revlog match

Reviewed By: quark-zju

Differential Revision: D19652374

fbshipit-source-id: 55bfcbff7919ad817173241e2792df27311b931e
2020-02-07 03:17:06 -08:00
Stanislau Hlebik
ea8bed30a8 mononoke: add new safe sync_commit() method
Summary:
Follow up from D19718839 - let's add a function that will safely sync a commit
from one repo to another. Other function to sync a commit are prefixed with
unsafe

Reviewed By: krallin

Differential Revision: D19769762

fbshipit-source-id: 844da3e2c1cc39ef3cd86d282d275d860be55f44
2020-02-07 01:57:50 -08:00
Thomas Orozco
41216b7530 mononoke/fastreplay: handle JSON-encoded strings in command args
Summary:
If we e.g. a getpack for path like "foo\"bar", then we can't decode it into a
`&str` because we need to allocate a new `String` to hold it. At the same time,
if the path is "foo bar", then having a reference into the JSON we received is
nicer.

Right now, we expect a `&str`, so the latter case. But, if we find command args
from the first case, we can't deserialize them. To fix this, let's use
`Cow<...>`, which lets us either have a referenced or an owned string.

Also, let's add tests to confirm this works.

Reviewed By: ikostia

Differential Revision: D19767689

fbshipit-source-id: bf9e06d4a885638073c819a25a68810ff44f2546
2020-02-07 01:26:19 -08:00
svcscm
f40726c12f Updating submodules
Summary:
GitHub commits:

93232f9556

Reviewed By: yns88

fbshipit-source-id: 8d56edc4e99f2ac5d65942a0495478815c41218b
2020-02-07 01:26:18 -08:00
svcscm
2e131ec5a8 Updating submodules
Summary:
GitHub commits:

4121390031
fdd24faa6c
94471e632b
0a24425afd
8b79c69b6c
99f3917826
3853cef0ba
5db0cb90fc
714edbb20f
880ade1420

Reviewed By: yns88

fbshipit-source-id: a63558a8df40c936d8959287f815835502b6cbd9
2020-02-06 20:51:51 -08:00
Xavier Deguillard
c8c0d9dd03 use third-party vendored Rust crates
Summary:
Instead of fetching a tarball for the vendored Rust crates, let's just use
what's present in third-party/rust.

Reviewed By: wez, fanzeyi

Differential Revision: D19770580

fbshipit-source-id: ca6615a5f5c672d9a5527ad47feab6bdd33a39db
2020-02-06 17:04:18 -08:00
svcscm
157dcf1601 Updating submodules
Summary:
GitHub commits:

4f6a2d4edf

Reviewed By: yns88

fbshipit-source-id: 5f075328153ff06bb5cac8a8f9298b8c05321ebe
2020-02-06 16:11:28 -08:00
Jun Wu
787cebfe91 context: print more details on fctx.data() key error
Summary:
Print out the name of the commit and the stack.
Hopefully this can help making debugging KeyErrors easier.

Reviewed By: DurhamG

Differential Revision: D19776181

fbshipit-source-id: 2eb985dd5355732a4d7728af68eb16173c48caa5
2020-02-06 15:56:26 -08:00
Jun Wu
69aa37f23b tracing: limit column width on ASCII output
Summary: This makes the output more readable even if the "name" of a span is very long.

Reviewed By: DurhamG

Differential Revision: D19780536

fbshipit-source-id: dce0d3777409c32b0752db51341a572addb823ea
2020-02-06 15:46:53 -08:00
svcscm
e7f7e557c0 Updating submodules
Summary:
GitHub commits:

fb08a4ea5d

Reviewed By: yns88

fbshipit-source-id: 6303adaebe0b362e7163afba81b177387d08cb19
2020-02-06 15:04:56 -08:00
Durham Goode
309a3a0592 py3: fix commitcloud lock output
Summary:
The use of json meant the progress step was coming out as unicode when
it should be str. Use the mercurial.json functions to solve this for python 2
and 3.

Reviewed By: xavierd

Differential Revision: D19777255

fbshipit-source-id: 15c8e45425fc8742b6e118249104fc1fb2f3345d
2020-02-06 13:23:21 -08:00
Thomas Orozco
d39eea991b blobrepo: don't fetch Hg Changeset IDs sequentially
Summary:
Fetching things from MySQL sequentially in a buffered fashion is a bad
practice, since we might end up saturating the underlying MySQL pool, and
starving other MySQL  clients.

Instead, let's make fewer, bigger queries.

Reviewed By: ahornby

Differential Revision: D19766787

fbshipit-source-id: 1cf9102eaca8cc1ab55b7b85039ca99627a86b71
2020-02-06 12:11:22 -08:00
Thomas Orozco
ce8b9a0fbe getbundle_response: don't fetch Hg Changeset IDs sequentially
Summary:
Fetching things from MySQL sequentially in a buffered fashion is a bad
practice, since we might end up saturating the underlying MySQL pool with a lot
of requests. Doing so will result in other queries being delayed as they wait
behind our batch of queries, which results in higher dispatch latency.

Instead, let's make fewer, bigger queries. Also, while we're in here, let's
update blobrepo to have an up-to-date comment.

Reviewed By: StanislavGlebik

Differential Revision: D19766788

fbshipit-source-id: 318ec4778ca259b210d431fc2add8b327bfce99a
2020-02-06 12:11:21 -08:00
Thomas Orozco
4874c1b7ab mononoke/fastreplay: set MultiplexBlob sampling rate
Summary: We don't need to log so many blob fetches. Let's not.

Reviewed By: HarveyHunt

Differential Revision: D19766017

fbshipit-source-id: 674dee276234f96938a9459af18dd78d09243350
2020-02-06 12:08:43 -08:00
Thomas Orozco
8d2b2f7af2 mononoke/multiplexedblob: make sampling rate configurable
Summary: This will let us lower Scuba utilization from Fastreplay.

Reviewed By: HarveyHunt

Differential Revision: D19766018

fbshipit-source-id: 4eac19b929914db910ed13096b2a5910c134ed3a
2020-02-06 12:08:43 -08:00
svcscm
c992310114 Updating submodules
Summary:
GitHub commits:

f7574673f1
c6f75516b7

Reviewed By: yns88

fbshipit-source-id: c12ec532434d3f4ec3cadd3326180829a625ad9b
2020-02-06 12:08:43 -08:00
svcscm
e498a4ec41 Updating submodules
Summary:
GitHub commits:

f7f2fdc4fd
ed5cfa9336
9a71f68742
ff5d797f27
a2191b9201
ada24d47d5
f33bb45488
9fd77cab60
72b18a4d01
f06a4e64df

Reviewed By: yns88

fbshipit-source-id: 4222bf64c57ac88c29c0d6424cade5af09c1da3f
2020-02-06 09:45:55 -08:00
Mark Thomas
8a829d6f01 scs_server: remove compat around Mononoke::new
Reviewed By: farnz

Differential Revision: D19770416

fbshipit-source-id: 2943d922d0b49a553b410d73c6b520c83f58c35e
2020-02-06 09:14:05 -08:00
svcscm
f12979d14f Updating submodules
Summary:
GitHub commits:

85beed9d76
28b442e2bb
cd1394ac0c
72f4c754b3
43e00ee0fe
c5cd609831
2274daef4b
8db93a6481
ce2eed8817

Reviewed By: yns88

fbshipit-source-id: cfefb06849436b26fe6e82a1cab44d6a64916364
2020-02-06 08:33:59 -08:00
Mark Thomas
060eefff74 mononoke_api: requests for blame information for rejected blames are a request error
Summary:
If the user requests blame information for a file where the blame was rejected
(either becuase the file is too big, or because it is binary), this should be
considered a request error.

Reviewed By: farnz

Differential Revision: D19768261

fbshipit-source-id: 7f0d7ba53fe1087b68f4432ec0c6de0353dc3885
2020-02-06 08:33:59 -08:00
Lukas Piatkowski
e9434f13d2 mononoke: remove the getdeps manifest
Summary: Mononoke is becoming part of Eden repository, remove it's getdeps manifest until we finalize the move.

Reviewed By: krallin

Differential Revision: D19769090

fbshipit-source-id: 9b471686728e9ff28317f9157f5f8a1834c5f5e4
2020-02-06 08:00:16 -08:00
Stanislau Hlebik
688a7aeb35 mononoke: remove compat() methods
Summary: They are not used much - let's use new futures instead

Reviewed By: krallin

Differential Revision: D19767952

fbshipit-source-id: c04bcf5efc6f8ee6f1d31254fcb2cb4603769b91
2020-02-06 08:00:16 -08:00
Liubov Dmitrieva
8228f84a60 Short hashes lookup: implement suggestions the same way as in Mercurial.
Summary:
Suggestions come in the error message as it is currently implemented in
Mercurial code. Format of suggestions also stays the same.

We give the hash, time, author and the title.

All suggestions are ordered (most recent go first).

We don't show them if there are two many.

Reviewed By: krallin

Differential Revision: D19732053

fbshipit-source-id: b94154cbc5a4f440a0053fc3fac2bca2ae0b7119
2020-02-06 07:43:51 -08:00
Stanislau Hlebik
af2f50d644 mononoke: add x_repo_lookup to scsc
Summary:
Useful for debugging.

I also fixed how we open a SqlSyncedCommitMapping, because we used incorrect path for that.

Reviewed By: ikostia

Differential Revision: D19767148

fbshipit-source-id: baf67bceceb7b22429b05b41020cf4350e3c87bd
2020-02-06 07:26:14 -08:00
Stanislau Hlebik
c8a4ba5dac mononoke: commit sync thrift api
Summary:
This is the api that will be used by Sandcastle to remap a commit from one repo
to another.
Previously the implementation api was just looking in the commit mapping table,
but that's not enough - draft commit cloud commits are not in this table, so we
actually need to sync them.

There's a caveat though - we allow syncing public commits from a large repo to
a small repo, but not the other way around. Comment in the code has more info
about it.

Reviewed By: ikostia

Differential Revision: D19718839

fbshipit-source-id: 9939530f818fafd22bc3838b4647dd9cbc1c8c07
2020-02-06 07:26:14 -08:00
Stanislau Hlebik
c97ceda175 mononoke: update IncompleteFilenodes to make transition to FilenodesOnlyPublic
Summary:
Jump from "generating filenodes while generating hg changeset" to "generate
filenodes separately" is tricky to do without breaking production. This diff
adds additional logic in IncompleteFilenodes that should make this transition
smoother. See code comment for more details.

Reviewed By: krallin

Differential Revision: D19741913

fbshipit-source-id: 48987c15fc4144c50afcee7ae34072f6cd634271
2020-02-06 07:26:14 -08:00
svcscm
446ddecbee Updating submodules
Summary:
GitHub commits:

c0f5b5641a
c0bc59ce27
b277fa9b52

Reviewed By: yns88

fbshipit-source-id: 23f6d643ff137aa8edeff216fbea7056a15f6667
2020-02-06 07:26:13 -08:00
Lukasz Piatkowski
415bab4e4b Merge mononoke sources into the eden repository
fbshipit-source-id: 43a0252cb3ec42aa365f20d1b6faa4d24d74c9b8
2020-02-06 14:01:58 +01:00
Lukasz Piatkowski
e8d62b64d5 mononoke: move the codebase under eden/ directory
fbshipit-source-id: 43a0252cb3ec42aa365f20d1b6faa4d24d74c9b8
2020-02-06 13:46:04 +01:00
svcscm
a5805a3c91 Updating submodules
Summary:
GitHub commits:

ebe3e4957c
dd971ef075
0fdfe016e4
7b2574ea2c
04caeb8d7e
65a6c9bfe2

Reviewed By: yns88

fbshipit-source-id: 43a0252cb3ec42aa365f20d1b6faa4d24d74c9b8
2020-02-05 21:02:38 -08:00
Xavier Deguillard
3c41bd2a92 build: use vendored crate from third-party
Summary:
Now that the source of truth for third-party crates is in fbsource, let's use
it in our cargo build system. This removes the need to fetch a tarball and
untar it, which should have the benefit of speeding up the build.

A small caveat is the first build on EdenFS will be slightly slower, due to
crates needing to be individually fetched, subsequent builds will be faster.

Reviewed By: jsgf

Differential Revision: D19726217

fbshipit-source-id: 24f484d1e3118a76e052f07ff3eea0c66cccce96
2020-02-05 17:49:06 -08:00
svcscm
9e83ee5b18 Updating submodules
Summary:
GitHub commits:

2f2a8c75cd
1808c0d0af
b69b747125

Reviewed By: yns88

fbshipit-source-id: dced59284387966a1fb088be0bb84fc8facc39aa
2020-02-05 16:21:22 -08:00
Chad Austin
4e1f60fc24 log checkout type and fetch counts to scuba
Summary: In addition to duration and success, log object fetch counts and checkout type to Scuba.

Reviewed By: fanzeyi

Differential Revision: D19334276

fbshipit-source-id: dabf52427f2ebda2b58df93194df39d52f4fcb4f
2020-02-05 16:05:30 -08:00
Chad Austin
cb1c0b45f3 log fetch statistics after checkout
Summary: Log the number of object lookups and cache hit rates for a checkout operation.

Reviewed By: simpkins

Differential Revision: D19191201

fbshipit-source-id: 5e9ad501e704810f072dabcda3fce86d027c452e
2020-02-05 16:05:30 -08:00
Chad Austin
58f352b807 count fetch statistics during diff and checkout
Summary:
During checkout and stats, count every object fetch and which level of
cache it was served from.

Reviewed By: simpkins

Differential Revision: D19186333

fbshipit-source-id: fc0a74db297b9c723682e245996a7befd762f933
2020-02-05 16:05:29 -08:00