Commit Graph

56448 Commits

Author SHA1 Message Date
Thomas Orozco
52380d76a5 connection pool: log remote path
Summary:
We currently log the server we talk to, which is very nice in order to
benchmark performance of Mononoke vs. hg.

Unfortunately, while this allows for breaking down the samples, it's a little
hard to identify the right samples to break down! Historically, we've
approximated this by looking at the client's hostname, but this isn't always
ideal.

Reviewed By: quark-zju

Differential Revision: D20369686

fbshipit-source-id: 785c67fde09e7b7fc4c30121d14f0bc26e92a355
2020-03-11 02:18:06 -07:00
svcscm
1c6867cbbb Updating submodules
Summary:
GitHub commits:

483ed864d6

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: a09c395d3166a693dd0b103d0671394ad0d8c8b2
2020-03-11 01:48:32 -07:00
Xavier Deguillard
99bb41e1f9 pyworker: remove one closure indirection
Summary:
No need for a closure when the function that will be called takes the same
arguments.

Reviewed By: quark-zju

Differential Revision: D20367309

fbshipit-source-id: 986299c4b691330bf17164abd70f3b49ed5263f8
2020-03-11 01:13:56 -07:00
Xavier Deguillard
1276e1c695 pyworker: ignore remove errors on Windows
Summary:
In some situations Windows may be unable to remove a file and Mercurial
cannot do anything about it. Instead of raising an error, just ignore it.

In the Python code, errors are ignored in multiple layers, but ultimately
batchremove ignore all OSError errors and just prints a warning about it. A
future diff will build a side channel for errors/warnings reporting, this will
be used to properly report this.

Reviewed By: quark-zju

Differential Revision: D20284803

fbshipit-source-id: 7df80f9e27e720ce819fb4116ea996fca390ad76
2020-03-11 01:13:55 -07:00
Xavier Deguillard
d1bcb3e604 pyworker: add a basic PathAuditor
Summary:
For now it only checks for symlinks outside of the repo, but can be extended to
check for more.

Caching is used to prevent syscalls to already checked directories, this cache
is intended to be done per-thread, and thus each directory may be checked a
maximum of N, with N being the number of threads. This is deemed reasonable for
now.

Things that the Python pathauditor does that this one doesn't:
 - Case checking for Windows,
 - Verifies no writes to .hg,
 - Windows shortnames aliases,

Reviewed By: quark-zju

Differential Revision: D20265276

fbshipit-source-id: 8e29bedadcaa6df2515e394894ab9e1dd5a9e9a7
2020-03-11 01:13:55 -07:00
Xavier Deguillard
d15b04d438 pyworker: handle symlinks and executable
Summary:
Symlinks are treated a bit differently from plain files, what is stored in the
ContentStore is the destination of the symlink, not it's content (well, the
content of a symlink really is it's destination).

For now, only unix platforms support symlinks, in reality this should be a
filesystem property as writing to ntfs-3g should have the same behavior as on
Windows.

For executable, we just need to mark the file as executable after writing to
it.

Reviewed By: quark-zju

Differential Revision: D20250943

fbshipit-source-id: 022dabc750125df32953a151df7da60db69b2cec
2020-03-11 01:13:55 -07:00
Xavier Deguillard
40bbe7b4da merge: add a Rust threaded file updater
Summary:
During `hg update`, Mercurial forks multiple processes to write files on disk
concurrently, this is done as fetching blobs from the content store, and
writing them to disk is CPU bound. Usually, threads would be the preferred way
of speeding up such process, but unfortunately, Python has GIL that severely
limit the available concurrency. So, multiple processes were chosen.

Unfortunately, the multi-process solution also brings a lot of other issues,
more recently, we've had cases where the connections to the server and memcache
had to be dropped after the fork. In some other cases, this caused deadlocks.
And the solution is not effective on Windows.

Now that Mercurial is getting more and more Rust, we could instead go back to
the threads solution by using them in Rust, and have Python just push work to
them, this is exactly what this change does.

Things that are left to be done, but I wanted to get a diff out first:
 - no file path audit
 - no file backup
 - no symlink creation
 - probably other things I'm missing

Reviewed By: quark-zju

Differential Revision: D20102888

