Commit Graph

33 Commits

Author SHA1 Message Date
Lukas Piatkowski
813375d66a blobimport: add tracing and uploading traces on every blobimport run
Reviewed By: StanislavGlebik

Differential Revision: D13464745

fbshipit-source-id: 3e2ca21e70089c88a8c510cec1de2f20054a444b
2019-01-08 11:03:32 -08:00
Lukas Piatkowski
5d9a151d85 mononoke: pass CoreContext down to blobstore
Reviewed By: jsgf

Differential Revision: D13324220

fbshipit-source-id: af7a2a650338ea66e504ea0acae1d103af10f8e3
2018-12-04 11:40:15 -08:00
Lukas Piatkowski
08db0a35eb mononoke: pass CoreContext down to bonsai-hg-mapping
Reviewed By: aslpavel

Differential Revision: D13277450

fbshipit-source-id: 97cfbd917b321727bb4d960c91a784787660eb5b
2018-11-30 10:14:22 -08:00
Stanislau Hlebik
ab1c7572cd mononoke: do not panic in blobimport
Summary:
Panic is useless here. It produces huge stack trace which just contains the
main function and makes it harder to debug the actual problem.

Let's just exit in case of errors.

Reviewed By: farnz

Differential Revision: D12912198

fbshipit-source-id: 1faeacfb96765ce047a801f6b072112f10b50b7b
2018-11-03 06:16:53 -07:00
Tim Fox
debd4a5f95 Integrate hooks into mononoke write path
Summary: Integrate hook manager into the Mononoke pushrebase path

Reviewed By: lukaspiatkowski

Differential Revision: D9896005

fbshipit-source-id: ffd79b539288d95b134af97b776b7fcc3afa0ce7
2018-10-02 07:07:16 -07:00
Rain ⁣
2203a158e1 cmdlib: switch from BlobRepo to MononokeRepo
Summary: This is more general, and allows one to call `RepoClient` methods.

Reviewed By: farnz

Differential Revision: D9318658

fbshipit-source-id: 09b2e64bc0d423eafcb381902e03f349fc666a41
2018-08-15 23:36:19 -07:00
Simon Farnsworth
53a9245288 Add mechanism to configure cachelib process size shrinker
Summary:
We'll be running in Tupperware, and want to shrink when we get too
large to avoid OOM due to caches. Configure cachelib appropriately

Reviewed By: StanislavGlebik

Differential Revision: D8900371

fbshipit-source-id: 4f1f64c2508c64e4ce2d201e0a0e86446f84ffef
2018-08-07 11:37:37 -07:00
Rain ⁣
6f65d1778f make the default style for most cli tools glog
Summary:
I don't like glog for interactive use at all. But keep it as the
default for blobimport, and add a flag to change it.

Reviewed By: StanislavGlebik

Differential Revision: D8909674

fbshipit-source-id: d0b9c439f72f231c95e9109e16b30e87cfaa2eed
2018-07-20 11:37:36 -07:00
Lukas Piatkowski
339975884c blobimport: extract importing part of this command to a reusable library
Summary: later this library will be used by admin tool to ease importing of config repo

Reviewed By: StanislavGlebik

Differential Revision: D8882178

fbshipit-source-id: 293a26b038f8d76e9fcedb72a4041a48f502a00a
2018-07-19 04:08:34 -07:00
Siddharth Agarwal
2fbdf6d207 move blobimport code into a subdirectory
Summary: Will factor this out into several files in upcoming patches.

Reviewed By: StanislavGlebik

Differential Revision: D6094811

fbshipit-source-id: cd354888882aff2552e61dea788aeb5426e08f4d
2017-10-19 09:39:17 -07:00
Stanislau Hlebik
553343bc0d mononoke: filter the same manifest entries in blobimporting
Summary:
There is no need to insert the same entries twice. Let's filter them.
Note that while it's possible to have the same manifest entries (for example,
file or dirs with the same content), all changeset entries should be unique,
because each changeset in the repo is unique and is processed exactly once.

Reviewed By: farnz

Differential Revision: D6076667

fbshipit-source-id: 64bdf25a21884eb2faf43f32590f7cbb8f8dd300
2017-10-18 01:36:22 -07:00
Stanislau Hlebik
13823f0f7e mononoke: add separate io thread to blobimport
Summary:
Let's move all IO to the separate thread. This helps quite a lot when used with
slow blostore, because parser threads are not blocked on IO -
importing upstream mercurial repo went from 20 mins to 9 mins.

Reviewed By: lukaspiatkowski

