Commit Graph

1523 Commits

Author SHA1 Message Date
Stanislau Hlebik
29d1b9e5a0 mononoke: remove Arc<BlobRepo> from hook tailer
Summary: Fix TODO, BlobRepo is cloneable and there is no reason to use Arc<BlobRepo>

Reviewed By: ikostia

Differential Revision: D13607214

fbshipit-source-id: ba280823e8b232d4bf6e62ac2ce8d8cd3ee64c96
2019-01-09 03:52:21 -08:00
Stanislau Hlebik
be6d9bf347 mononoke: log common server data to scribe
Summary:
At the moment it's very hard to understand where the request came from. Let's
log useful information like hostname, tw task etc.

Reviewed By: aslpavel

Differential Revision: D13597544

fbshipit-source-id: 88ad837b61f1dc3d0b2e295774848128a498d9d3
2019-01-09 01:14:57 -08:00
Stanislau Hlebik
d460da7ad2 mononoke: remove unused options
Summary: These config options weren't used at all. Let's delete them from the configs

Reviewed By: aslpavel

Differential Revision: D13597545

fbshipit-source-id: 5e99b38e2e9fc4ba6d836322ceba38a8b65ad2f4
2019-01-09 01:14:57 -08:00
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
Liubov Dmitrieva
8a138c33c8 add support for encording of phase-heads part of bundle2
Summary:
We have decided that this will be used to transport phases to the client

Hg client already supports this part.

Reviewed By: StanislavGlebik

Differential Revision: D13507921

fbshipit-source-id: 621e93bb6e1a0c87d4f4963ba7fa635b77a5b6ec
2019-01-08 05:32:36 -08:00
Liubov Dmitrieva
ad070bb4c1 getbundle request: bundlecaps param should be a set
Summary:
See representation from Mercurial.

```
gboptsmap = {
    "heads": "nodes",
    "bookmarks": "boolean",
    "common": "nodes",
    "obsmarkers": "boolean",
    "phases": "boolean",
    "bundlecaps": "scsv",
    "listkeys": "csv",
    "cg": "boolean",
    "cbattempted": "boolean",
}
```

Some logic might need to check what caps client supports. So convenient lookup is needed.

For example for phases, when we choose to transport phases via a separate bundle2 section called "phase-heads", we need to check that it is a supported on the client side.

Reviewed By: StanislavGlebik

Differential Revision: D13519888

fbshipit-source-id: 6471f2a5057cc3bb2dd72d9318a6f253a447b758
2019-01-08 01:48:06 -08:00
Abhay Bothra
b81b8b0005 Add convert subcommand to mononoke admin tool
Summary:
Added new command which looks as:
```
admin-convert
convert between bonsai and hg changeset hashes

USAGE:
    admin convert <HASH> --from <from> --to <to>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --from <from>    Source hash type [possible values: hg, bonsai]
    -t, --to <to>        Target hash type [possible values: hg, bonsai]

ARGS:
    <HASH>    source hash
```

Reviewed By: StanislavGlebik

Differential Revision: D13494012

fbshipit-source-id: 1e1de7e1e28638b2001f612b9a2c9edda3979dc5
2019-01-07 11:00:48 -08:00
Stanislau Hlebik
629484f646 revert D13584553, D13175922, D13166085 to fix rust builds
Summary:
D13166085 breaks Mononoke builds. We got errors

```
rustfmt may have failed to format. See previous 119 errors.
```

These errors happen on formatting thrift files. It looks like the problem is
in the fact that rustfmt for linting is different from rustfmt we are using
while building rust thrift files - https://fburl.com/hn0g95wt. But they seem to
use the same config files, which are incompatible.

For now revert the diff to unblock the builds. Also we have to revert D13584553 and D13175922
because it depends on D13166085.

Reviewed By: lukaspiatkowski

Differential Revision: D13589633

fbshipit-source-id: 78c68068ddcb4c594fd1463e98b48f8f438e46a2
2019-01-07 06:19:27 -08:00
Jeremy Fitzhardinge
75db1ea8bf linter: use in-tree rustfmt binary for Rust formatting
Summary:
Use rustfmt binaries committed to tools/third-party/rustfmt for
formatting.

