Commit Graph

102 Commits

Author SHA1 Message Date
George-Catalin Tintareanu
687a916175 - CensoredBlob wrapper
Summary:
Wrapped Blobstore in a CensoredBlob, with the purpose of checking for
censored commits.

Reviewed By: StanislavGlebik

Differential Revision: D15432210

fbshipit-source-id: 7136196d6ac8e03faabe7c9568c47f77cfe6e801
2019-05-22 06:12:58 -07:00
George-Catalin Tintareanu
ad2c40fbb2 Censoredblob build
Summary: Added censoredblob to the build TARGETS file

Reviewed By: StanislavGlebik

Differential Revision: D15412608

fbshipit-source-id: 8db90fd0afa2bcb74eb35473de00951a3f91c7c3
2019-05-21 12:26:04 -07:00
George-Catalin Tintareanu
d76685495a Blobstore wrapper for blacklisting
Summary:
Implemented a no-op censoreblob struct. The functionality is to be
implemented

Reviewed By: farnz

Differential Revision: D15393101

fbshipit-source-id: 9b1989474d71029c5aa65521a07c0b474e48cfe3
2019-05-21 12:25:59 -07:00
Simon Farnsworth
cdbffabc56 rustfmt before I work on this file
Summary: `rustfmt` wants to reformat. Let it.

Reviewed By: StanislavGlebik

Differential Revision: D15353606

fbshipit-source-id: ac79274982c2c9a32288bcbc447dcc1966774144
2019-05-21 12:25:58 -07:00
Lukas Piatkowski
a7d5f76635 mononoke: using raw connection to xdb when myrouter_port is not provided
Summary:
In the case of mononoke's admin tool it's annoying for users to be required to run myrouter in the background and provide myrouter port to every command.
Thanks to this change it is no longer necessary to run admin commands through myrouter - the tool will simply use a direct connection to XDB using the sql crate.

It is important to note that the raw XDB connection via sql crate doesn't have connection pooling and doesn't handle XDB failover so it is crucial that it is never used for long-lived or request heavy use cases like running mononoke server or blobimport

Reviewed By: jsgf

Differential Revision: D15174538

fbshipit-source-id: 299d3d7941ae6aec31961149f926c2a4965ed970
2019-05-21 12:25:35 -07:00
Jeremy Fitzhardinge
89ae5651a4 rust/sql: add stats for connection creation and reuse
Reviewed By: StanislavGlebik

Differential Revision: D14988868

fbshipit-source-id: e64c4ab57726d1743d11312592ba06107fdb78f4
2019-05-21 12:25:15 -07:00
Pavel Aslanov
a257f82f7c remove some extern crates and #[macro_use]
Summary:
Convert to `2018` version and remove `#[macro_use]` and `extern crate` from following folders:
- blobrepo
- blobstore
- mercurial_types
- mononoke_types

Reviewed By: StanislavGlebik

Differential Revision: D14827294

fbshipit-source-id: 4b8a2edb5d9ad1fe75083e172cd0da359fa6dc2e
2019-05-21 12:25:03 -07:00
Jeremy Fitzhardinge
8638b2e5a4 mononoke/blobstore: add DisabledBlob
Summary:
Add a blobstore type which always returns an error for
administratively disabled blobstores.

Reviewed By: StanislavGlebik

Differential Revision: D14682588

fbshipit-source-id: 66d06a6066051371ad5fcd5934ac4824885d0237
2019-05-21 12:24:55 -07:00
Zeyi (Rice) Fan
cada677bc6 Update to Rust 1.33.0
Summary: Update Rust toolchain to 1.33.0 with fixes to make our code compatible with 1.33.0.

Reviewed By: Imxset21, kulshrax

Differential Revision: D14608312

fbshipit-source-id: 2d9cf7d01692abaed32f9adffa0e5eb51cfacb4f
2019-05-21 12:24:52 -07:00
Jeremy Fitzhardinge
f41493488b mononoke/rocksblob: remove spurious extern crates
Reviewed By: aslpavel

Differential Revision: D14542678

fbshipit-source-id: 543486451f079fabe8e469e810e9b40c1716c6eb
2019-03-25 12:34:36 -07:00
Jeremy Fitzhardinge
d76d128059 mononoke: move memblob and prefixblob out of the base blobstore crate
Summary: Slim down the blobstore trait crate as much as possible.

Reviewed By: aslpavel