Differential Revision: D6050992

fbshipit-source-id: c3877b123bad993d819495247135544a141eab10
2017-10-18 01:36:22 -07:00
Arun Kulshreshtha
be57d5440b Change default Manifold bucket to mononoke_prod in blobimport
Summary: Change the default bucket for blobimport to be mononoke_prod, a higher capacity bucket than the previous mononoke bucket. Also make it possible to specify the bucket via the CLI rather than hardcoding it.

Reviewed By: jsgf

Differential Revision: D6073745

fbshipit-source-id: 11dcf0c8bbef0b7c3f5971cf0676cf6325f276a6
2017-10-17 00:36:28 -07:00
Stanislau Hlebik
024650d13d mononoke: fix blobimporting warnings
Reviewed By: kulshrax

Differential Revision: D5995891

fbshipit-source-id: d8e396da8689cc1d07856a21e0f023a83e222877
2017-10-12 04:07:45 -07:00
Lukas Piatkowski
0a76eb6f45 blobimport: add optional thrift service and stats counters
Reviewed By: farnz

Differential Revision: D6030720

fbshipit-source-id: 26971f13061e9a3a1e65d339fc7bdc444b5165fd
2017-10-11 10:58:08 -07:00
Lukas Piatkowski
a3579ee80d blobimport: add more descriptive error messages on manifold failure
Reviewed By: kulshrax

Differential Revision: D6022078

fbshipit-source-id: 4504524cb49dbd9b013ac44229107be5024dfcad
2017-10-11 05:50:50 -07:00
Lukas Piatkowski
565afd9615 blobimport: use drain from slog-glog-fmt for logging
Summary: the glog drain does not swallow f.e. backtrace of error_chain errors, so it is a bit easier to debug the tool

Reviewed By: farnz

Differential Revision: D6021671

fbshipit-source-id: 32bfe01bfd77d85c37a2a446cb3e5d000763c689
2017-10-11 05:50:46 -07:00
Siddharth Agarwal
db28a15305 add deny(warnings)/allow(deprecated) to a few crates
Summary:
Realized that we were missing a few crates from the Tokio cleanup because those crates
didn't have `#![deny(warnings)]`.

This also caused a bunch of files to be rustfmted, which is fine.

Reviewed By: kulshrax

Differential Revision: D6024628

fbshipit-source-id: 55032d20f3676c92ef124d861e1edcd34126ab55
2017-10-10 15:23:25 -07:00
Stanislau Hlebik
c474b57a9e blobimport: add an option to postpone compaction
Summary: Compaction can slow down blobimporting a lot. Let's add an option to postpone it till the end

Reviewed By: farnz

Differential Revision: D5882003

fbshipit-source-id: 0611a8e94b3d7331bdacf909d820526f547414a0
2017-09-22 08:33:25 -07:00
Siddharth Agarwal
de4b1f6c93 use BlobHash in RawNodeBlob
Summary: Also ensure that `blobimport` doesn't use its own copy.

Reviewed By: jsgf

Differential Revision: D5847604