fbshipit-source-id: d47829fd7818b97710586b9851880f178048e27b
2020-03-11 01:13:54 -07:00
svcscm
da8944bf30 Updating submodules
Summary:
GitHub commits:

c880089962
bacdfd1f4f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 820ef8ac513271d04eef7bfd15ab46f2fd2ee831
2020-03-11 01:13:54 -07:00
svcscm
eb8ed5fb0b Updating submodules
Summary:
GitHub commits:

64dcdcc09c
b75f1e05e6
f5bc3b99d5
fa5949606b
83ff522cbb

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: fa68c8ea043fc2c797690e6f9a8f9e16c97a9015
2020-03-10 19:58:09 -07:00
Xavier Deguillard
185bc0f437 revisionstore: add an LfsMultiplexer store
Summary:
With this new store, blobs will be transparently written to either an LFS
store, or a non-LFS one, depending on their size.

Initially, and as long as getpackv2 is supported, we also need to support
parsing lfs pointer data that the server is sending and write these to the lfs
pointer store. This code is very adhoc and does manual parsing of the pointer
data, definitively not great, suggestion for a simple and better solution is
welcome :).

From a migration standpoint, the read-only LFS stores are added to the
ContentStore, this allows blobs written in it to be readable at all time even
when `remotefilelog.lfs` isn't set. The code will effecitvely be dormant for a
while until the option is turned on, if we need to disable it, the dormant code
will still be able to read all the blobs written to disk. This forces us to
deploy a release that contains this code to stable first, before setting
`remotefilelog.lfs`.

Reviewed By: quark-zju

Differential Revision: D19986878

fbshipit-source-id: 260f5a542d52e748c0c703bfa7bb8ffac0e7b388
2020-03-10 18:14:54 -07:00
svcscm
6fdea23e19 Updating submodules
Summary:
GitHub commits:

7c9de27715

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: ff5d23106e81aa4b2c2475011720bd388dd3ab1f
2020-03-10 18:14:54 -07:00
svcscm
492502e8b1 Updating submodules
Summary:
GitHub commits:

64cb4f6dcf
c96fb864cd
4028eba67b

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 520257a93ace59289d3376ef8eeca663b985a69f
2020-03-10 15:27:24 -07:00
Jun Wu
5f84fc8222 indexedlog: use dev-logger
Summary: This makes `RUST_LOG` work for indexedlog tests.

Reviewed By: xavierd

Differential Revision: D20286515

fbshipit-source-id: ff4a1476eb01a9067dabe3622fd598f65fe86a18
2020-03-10 14:16:39 -07:00
Jun Wu
7a12c33163 dev-logger: a simple library to enable env_logger for testing
Summary:
The tracing / env_logger integration works for hg as a binary. However I'd also
like to use it in library tests. This crate makes it easier to do so.

Reviewed By: xavierd

Differential Revision: D20286507

fbshipit-source-id: f5bf3288ce950591ddfe64b524ad51ce21ee4099
2020-03-10 14:16:38 -07:00
Jun Wu
cf72dc45f5 indexedlog: add some tracing information
Summary: Those has helped me debugging some issues.

Reviewed By: xavierd

Differential Revision: D20286513

fbshipit-source-id: 012ddb16c2d0efd8f8697a5ecd4564ea31d65630
2020-03-10 14:16:38 -07:00
Jun Wu
e7ed737a64 hgcommands: make env_logger show exit code
Summary: Move the scope of spans so the exit code is shown.

Reviewed By: xavierd

Differential Revision: D20286516

fbshipit-source-id: f39cbf60c86ea19a1bb0a09958748f04ff6a42e8
2020-03-10 14:16:37 -07:00
Jun Wu
bb9023c2cb hgcommands: move env_logger initialization to hgcommands
Summary:
Previously env_logger is only initialized if Python is initialized.
This diff makes env_logger initialized for Rust native commands.

Reviewed By: xavierd

Differential Revision: D20286517

fbshipit-source-id: 18fee96c2b41db1da9648d615d1e18809de90a63
2020-03-10 14:16:37 -07:00
Jun Wu
97d0a976fd tracing: make it write to the log eco-system
Summary:
This means crates like env_logger (which reads $RUST_LOG, and writes to stderr)
can be used for convenient debugging.

Reviewed By: xavierd

Differential Revision: D20286514