Differential Revision: D14542675

fbshipit-source-id: faf09255f7fe2236a491742cd836226474f5967c
2019-03-25 12:34:36 -07:00
Jeremy Fitzhardinge
cb8bb26481 mononoke/glusterblob: use symlinks rather than relying on rename
Summary:
Apparently Gluster really can't copy with renames, so write to a
unique name, then symlink the canonical key to it. If the symlink already
exists, then we'll assume that the file already does, and remove the unique
name.

Reviewed By: StanislavGlebik

Differential Revision: D14014167

fbshipit-source-id: 1e5e2ce989652232d67d2aaac776e35127f58fb0
2019-03-11 14:02:28 -07:00
Jeremy Fitzhardinge
1e531b22bf mononoke/glusterblob: add more error context
Summary: Keep track of error causes so we can print better errors.

Reviewed By: StanislavGlebik

Differential Revision: D14014165

fbshipit-source-id: e9a7846256bbfbfd689e0d78f01b1ac50cf64c1b
2019-03-11 14:02:28 -07:00
Jeremy Fitzhardinge
9a63389c94 mononoke/glusterblob: use a shallower directory tree (FORMAT BREAKING)
Summary:
Reduce directory fan out levels to 2 wide ones (xxx/xxx) rather than 4 narrow
(xx/xx/xx/xx). This saves write latency cost: with 4 levels, until we get
~billions of blobs, every write will also be a mkdir, and we'll have many
single-entry directories. With 2 wide levels this will be true up to ~millions of
blobs, but then start to fill out the leaf directories.

The downside is that the leaf directory loading will be higher once we do have
billions of objects, but I think it will be managable.

This is NOT INTEROPERABLE with 4-level fanout, so invalidates existing stores.

Reviewed By: aslpavel

Differential Revision: D13923991

fbshipit-source-id: b93ddc49305c921f8a1b34606796b6d75273fb75
2019-03-11 14:02:28 -07:00
Jeremy Fitzhardinge
93d71fef7e mononoke/glusterblob: fix naming to conform to Gluster rsync hack
Summary:
Adding `.data` to the end breaks the "rsync hack" to keep files colocated on
the same node.

Reviewed By: aslpavel

Differential Revision: D14014284

fbshipit-source-id: c65b237ed03c9c8ea3a6ac239135820379b7e38d
2019-03-11 14:02:28 -07:00
Harvey Hunt
0d45b88515 mononoke: Allow a dynamic stat prefix for CountedBlobstore
Summary:
Previously, CountedBlobstore used many dynamic_timeseries in its
stats structure to allow for a dynamic key based upon blobstore name. Replace
this with a stats struct that allows a dynamic prefix. This simplfies the
stats code for CountedBlobstore and also allows for a String to be used
as a prefix.

Differential Revision: D14084622

fbshipit-source-id: 1c6bdbe63e5c4f6e9f0428c9b3cdfdbed475b877
2019-02-15 11:59:53 -08:00
Harvey Hunt
5cc798f120 mononoke: Add timeouts to blobstore get() and put() operations
Summary:
Add a timeout to the get() and put() operations so that we don't leave
connections to blobstores open for too long in the case of a pathological
blobstore that sends or receives data extremely slowly.

Reviewed By: StanislavGlebik

Differential Revision: D14022738

fbshipit-source-id: 5a6ea53bcdbffdf2befdc8f9912ec3f46b3dd466
2019-02-13 03:10:47 -08:00
Harvey Hunt
4ea3220954 mononoke: Log read requests for all blobstores
Summary:
Previously we didn't log any errors for reads as we were cancelling
outstanding futures for read requests as soon as one completed.

Modify this behaviour so that every time we decide to sample a request, we
allow all blobstore gets() to complete and record the data. As a result
of this, we will also record the errors.

Reviewed By: StanislavGlebik

Differential Revision: D14022739

fbshipit-source-id: 62b878a08b5c4f6a2ed9efe71b2f97cf66c58256
2019-02-12 04:18:14 -08:00
Harvey Hunt
591824ea9f mononoke: Sample multiplexed blobstore get() and put() logging to scuba
Summary:
We don't want to log too much, we're only interested in a general
trend (i.e. is this blobstore returning loads of errors) rather than specific
blobstore operations.

Only log 1/100 requests, although we can tweak this in the future if required.

Also, fix up a typo in an error message.