fbshipit-source-id: 5390848cd5fab8abd967ef9701720491d703c0f1
2017-09-18 00:35:52 -07:00
Jeremy Fitzhardinge
2f72747e85 mononoke: blobimport: more use of impl Future
Summary:
This seemed to run up against a compiler issue
(https://users.rust-lang.org/t/impl-future-lost-fact-that-a-closure-is-fnonce/12870/16)
that can be worked around by adding an apparently unnecessary `.boxed()`.

Reviewed By: sid0

Differential Revision: D5843292

fbshipit-source-id: 0a82760bf6afbf7ba5f04541ca57bedcc935d411
2017-09-15 15:58:33 -07:00
Jeremy Fitzhardinge
8f701222aa mononoke: blobimport: first use of impl Future
Summary: Use `impl Future` rather than a boxed future.

Reviewed By: sid0

Differential Revision: D5829773

fbshipit-source-id: 40c4339e96f7194544f416534952b78a23d93fa6
2017-09-15 15:24:05 -07:00
Jeremy Fitzhardinge
d584bc31b3 mononoke: blobimport: rustfmt
Reviewed By: sid0

Differential Revision: D5831880

fbshipit-source-id: 9d9d7b18214241336e97219c48bf281dd08b5ab9
2017-09-15 15:24:05 -07:00
Arun Kulshreshtha
c9d8af3f1c Add ManifoldBlob support to blobimport
Summary: Add the `--blobstore manifold` option to blobimport to make it write blobs to Manifold.

Reviewed By: jsgf

Differential Revision: D5758930

fbshipit-source-id: a14a3c155b5d8d7b171ed7a4e53f8569539cb2e9
2017-09-05 13:38:47 -07:00
Jeremy Fitzhardinge
0745e97bfe mononoke: don't use : in blob key names
Summary:
`:` is a reserved character for Windows paths, so Mercurial rejects
them from being committed. Use `-` instead, so that we can commit file blob
repo test fixtures.

Reviewed By: kulshrax

Differential Revision: D5731525

fbshipit-source-id: 8d14fc03f1b135cbc4d42aeaf2f3a0ae6d13f956
2017-09-04 15:20:06 -07:00
Siddharth Agarwal
c1a30e25c9 make repo error types require std::error::Error
Summary: This gets us `Display` support as well.

Reviewed By: lukaspiatkowski

Differential Revision: D5734383

fbshipit-source-id: 1485cf80bb310cdd282b4546bed56c60082be8ec
2017-08-31 13:51:24 -07:00
Siddharth Agarwal
8202a344b4 rustfmt mercurial-types and blobimport
Summary: Just a few minor changes that make our lives easier overall.

Reviewed By: lukaspiatkowski

Differential Revision: D5737854

fbshipit-source-id: da951d7872433bffa8fc64d15cd0e917f77144b5
2017-08-31 13:51:24 -07:00
Stanislau Hlebik
dbd845ba0e mononoke blobimport: split work between threads by linkrev
Summary:
We want to avoid putting the same entries twice in the blobstore. And even more - we want to avoid generating list of these entries at all in the first place.

The first approach was to add a `Mutex<HashSet>` that worker threads will use to filter out entries that were already imported. Turned out that this Mutex kills almost all the speedup from concurrency.
But since we have linkrevs then for each entry we know in which commit this entry was created [1]. That means that all of the entries are already nicely split between the threads. So no synchronization is needed.

It gives a good speedup - from ~7min to 2min of importing of hg upstream treemanifest repo using file blobstore.

Note: there is still a lock contention - tree revlogs and file revlogs maps are protected by mutex. We can optimize it later if needed.

[1] There is a well-known linkrev issue in mercurial. It shouldn't affect our case at all.

Reviewed By: jsgf

Differential Revision: D5650074

fbshipit-source-id: c4f9e2763127ffe4402417dd3963f1f450d7b325
2017-08-23 05:13:50 -07:00
Stanislau Hlebik
747e4a2ed9 mononoke: rustfmt on blobimport
Reviewed By: sid0

Differential Revision: D5649665

fbshipit-source-id: 553ef550e7465ab5f3bb129cf4d0c282128fa24d
2017-08-23 05:13:50 -07:00
Stanislau Hlebik
b72949e3d1 mononoke: blob importing of tree manifest repo
Summary: Main part is `get_stream_of_manifest_entries` that creates a stream of all tree manifest entries by recursively going through all of them.

Reviewed By: jsgf

Differential Revision: D5622490

fbshipit-source-id: 4a8b2707df0300a37931c465bafb1ed54d6d4d25
2017-08-18 09:51:17 -07:00
Stanislau Hlebik
c33e4afddf mononoke: same storage keys for manifest entries as for the file entries
Summary:
A preparation step before blob importing of tree manifest repos to blobrepo.

`get_parents()` method of BlobEntry reads parents from the blobstore. It works fine for file entries because file entries can stores its parents in the blobstore. With tree manifests BlobEntry can contain also tree manifest entries, and that means that tree manifest entries parents should also be stored somewhere in the blobstore.

I suggest to use the same logic for the tree manifest entries as for the file entries. File and manifest entries have two blobstore entries - one stores hash of the content and parents, another stores the actual content.

To do this I moved `RawNodeBlob` and `get_node()` to the separate module and made fields public.

Reviewed By: jsgf

Differential Revision: D5622342

fbshipit-source-id: c9f0c446107d4697b042544ff8b37a159064f061
2017-08-15 10:37:34 -07:00
Stanislau Hlebik
91d587e052 mononoke: change Path implementation
Summary:
Instead of storing `Vec<u8>`, let's store `Vec<PathComponent>`, where PathComponent is Vec<u8> without b'\'.
To make sure len() is still `O(1)` let's store it too.

Reviewed By: sid0

Differential Revision: D5573721

fbshipit-source-id: 91967809284d79bf0fcdcabcae9fd787a37c318b
2017-08-10 05:24:42 -07:00
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00