fbshipit-source-id: e3b80cc4830ba5cc6dbf7aa1cbb92a4f4f046a54
2020-03-10 14:16:37 -07:00
Jun Wu
796f199130 tracing: save static metadata from tracing to Spans
Summary:
Those metadata include module_path, target, line number, etc, in Rust native
format.  They will be used for the upcoming `log` integration.

Reviewed By: xavierd

Differential Revision: D20286510

fbshipit-source-id: 27019b941bef08c0bb3e505bbdae642282dcb141
2020-03-10 14:16:36 -07:00
svcscm
fe31812df1 Updating submodules
Summary:
GitHub commits:

b0ffcec765
c96a152592
d68af7f993
b5ef0bf95f
84fcbbed8b
c0af46f684
21862146c3
d943a40a76
568e560ce4

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 9f0947940d9921ee5933a6dfd995ed0558eb0e2f
2020-03-10 14:16:36 -07:00
svcscm
e808dda251 Updating submodules
Summary:
GitHub commits:

bb08f1e5b7
73ce58933c
4d35cf43e6
2501c25aae
29833c8b93
2b54f9ae0f
43ed86c0d8
99e2a71716
c5f8fd7d44
63e9b70ce6
08f424b204

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 2c8364b789db4232aba8542c33ae9b5aec5525b1
2020-03-10 12:56:02 -07:00
Puneet Kaushik
9fad6af978 Cleaning up second definitions of dtype_t
Summary: Missed cleaning up the other definition in D19956272.

Reviewed By: chadaustin

Differential Revision: D20199689

fbshipit-source-id: 9a00cb7b640f71edc034632e354fb61112a74bc1
2020-03-10 12:27:51 -07:00
Puneet Kaushik
ef671b4e4e Add BlobCache to Windows EdenMount
Reviewed By: simpkins

Differential Revision: D19956271

fbshipit-source-id: d5a88ea8570421a1c61900fbad8a0f9d3e311458
2020-03-10 12:27:50 -07:00
Puneet Kaushik
db5d20b303 Move Windows EdenMount and RepoConfig to fs/inodes/win
Summary: Moving these two files to integrate them better with rest of the Inodes code.

Reviewed By: simpkins

Differential Revision: D19956267

fbshipit-source-id: 5bf8165a6dc70a0c03f71f3f73b383991f21eb56
2020-03-10 12:27:50 -07:00
Puneet Kaushik
aed430d676 Add mode_t size in DirEntry
Summary: Windows sdk doesn't define mode_t. On Windows we use mode to store the file type info which should fix in 16 bits - S_FMT is defined as 0xf000.

Reviewed By: simpkins

Differential Revision: D19956270

fbshipit-source-id: 81acd2cd708f1c82674b8b75cd607d4f5b41a156
2020-03-10 12:27:50 -07:00
Stanislau Hlebik
0f6a8e259f mononoke: log reponame to derived data scuba table
Reviewed By: HarveyHunt

Differential Revision: D20363458

fbshipit-source-id: b52f0051b8b00fc601d00686bc732585317403bc
2020-03-10 11:42:31 -07:00
Lee Howes
f15fdeec84 collectX to collectUnsafe
Summary:
Migration from Future-returning executor-erasing collectX forms to
SemiFuture-returning forms, that are less risky in particular with coroutines.

Earlier diffs added SemiFuture and Unsafe versions. This codemod migrates
collect versions to the Unsafe versions to allow the basic collect versions to
be made safe.

Reviewed By: simpkins

Differential Revision: D20331206

fbshipit-source-id: efc8dff487d45f7d53ee55e8c4696bd3eed0e6da
2020-03-10 11:36:09 -07:00
Victor Zverovich
639073cdd0 Make errnoStr return std::string instead of fbstring
Summary:
The result of `errnoStr` is often converted to `std::string` so returning `fbstring` adds an extra copy. Make it return `std::string` instead. This will also allow removing dependency between `String.h` and `FBString.h`.

(Note: this ignores all push blocking failures!)

Reviewed By: yfeldblum

Differential Revision: D20195395

fbshipit-source-id: 0dc65f1566911156be3fcb715dd105c58f2a8822
2020-03-10 10:50:44 -07:00
Wez Furlong
ce2a78988c getdeps: use c:/open/scratch if available on windows
Summary:
Ideally we'd be using mkscratch, but this still isn't shipped
to our Windows systems.