Reviewed By: StanislavGlebik

Differential Revision: D14022740

fbshipit-source-id: e62e97fb4e4dc551a3249318092ee55937e7b4e2
2019-02-12 04:18:14 -08:00
Pavel Aslanov
0acdeae02d populate healer queue cmd
Summary: Tool that is used to populate blobstore synchronization queue from manifold bucket

Reviewed By: StanislavGlebik

Differential Revision: D13880216

fbshipit-source-id: 6527e4f7027dc8ce8e73f9949e080e53eda1c541
2019-02-11 06:16:30 -08:00
Jeremy Fitzhardinge
ec2eb2e57c mononoke/glusterblob: add fanout over the whole cluster
Summary:
Rather than just talking to a single host, make connections to as many machines
as possible, and randomly fan out operations to them.

Reviewed By: lukaspiatkowski

Differential Revision: D13915510

fbshipit-source-id: fb8a8c2c0a0abaa9ba0a39d4702c0d81fbe590f6
2019-02-08 15:02:22 -08:00
Jeremy Fitzhardinge
42fc72cc54 mononoke: move BlobstoreBytes to blobstore crate
Summary:
This avoids making blobstore depend on mononoke-types, which itself
has complex dependencies.

Reviewed By: StanislavGlebik

Differential Revision: D13944481

fbshipit-source-id: ade338a03efee2107256a91f6b622df98246a11f
2019-02-05 15:21:15 -08:00
Jeremy Fitzhardinge
b4dc225420 mononoke: split complex stuff out of blobstore crate
Summary: Move complex things out of `blobstore` to thin out the dep graph. This didn't work as well as I'd hoped because `blobstore`->`mononoke-types`->`thrift`/`sql`.

Reviewed By: StanislavGlebik

Differential Revision: D13915511

fbshipit-source-id: c210dda23fa7102168c0ca14a035ed5c03a6993c
2019-02-05 15:21:15 -08:00
Jeremy Fitzhardinge
dc81a3bc8b mononoke/blobstore/...: convert to Rust 2018
Summary: Shiny!

Reviewed By: StanislavGlebik

Differential Revision: D13915506

fbshipit-source-id: c5b64a2831a4561a17e8290f4db9af7a40b4c208
2019-02-05 15:21:15 -08:00
Zeyi Fan
529a6dbddb fix rustc 1.32.0 warnings
Summary:
There are two warnings introduced because of the upgrade. Fixing in these.

```
warning: use of deprecated item 'failure::Error::cause': please use 'as_fail()' method instead
   --> tools/xar/clean_xar_mounts/src/main.rs:582:38
    |
582 |         writeln!(stderr, "{}, {}", e.cause(), e.backtrace()).expect(errmsg);
    |                                      ^^^^^
    |
    = note: #[warn(deprecated)] on by default

warning: the feature `int_to_from_bytes` has been stable since 1.32.0 and no longer requires an attribute to enable
 --> scm/mononoke/blobstore/glusterblob/src/lib.rs:8:12
  |
8 | #![feature(int_to_from_bytes)] // stable 1.32
  |            ^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(stable_features)] on by default
```

Differential Revision: D13951745

fbshipit-source-id: c86ca37d0a3344a4f8c492dd9d8703fe2a3e1647
2019-02-04 16:43:13 -08:00
Stanislau Hlebik
4d48415149 mononoke: split metaconfig crate
Summary:
Currently if a crate depends even on a single type from metaconfig then in
order to compile this trait buck first compiles metaconfig crate with all the
logic of parsing the configs.

This diff split metaconfig into two crates. The first one just holds the types for
"external consumption" by other crates. The second holds the parsing logic.

That makes builds faster

Reviewed By: jsgf, lukaspiatkowski

Differential Revision: D13877592

fbshipit-source-id: f353fb2d1737845bf1fa0de515ff8ef131020063
2019-01-31 00:41:48 -08:00
Jeremy Fitzhardinge
55c76466f3 mononoke: glusterblob: add super-simple round-trip test
Summary:
The test is ignored by default because it would probably be
flakey/slowThe test is ignored by default because it would probably be
flakey/slow.

Reviewed By: aslpavel

Differential Revision: D13795070

fbshipit-source-id: 8459d34126917e0fce3151ec2f4e68e639d2e7e6
2019-01-24 11:54:43 -08:00
Pavel Aslanov
8232ba03da added: tw_handle to logged scuba samples
Summary: Added tw_handle to be able to distinguish source of samples