Reviewed By: zertosh

Differential Revision: D13166085

fbshipit-source-id: 2ba9568c3f463740b3e48b72196ef7c716e20784
2019-01-04 14:42:26 -08:00
Johan Schuijt-Li
8f2e32c7b8 Guard AclChecker::new and Identity::from_groupname as well from being included
Summary:
These calls make network requests which make our integration tests flaky, this
fix is a followup of D13580144

Reviewed By: StanislavGlebik

Differential Revision: D13580562

fbshipit-source-id: 110563c0360154a86cfc098a05240d7fd023f2c8
2019-01-04 08:32:29 -08:00
Johan Schuijt-Li
55fa57dbdf Disable AclChecker for integration tests
Summary:
Currently some tests are failing intermittently due to a timeout, this timeout
is caused by the integration tests making an external call to AclChecker which
is intermittently very slow.

For our integration tests we disable this call since it's not part of the test
suite to stop our tests from being flaky.

Reviewed By: StanislavGlebik

Differential Revision: D13580144

fbshipit-source-id: 0c26bb14dd222b888ca2638319071f4d99eab6df
2019-01-04 06:19:23 -08:00
Mark Thomas
20ccd1216f don't store filenodes for draft commits in the filenodes table
Summary:
When receiving and infinitepush bundle, don't store the filenodes for the
commit in the filenodes table.

When a client pulls these commits, we will reconstruct the filenode info from
the blobstore data.  However, they will receive null linknodes, and will need
to use adjustlinknode to compute the correct linknode.

Reviewed By: StanislavGlebik

Differential Revision: D13467110

fbshipit-source-id: 739b06f30a530a159352ffbf612d136c9c831aeb
2019-01-04 03:12:57 -08:00
Mark Thomas
76bce93083 return null linknodes if filenodeinfo is not available
Summary:
For draft commits we will stop storing the filenodeinfo for filenodes
introduced by that commit in the database.  This means the filenodeinfo lookup
may fail.  For these cases, reconstruct the filenodeinfo from the blob in the
blobstore, setting the missing linknode to the null changeset id.

Reviewed By: StanislavGlebik

Differential Revision: D13467112

fbshipit-source-id: 27ad406723a6affd80e7c3b2dc538b03004451ec
2019-01-04 03:12:57 -08:00
Mark Thomas
5777dc642f add test demonstrating problem with linknodes
Summary:
Adds a mononoke integration test demonstrating the problem with linknodes and
commit cloud commits, where linknodes may refer to draft commits you don't have
locally, because the filenode was first created with a draft commit that was
pushed to commit cloud.

This results in Mercurial having to do expensive adjustlinkrev operations
on public commits.

Reviewed By: StanislavGlebik

Differential Revision: D13026613

fbshipit-source-id: c2b8e5369a1ba69a175a49b57a70c3e35f92567f
2019-01-04 03:12:57 -08:00
Johan Schuijt-Li
9961d23e4f Support TLS resumption on mononoke
Summary: .

Reviewed By: StanislavGlebik

Differential Revision: D13564745

fbshipit-source-id: 04c66084984100df1073313a11493d79a839bd18
2019-01-03 08:46:15 -08:00
Stanislau Hlebik
92563375c5 mononoke: name variable correctly
Summary: Their names were mixed up

Reviewed By: ikostia

Differential Revision: D13565334

fbshipit-source-id: 1b56adb582900addf2f21ae9baa6dc4ea01c57cb
2019-01-02 10:24:12 -08:00
Liubov Dmitrieva
56dff9277a optimize phase calculation
Summary:
Basically if any of the bookmarks is reachable, all other bookmarks are not
interesting to check, so those futures should be skipped.

Reviewed By: StanislavGlebik

Differential Revision: D13538511

fbshipit-source-id: 193a7ea8d505690aeb96247a07c8f2688cd7a59f
2018-12-21 12:25:05 -08:00
Harvey Hunt
802a0933e4 mononoke: Fix integration tests
Summary:
D13494406 modified the Debug implementation for MPath, which broke the
integration tests.