Pick a path that is more friendly to our corp windows environment by default.

Reviewed By: pkaush

Differential Revision: D20342277

fbshipit-source-id: c85bccee6701adc03b26c92ba217b18bd684257a
2020-03-10 10:44:47 -07:00
svcscm
d5391315c3 Updating submodules
Summary:
GitHub commits:

64b2e3eb76

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: b7b647e242542613fc334976ab2bbd3536e11abf
2020-03-10 10:08:14 -07:00
Aida Getoeva
3e510491cc scs/history: don't buffer stream if there is no need
Summary:
Time filters for file history require fetching changeset or changeset info to decide whether to include the commit into response. To speed up the process instead of sequential mapping, I buffer the map stream in batches of 100.
However it is unfortunate to fetch additional 100 history changesets if there is no time filters and only several commits were requested. Keeping also in mind that the most of the requests don't care about time.
Avoiding that would speed up the history generation,

I changed the changeset_path API so now it just returns the stream of changeset contexts. And commit_path API for history if there is no time filters collects everything to vector, otherwise applies them and also collects to vector. Then this vector is converted into response using FuturesOrdered.

Reviewed By: StanislavGlebik

Differential Revision: D20287497

fbshipit-source-id: 0c6b1315eccddb48f67bf5fa732bdf7c9a54a489
2020-03-10 10:03:05 -07:00
Genevieve Helsel
bbd450be88 cli logging set -> list for JsonTelemetryLogger
Summary: "tags" are stored as sets, but must be serialized as lists in python. This only affects the `ExternalTelemetryLogger`, which is used on mac builds.

Reviewed By: simpkins

Differential Revision: D20351645

fbshipit-source-id: b097bd6aeb6d109323186f4ae4ef959f831ead2b
2020-03-10 09:57:03 -07:00
Stanislau Hlebik
4241ca0272 mononoke: add repo name in BlobRepo
Summary:
A lot of callsites want to know repo name. Currently they need to pass it from
the place where repo was initialized, and that's quite awkward, and in some
places even impossible (i.e. in derived data, where I want to log reponame).

This diff adds reponame in BlobRepo

Reviewed By: krallin

Differential Revision: D20363065

fbshipit-source-id: 5e2eb611fb9d58f8f78638574fdcb32234e5ca0d
2020-03-10 08:32:33 -07:00
Stanislau Hlebik
a7f67cb698 mononoke: remove in_memory_writes* method
Summary: DangerousOverride trait is better

Reviewed By: krallin

Differential Revision: D20362886

fbshipit-source-id: f083936bce60faa0c60ccd4672704fc642b68234
2020-03-10 07:51:28 -07:00
Thomas Orozco
6f5c623899 mononoke/repo_listener: track request success / failure in ODS
Summary:
We track this in Scuba right now (and alarm on it), but tracking it in ODS will
make it easier to incorporate in our canary and post-release health check
workflow.

Reviewed By: StanislavGlebik

Differential Revision: D20361803

fbshipit-source-id: 99fb514d41f9cda42c3c9a82f3b8d6681285430a
2020-03-10 06:25:11 -07:00
Mateusz Kwapich
9fd7f0d2b4 improve the check for conflicts during insert
Summary:
Before we assumed that if the rows_affected length doesn't match the number of
entries we were trying to insert we have a conflict. Let's verify if we really
have conflict or we're trying to insert the same entry twice.

Reviewed By: krallin

Differential Revision: D20343219

fbshipit-source-id: 19e032439fdd65f5fe1afe1a10b401bc2fe33462
2020-03-10 05:47:05 -07:00
Mateusz Kwapich
e1bf77097f test showing the blobimport problem.
Summary: Running blobimport twice on the same commit seems to cause problems.

Reviewed By: krallin

Differential Revision: D20343218

fbshipit-source-id: 4d572630e7c15c219bee8db15cc879b2cb8602fe
2020-03-10 05:47:05 -07:00
Mark Thomas
9fc8716e85 debugnetwork: show how long it took to query server master bookmark
Summary:
It might be useful to know how long the end-to-end wireproto command to find
the master bookmark took, so log that.

Reviewed By: quark-zju

Differential Revision: D20344686