Reviewed By: ikostia

Differential Revision: D13800968

fbshipit-source-id: 6c8528fc69302b2d5c5fbd40ccdf729c9379a101
2019-01-24 04:03:39 -08:00
Jeremy Fitzhardinge
23c154fcd4 mononoke: add stats to glusterblob
Summary: Simple stats for put/get/is_present so we can monitor basic functionality.

Reviewed By: StanislavGlebik

Differential Revision: D13736062

fbshipit-source-id: 1fd6def0d98d9d29dfbbf11430006b91936d35dc
2019-01-23 22:28:57 -08:00
Jeremy Fitzhardinge
91d83f2b19 mononoke: convert glusterblob to Rust 2018
Summary:
Use rustfix and some hand-editing to convert to Rust 2018 - main
benefit is the elimination of a lot of `extern crate` lines.

Reviewed By: HarveyHunt

Differential Revision: D13736087

fbshipit-source-id: 50e4edfdff3e8ceea94b2beed36399681871a436
2019-01-23 22:28:57 -08:00
Pavel Aslanov
3a44162690 added: multiplexed blobstore scuba logging
Summary:
- Added scuba logging for put/get operation of `MultiplexedBlobstore`
- Added `blobstore_scuba_table` configuration field

Reviewed By: StanislavGlebik

Differential Revision: D13732064

fbshipit-source-id: 9ac0e31f9e1773321b2a7a4d8d561cce9289944b
2019-01-21 10:04:41 -08:00
Lukas Piatkowski
59a2812744 sqlblob: add counters for internal data and chunk memcache hit
Reviewed By: aslpavel

Differential Revision: D13487718

fbshipit-source-id: 27a4b46a8d024a2151e8f7203017a0853cc87ab1
2019-01-15 09:38:26 -08:00
Lukas Piatkowski
7730f59df9 sqlblob: add direct Memcache cache for data and chunk
Summary: as opposed to other blobstores, this one is using memcache directly, because it even stores chunks in the cache

Reviewed By: aslpavel

Differential Revision: D13487613

fbshipit-source-id: bf9eeaef4d795e4f2322f128fb8501ace619d8f1
2019-01-15 09:38:26 -08:00
Lukas Piatkowski
ceda67a78a blobstore: extract CacheOpsUtil for direct access for blobstores
Summary: refactor CacheOps to prepare for next diff

Reviewed By: aslpavel

Differential Revision: D13487500

fbshipit-source-id: f9023938d7c2c7573a7957bf38ec6b8641441b75
2019-01-15 09:38:26 -08:00
Lukas Piatkowski
b9ecb39676 sqlblob: add support for MyRouter
Reviewed By: StanislavGlebik

Differential Revision: D13465323

fbshipit-source-id: a9d6b7626617fcd85d91b4118b22ad9a7db3aa32
2019-01-15 09:38:26 -08:00
Lukas Piatkowski
b36dd037ad sqlblob: initial implementation of the sql based blobstore
Summary: MyRouter and cache support will come in next diffs

Reviewed By: StanislavGlebik

Differential Revision: D13465146

fbshipit-source-id: 0ede0e875d4a49794ff71173bd0d1563abb3ff08
2019-01-15 07:05:33 -08:00
Jeremy Fitzhardinge
408e7665d9 mononoke: move RepositoryId into mononoke-types
Summary: There's nothing Mercurial-specific about identifying a repo. This also outright removes some dependencies on mercurial-types.

Reviewed By: StanislavGlebik

Differential Revision: D13512616

fbshipit-source-id: 4496a93a8d4e56cd6ca319dfd8effc71e694ff3e
2018-12-19 10:24:27 -08:00
Pavel Aslanov
b9ce779144 tie blobstore queue and multiplexer together
Summary: Integrate self-healing queue and multiplexed blobstore together

Reviewed By: StanislavGlebik

Differential Revision: D13416302

fbshipit-source-id: 0d310fdd7380ba9e17667325e37862e2b34748c3
2018-12-18 06:55:56 -08:00
Pavel Aslanov
043b374bf1 make BlobstoreId configurable from repoconfig
Summary: Make `BlobstoreId` configurable from repoconfig

Reviewed By: StanislavGlebik

Differential Revision: D13376824