Update them to fix this.

Reviewed By: rlangst

Differential Revision: D13527774

fbshipit-source-id: b86436b0fdd6653b0123e6da93a8da20e4ca65ba
2018-12-20 06:07:21 -08:00
Jeremy Fitzhardinge
65fd5bcf8f rust/futures-ext: implement StreamEither/left_stream/right_stream
Summary: Implement Either for Streams too.

Reviewed By: Imxset21

Differential Revision: D13494405

fbshipit-source-id: 8aea256b317f8d86e80eab3bfa200c59ebfdda35
2018-12-19 16:49:24 -08:00
Jeremy Fitzhardinge
b4240c995f mononoke: fix MPath Debug formatting
Summary: Fix Debug formatting for MPath - no need to include the full hex name

Reviewed By: aslpavel

Differential Revision: D13494406

fbshipit-source-id: fc2b5e8f2737f3cb5ac0a804b4e9b69ffca49553
2018-12-19 16:49:24 -08:00
Stanislau Hlebik
6989441a6e mononoke: replacing SingleNodeHash revset with SingleChangesetId
Summary:
All revsets should use bonsai changesets and not hg chnagesets.
This diff replaces usages of SingleNodeHash with SingleChangesetId.
It doesn't remove all of the usages, but it removes most of them

Reviewed By: aslpavel

Differential Revision: D13467116

fbshipit-source-id: 92c5b8f63f07e13af642a8cdb91fc77c46cdd595
2018-12-19 11:07:20 -08:00
Stanislau Hlebik
5d483c3f2f mononoke: use mock context in string_to_bonsai
Summary:
It's a test function, and passing additional parameter is annoying. Let's just
create mock context

Reviewed By: ikostia

Differential Revision: D13467118

fbshipit-source-id: fd27893d80f6b0ba59c2b7e5083d4ec7727a0e89
2018-12-19 11:07:20 -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
Liubov Dmitrieva
20a017f839 add "phases" param to getbundle request and its parsing
Summary:
Some params in getbundle requests were ignored in Mononoke

we are going to use "phases" param to check if we need provide phases or not

Mercurial uses 1/0:

```
            elif keytype == "boolean":
                value = "%i" % bool(value)
```

Reviewed By: aslpavel

Differential Revision: D13517508

fbshipit-source-id: b066b335d1b972e9845be9fa3862bbf4d11817cd
2018-12-19 09:47:16 -08:00
Mark Thomas
bd0c00d4a5 run-tests: close child stdout after running test
Summary:
Tests don't close the child process stdout.  On newer versions of Python, this
can lead to ResourceWarnings when the test runner thread terminates.

Reviewed By: HarveyHunt

Differential Revision: D13517425

fbshipit-source-id: 6cedf4f39efe1299c41dbde784daf8c159309640
2018-12-19 07:52:48 -08:00
Mark Thomas
83a5782ec2 run-tests: fix escape sequences
Summary:
Some of the escape sequences in run-tests.py are invalid.  These cause
DeprecationWarnings on newer versions of Python.