fbshipit-source-id: 8459a378a0c828a929eee5f9ffd34875a5b8d3cc
2020-03-10 05:36:23 -07:00
Mark Thomas
ed4d2ae9aa debugnetwork: allow multiple tests within a connection to aid warmup
Summary:
For high latency connections we will need to warm up the connection before
starting the download or upload test.  Facilitate this by making it possible to
run multiple tests within the same connection.

This changes the protocol for the speed-test command to be line-oriented commands.

Reviewed By: farnz

Differential Revision: D20344687

fbshipit-source-id: 1d2a815736caf974ed1aaaaf365b86343d41fe02
2020-03-10 05:36:23 -07:00
Alex Hornby
b8ca854c0b mononoke: walker: add ability to walk all published bookmarks
Summary: Add ability to walk all published bookmarks as there may be multiple important bookmarks

Reviewed By: krallin

Differential Revision: D20249806

fbshipit-source-id: aff2ee1ec7d51a9e4fb6e1e803612abd207fd6cb
2020-03-10 05:26:35 -07:00
svcscm
599c306bb4 Updating submodules
Summary:
GitHub commits:

18b7169371
9592e383f0

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: a0f854d57c72041b1a36cb013f98ff363b525a2a
2020-03-10 01:57:21 -07:00
Lukas Piatkowski
6365fa6509 rust-shed: add no-op memcache_stub implementation to the shed
Reviewed By: mitrandir77

Differential Revision: D20304739

fbshipit-source-id: bd2956619f6a5cf1551bccb921780e7a542e9859
2020-03-10 01:07:46 -07:00
svcscm
5ad6b33507 Updating submodules
Summary:
GitHub commits:

59dd5b0320
abfc5012c1
fd1da22111

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 62e5c3cd06da8e4386fb4dfdd6f8670cad164201
2020-03-10 01:07:45 -07:00
svcscm
15fe8cf76e Updating submodules
Summary:
GitHub commits:

054e5f786a
a821ceb8d2
78c05afed9

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 34811d3c9c92c715064f53c7237f091a85191b13
2020-03-09 18:00:21 -07:00
Adam Simpkins
e1490e631c add a counter to report the number of mount failures during startup
Summary:
Add a counter to report the number of mounts that we failed to remount during
startup.  Mount failures do not prevent EdenFS startup from proceeding.  It is
useful to have a metric to report if these errors did occur even though the
start-up as a whole still proceeded otherwise.

Reviewed By: chadaustin

Differential Revision: D20319512

fbshipit-source-id: fd503a1ccc91b476cc9dc2bc6323501bbbeaf2c5
2020-03-09 17:41:34 -07:00
svcscm
238af176cb Updating submodules
Summary:
GitHub commits:

8fdcdbbfff
99586de4c3
7f7ea0ec78
9cea11f2bd

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 2080f7bdc89657f224043a4ce9d463d7af567309
2020-03-09 17:14:54 -07:00
Aida Getoeva
84c0aa9e8c mononoke: allow to derive changeset info
Summary: This also replaces RepoBlobstore with generic Blobstore.

Reviewed By: krallin

Differential Revision: D20336107

fbshipit-source-id: 4e09430d462053d5ccb0b2f0eca7a9d0417b4b5e
2020-03-09 16:41:53 -07:00
svcscm
467ed05ec3 Updating submodules
Summary:
GitHub commits:

a720c96853
676f71d026
8fb9292b67
c86b3ed7f8
60e60ff18e

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d56e2bb54874d95f2c775a8b5b0fac31bbbc0cdd
2020-03-09 15:35:47 -07:00
Jun Wu
fc911f4c3f sampling: make sure output JSON strings are valid utf-8
Summary:
On Python 2 the Mercurial JSON can be binary, which can break the telemetry
logger. Ensure the JSON string is valid utf-8 (although it might still be
invalid JSON).

Reviewed By: xavierd

Differential Revision: D20343845

fbshipit-source-id: 61e99e742bddf23c7fd5354a5754d79a0a452c28
2020-03-09 14:24:29 -07:00
svcscm
6e88af8391 Updating submodules
Summary:
GitHub commits:

93392c1af5

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: a486961285e94875a11dc6ee05749e0e9bf6927c
2020-03-09 12:59:39 -07:00