fbshipit-source-id: 45e1b45fb0fcba6de91374e3621c7bbb1b465544
2018-12-18 06:55:56 -08:00
Pavel Aslanov
d5153e0c3a multiplexed blobstore synchronization queue implementation
Summary: This diff implements interface necessary to synchronize multiplexed blobstore

Reviewed By: StanislavGlebik

Differential Revision: D13234501

fbshipit-source-id: 1969ba342c55fe871af9eb45396c80d6aaefb3dd
2018-12-12 05:43:53 -08:00
Pavel Aslanov
87904b1a6d Multiplexed blobstore implementation
Summary: Multiplexed blobstore. More details in this [post](https://fb.facebook.com/groups/scm.mononoke/permalink/743876145974963/)

Reviewed By: StanislavGlebik

Differential Revision: D13062167

fbshipit-source-id: 6db226ae6fbdc7c621a2733a4b11f1cd17238dc3
2018-12-06 07:51:01 -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
Jeremy Fitzhardinge
ec86d453ae rust/stats: don't require users to import lazy_static
Summary:
Now that Rust macros can be `use`d like normal symbols, `stats` can
simply import the `lazy_static!` macro without requiring its users to do it.

Reviewed By: Imxset21

Differential Revision: D13281897

fbshipit-source-id: a6780fbace07dd784308e642d4a384322a17c367
2018-12-02 14:34:39 -08:00
Jeremy Fitzhardinge
5eede4ee98 mononoke: test for glusterblob
Summary: Add Glusterblob test to blobstore-test.

Reviewed By: lukaspiatkowski

Differential Revision: D13049137

fbshipit-source-id: c60af05e6bc1de8f1372e226c823cedebaf3b282
2018-11-15 13:08:03 -08:00
Jeremy Fitzhardinge
48ca128c88 mononoke/blobtest: make blobstore tests properly async
Summary:
Prepare for gluster blobstore by making the test framework properly
async. It needs a full tokio environment (IO reactor, etc) for async operation, rather than
just `Future::wait`.

Reviewed By: StanislavGlebik

Differential Revision: D13055656

fbshipit-source-id: 6263ff706b3a374f0868f05989b6880f3c5a16ed
2018-11-15 13:08:03 -08:00
Jeremy Fitzhardinge
fb8f81b579 mononoke/glusterblob: add smc support
Summary: Add `with_smc` to allow making a connection using an SMC tier name.

Reviewed By: kulshrax

Differential Revision: D12989046

fbshipit-source-id: bdf9ef4729ac8f90a6a0ac16fb3ce9669d0bcf52
2018-11-15 13:08:03 -08:00
Jeremy Fitzhardinge
cc50c65446 mononoke: gluster blobstore implementation
Summary:
This implements the Blobstore trait using an underlying Gluster volume (or
really any NFS server, but some aspects are tailored to Gluster).

Reviewed By: lukaspiatkowski

Differential Revision: D12989045

fbshipit-source-id: 76b4fe87ed1f392342c31be12115eee972221ca0
2018-11-15 13:08:03 -08:00
Simon Farnsworth
2bf6be2869 Make all bindings fully exception-safe
Summary:
cachelib can throw exceptions from any method. Make all our bindings
exception-safe

Reviewed By: jsgf

Differential Revision: D9158062

fbshipit-source-id: 57948aa6ead304fac6e037621a1f6641826345c5
2018-08-07 13:37:08 -07:00
Simon Farnsworth
cc1454d333 Restore cachelib blob caching
Summary: Reverts D8989404 so that we're using cachelib again.

Reviewed By: jsgf

Differential Revision: D9036003

fbshipit-source-id: 9867a12b81369156ee2e6aa7a7f1c81a638185d6
2018-08-07 11:37:37 -07:00
Zeyi Fan
82ab81238d re-exporting types from other crate is not a good idea
Summary:
I had enough seeing compiler giving me error messages with `blobrepo::Error` whereas it should be `failure::Error`.

`pub type` is exporting a type alias whereas `pub use` is re-exporting. The later apparently will fool the compiler to think that they own the thing they are re-exporting which in this case, failure::Error. If it is for the purpose of declaring the error type the crate is using, type alias is obviously more suitable as it won't take the ownership of the type.

Reviewed By: lukaspiatkowski

Differential Revision: D8926275

fbshipit-source-id: 6b1346adf52bec6b666a3f8b23e7a4ea4e0ab070
2018-07-26 14:23:07 -07:00