In both cases, there are `\` characters that need to be escaped as `\\`.

Reviewed By: HarveyHunt

Differential Revision: D13517137

fbshipit-source-id: a899c3c28d55210f5972a515474a2fa69d051671
2018-12-19 07:52:48 -08:00
Pavel Aslanov
eb75d48a95 correctly handle configurations with multiple blobstores
Summary: Correctly handle repository with multiple blobstores

Reviewed By: StanislavGlebik

Differential Revision: D13434206

fbshipit-source-id: f4ab70ec037deba150ed5c1ee8e53d23317b8e09
2018-12-18 06:55:56 -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
bf005637e1 add get method to BlobstoreSyncQueue
Summary: This method is needed by `MultplexedBlobstore` to disambiguate unassigned key from not synced one

Reviewed By: StanislavGlebik

Differential Revision: D13415231

fbshipit-source-id: 9918ca255b3ed3486660e303546a897622a42950
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
Stanislau Hlebik
ae77a7d64b mononoke: remove failing test
Reviewed By: HarveyHunt

Differential Revision: D13455632

fbshipit-source-id: b2582a985153a0a0460ef577daedf203d1bb5da4
2018-12-18 05:48:19 -08:00
Liubov Dmitrieva
1bc9d9d3c4 phases_hint: correct initialization
Summary:
As discussed RepoClient should own phases_hit. Initialize it correspondingly.

Some rustfmt is unrelated.

Reviewed By: lukaspiatkowski

Differential Revision: D13488572

fbshipit-source-id: 3d2c0169c06220bcd4b3f8845d6db7f357052e0a
2018-12-18 05:16:24 -08:00
Liubov Dmitrieva
8ed94624c9 add a test that demonstrates phases are not passed correctly
Summary: the test we will use to check phases implementation

Reviewed By: lukaspiatkowski

Differential Revision: D13467516

fbshipit-source-id: 89760b6b965e8de8ad3e4dd7ff4cf6d3216597fd
2018-12-18 05:16:24 -08:00
Stanislau Hlebik
bd52c0918d mononoke: set bookmark only for heads in fixtures repo
Summary:
This diff fixes TODO. Previously there was a bookmark on every commit in the repo. This is not necessary
and make testing harder (in particular, testing phases). Let's clean it up

Reviewed By: HarveyHunt

Differential Revision: D13454832

fbshipit-source-id: c7d545841073d2030431ef4aed2307a55785f8db
2018-12-17 14:28:55 -08:00
Stanislau Hlebik
541ec421e1 mononoke: remove duplicate commit from fixture
Summary: We have the same commit a few lines above

Reviewed By: HarveyHunt

Differential Revision: D13457024

fbshipit-source-id: 5a3262abf7d39a34c858b2bbc6c0a9ba78afe181
2018-12-17 14:28:55 -08:00
Jeremy Fitzhardinge
5f3d7307da mononoke/revset: suppress warning
Summary: PhantomData only used for test builds.

Reviewed By: StanislavGlebik

Differential Revision: D13460298

fbshipit-source-id: e712e468a4dacd6ddad3b6159c3020d49e87306f
2018-12-14 13:27:44 -08:00
Jeremy Fitzhardinge
a9817cfec1 mononoke-types: simplify Debug output for MPath
Summary: No need to print the hex.

Reviewed By: StanislavGlebik

Differential Revision: D13457386

fbshipit-source-id: f6063b94e4f095d9ffed06b9de6e302b38e29334
2018-12-14 13:27:44 -08:00
Liubov Dmitrieva
473a9ba741 add api for using PhaseHint and Db without memcache
Summary:
New HintPhases api that will be used for tests vs CachingHintPhases that will be used in prod.

The api will be owned by RepoClient.

We will check what type of BlobRepo we have (i.e. blob:rocks, blob:files, blob:remote etc) and build the phases depending on the type of the BlobRepo.

We will use either CachingHintPhases backed by real db / MyRouter or HintPhases backed by Sqlite.

Reviewed By: StanislavGlebik

Differential Revision: D13466225

fbshipit-source-id: 06ea565171d8ea8d7335fbbd91d86fbdcc01c8fc
2018-12-14 09:20:29 -08:00
Liubov Dmitrieva
776c48ca40 add logic for slow path phases calculation
Summary: Calculation is based on beeing ancestor of a public bookmark

Reviewed By: StanislavGlebik

Differential Revision: D13441622

fbshipit-source-id: e20df656847913bc124b491aaeb2660d21c85da1
2018-12-14 08:06:53 -08:00
Liubov Dmitrieva
120849c0be memcache getter/setter for phases
Summary:
This diff includes the logic on how we will receive a phase for a given commit based on memcahe / db lookup and refresh, and slow path calculation.

It has a blank place of slow path (not found in the memcache, not found in the db => we have to calculate the phase based on being ancestor of public bookmark).

Collecting the stats should be added separately.

Reviewed By: StanislavGlebik

Differential Revision: D13415481

fbshipit-source-id: 6a4cb5b8dfbb0d7b2535d903c653bbf7a088c422
2018-12-14 08:06:53 -08:00
Stanislau Hlebik
328fc5f3e5 mononoke: fix bookmark fetching
Summary:
mononoke_admin output was changed, so we have to change the parsing.
Also previously failure to fetch the bookmark would be silently ignored.
Instead let's log the failure to scuba.

Also fix "compact" logging to make sure it's output goes to stderr instead of stdout

Reviewed By: aslpavel

Differential Revision: D13464728

fbshipit-source-id: a36a9bd68c2fcb77617b2db0246c5d5ef359fc28
2018-12-14 07:07:03 -08:00
Abhay Bothra
f146e8e389 mononoke: migrate SetDifferenceNodeStream to use ChangesetId
Summary:
Made changes to SetDifferenceNodeStream struct, and associated member functios.
Also ran :RustFmt on quickcheck.rs and setdifferencenodestream.rs

Reviewed By: StanislavGlebik

Differential Revision: D13448043

fbshipit-source-id: c38567ad8fb94d55b463b28abf4bd78987a9c68a
2018-12-13 15:09:12 -08:00
Liubov Dmitrieva
e75e5576a9 add get_bookmarks api for blobrepo
Summary: similar to get_bookmarks_maybe_stale but read from master db

Reviewed By: markbt

Differential Revision: D13417055

fbshipit-source-id: 805cbe3953a6c0a2380c0168eb403c6e9e0551c9
2018-12-13 11:51:34 -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
Stanislau Hlebik
42e3fb121d mononoke: cleanup tests
Summary: Remove unused parameters

Reviewed By: HarveyHunt

Differential Revision: D13416242

fbshipit-source-id: 63ebd4f3799770e8fda9849ac00965a01e5fc0d3
2018-12-11 09:48:02 -08:00
Stanislau Hlebik
e5f5ae78c2 mononoke: fix tests
Summary:
We already had a few diffs that added or removed

```
Ignoring setSSLLockTypes after initialization
```

line.

I'm not sure why we have them, but we don't want to see them anyway, so disable
it via minloglevel glog option (level 2 means see only ERROR and FATAL).

Reviewed By: HarveyHunt

Differential Revision: D13416156

fbshipit-source-id: 362153385b77e133e404b21faa1735a9544fe13e
2018-12-11 08:24:03 -08:00
Stanislau Hlebik
41b8393846 mononoke: make test-blobimpor.t lighter
Summary:
Currently it creates too many commits and stress run times out. Besides it also
creates random filenames, so even if we find a failure we won't be able to
repro it.

Let's create just two commits instead of 200.

Reviewed By: HarveyHunt

Differential Revision: D13415238

fbshipit-source-id: 927bd69b55761e4dd4ea6e5f459df58a95918955
2018-12-11 05:55:44 -08:00
Harvey Hunt
8bcdf04f1e mononoke: Remove mention of configrepo from arg parsing
Summary:
As we no longer use a config repo, rename the argument
to --config_path.

Reviewed By: rlangst, StanislavGlebik

Differential Revision: D13415205

fbshipit-source-id: 8c7d335373c0ba33131d4476ee72fcd914097385
2018-12-11 05:05:40 -08:00
Harvey Hunt
162dafa9d9 mononoke: admin: Remove ability to build fbpkgs
Summary:
Now that mononoke's config can be built using normal fbpkg tools,
we can remove the ability for mononoke_admin to build configuration.

Reviewed By: StanislavGlebik

Differential Revision: D13399189

fbshipit-source-id: 17aff327773b9c904916f99030a732a99aa34134
2018-12-11 03:56:02 -08:00
Liubov Dmitrieva
ba58aa252a phases support: mysql add/get
Summary: add/get api for adding phases to mysql phases table

Reviewed By: lukaspiatkowski

Differential Revision: D13376701

fbshipit-source-id: b71e52db2c30b59b0070f49327bfdd189c28d6cc
2018-12-10 06:14:03 -08:00