Commit Graph

57912 Commits

Author SHA1 Message Date
Alex Hornby
8c240d311c mononoke: walker: introduce named structs to replace some commonly used tuples
Summary:
The output streams from the walks are of the form (Key, Payload, Stats).

Where the Key is Node and the Payload is NodeData this is ok, but with the key and payload both tuples it gets hard to read, so this introduces named tuple-like structs for clarity.

Reviewed By: StanislavGlebik

Differential Revision: D21504916

fbshipit-source-id: a856d34af4117d3183ef0741b311c1c34cf9dacc
2020-05-14 04:22:23 -07:00
Alex Hornby
cd9346f7da mononoke: walker: add --sample-path-regex option
Summary:
Add a --sample-path-regex option for use in the corpus dumper so we can dump out just a subset of directories from a repo.

This is most useful on large repos.

Reviewed By: farnz

Differential Revision: D21325548

fbshipit-source-id: bfda87aa76fbd325e4e01c2df90b5dcfc906a8f6
2020-05-14 04:22:22 -07:00
Alex Hornby
ad4dbb693e mononoke: walker: track path mtime
Summary:
Track path mtime, as being able to order by mtime is important to be able to use the on disk corpus to evaluate delta compression approaches

The dumped blobs mtime is set based on the last traversed bonsai or hg commit's timestamp.  For Bonsai it prefers committer_time if present and if not falls back to author_time.

Reviewed By: farnz

Differential Revision: D21312223

fbshipit-source-id: fa14615603f78675ca54a0f4946cc8480b8eade5
2020-05-14 04:22:22 -07:00
Alex Hornby
5df1989251 mononoke: walker: corpus dump bytes to inflight area and then move
Summary:
Update the corpus walker to dump the sampled bytes as early as possible to the Inflight area of the output dir, then move them to final location once path is known.

When walking large files and manifests this uses a lot less memory that holding the bytes in a map!

Layout is changed is to make comparison by file type easier.  we get a top level dir per extension, e.g. all .json files are under FileContent/byext/json

This also reduces the number of bytes taken from the sampling fingerprint used to make directories, 8 was overkill.  3 is enough to limit directory size.

Reviewed By: farnz

Differential Revision: D21168633

fbshipit-source-id: e0e108736611d552302e085d91707cca48436a01
2020-05-14 04:22:22 -07:00
Kostia Balytskyi
53139e838f mononoke_types: make thrift consumable from commitcloud_backfiller
Reviewed By: krallin

Differential Revision: D21527253

fbshipit-source-id: 58c1fbbbde6174b05a0fdcb7bc1f013a28841783
2020-05-14 03:26:15 -07:00
Alex Hornby
288d03af6e mononoke: walker: add corpus dumper for space analysis
Summary:
Add corpus dumper for space analysis

This reuses the path based tracking from compression-benefit and the size sampling from scrub.

The core new functionality is the dump to disk from inside corpus stream.

Reviewed By: StanislavGlebik

Differential Revision: D20815125

fbshipit-source-id: 01fdc9dd69050baa8488177782cbed9e445aa3f7
2020-05-14 02:32:51 -07:00
svcscm
46de4c526a Updating submodules
Summary:
GitHub commits:

2f38e736cd
db00ef824b
f66e9d7cd2

Reviewed By: zpao

fbshipit-source-id: d40cfe2f50505ecc1059838b668e6fd95d9c1182
2020-05-14 02:32:51 -07:00
svcscm
dc6a90a2e9 Updating submodules
Summary:
GitHub commits:

c2eda06820
7ed5f9f16c

Reviewed By: zpao

fbshipit-source-id: 48b466893b7537c845bc30b2880f7bb9d7c1d265
2020-05-13 20:24:51 -07:00
Jun Wu
32298c1056 remotenames: remove legacy auto pull logic
Summary: The revset autopull now covers the remote bookmark autopull logic.

Reviewed By: DurhamG

Differential Revision: D21526665

fbshipit-source-id: f57e844021ef74f2f99a2124c821a2b190d45760
2020-05-13 19:27:42 -07:00
Jun Wu
8213cfd464 autopull: support different sources
Summary:
Make it so that remote bookmarks like `foo/name` or `bar/name` would pull from
different sources `paths.foo` or `paths.bar`.

Reviewed By: DurhamG

Differential Revision: D21526666

fbshipit-source-id: 6791ab047840c6c49df0c96ff1f56ae7bd1aeeba
2020-05-13 19:27:41 -07:00
Jun Wu
39bd5d8634 context: remove "is a remote bookmark or commit, try to 'hg pull' it first" message
Summary:
We now have auto pull logic that covers most unknown rev use-cases. The hint
message is no longer necessary. It's also unclear how to use `hg pull`
correctly. For example, should it be `-r`, `-B remote/foo` or `-B foo`?

Reviewed By: DurhamG

Differential Revision: D21526667

fbshipit-source-id: 40583bfb094e52939130250dd71b96db4d725ad5
2020-05-13 19:27:41 -07:00
Arun Kulshreshtha
d7455ed900 tests: delete test-amend-noinhibit.t
Summary: The original purpose of this test was to verify that `hg restack` would work correctly with the `inihibt` extension disabled. `inhibit` has not been relevant at FB for years, so this test has no value.

Reviewed By: quark-zju

Differential Revision: D21555411

fbshipit-source-id: 475ed37439ed71aee08ad1b23ebe1770c3324890
2020-05-13 18:08:58 -07:00
svcscm
a2b856cc99 Updating submodules
Summary:
GitHub commits:

a11054fa09

Reviewed By: zpao

fbshipit-source-id: f69d6f83ec05d34968b68a33980d6e9eec4281b9
2020-05-13 17:17:33 -07:00
Stefan Filip
71f53b2d50 mononoke: add simple test for bulkops::fetch_all_public_changesets
Summary: Add test.

Reviewed By: krallin

Differential Revision: D21471476

fbshipit-source-id: b610323a227fb4323f1620753ffe0952f6240e8d
2020-05-13 16:53:16 -07:00
Stefan Filip
5aab61a192 mononoke: add Changesets::get_sql_changesets
Summary: Modeled after Phases::get_sql_phases

Reviewed By: krallin

Differential Revision: D21471475

fbshipit-source-id: 687929fa4570031d9ed8c6ec9bf1015fb997d995
2020-05-13 16:53:16 -07:00
Stefan Filip
aaac7bb066 mononoke: move fetch_all_public_changesets to the bulkops crate
Summary:
I want to reuse the functionality provided by `fetch_all_public_changesets`
in building Segmented Changelog. To share the code I am adding a new crate
intended to store utilities in dealing with bulk fetches.

Reviewed By: krallin

Differential Revision: D21471477

fbshipit-source-id: 609907c95b438504d3a0dee64ab5a8b8b3ab3f24
2020-05-13 16:53:16 -07:00
svcscm
0e12d9a096 Updating submodules
Summary:
GitHub commits:

58be1aa908

Reviewed By: zpao

fbshipit-source-id: dfa118d04a4089277e49fa02752bed062944ab9f
2020-05-13 16:53:15 -07:00
svcscm
8a595b49df Updating submodules
Summary:
GitHub commits:

205b83bdd2
ee1e6c7b72
398f5c4807
cfe0556cbd
0510e00d52

Reviewed By: zpao

fbshipit-source-id: 562c88611c68fe9f5ed57ceb6b265bc05577a2b2
2020-05-13 15:38:00 -07:00
Kostia Balytskyi
b1d4f6d2a5 debugsendunbundle: add cmd to send unbunble from stdin
Summary:
This is helpful, when we have raw unbundle bytes and a server path and just
want to send these bytes server's way.

Very similar to `sendunbundlereplay`, but does not do anything additional,
and reads from stdin.

Reviewed By: markbt

Differential Revision: D21527243

fbshipit-source-id: 97726cb40a32c7e44f47e0f56d8c8eabc4faf209
2020-05-13 15:34:39 -07:00
svcscm
4e8a9077e5 Updating submodules
Summary:
GitHub commits:

d55c0b181d
f4660f251d
2d66b4df1f
50c861d765
a6c6103875
9b05d5c814
6891c1b819

Reviewed By: zpao

fbshipit-source-id: b111c91ce6901143de31b0637909313e59bd9570
2020-05-13 14:13:21 -07:00
Xavier Deguillard
99f74f0155 lfs: move uploaded blobs to the shared store
Summary:
As a developpers is working on large blobs and iterating on them, the local LFS
store will be growing significantly over time, and that growth is unfortunately
unbounded and will never be cleaned up. Thankfully, one the guarantee that the
server is making is that an uploaded LFS blob will never be removed[0]. By using
this property, we can simply move blobs from the local store to the shared
store after uploading the blob is complete.

[0]: As long as it is not censored.

Reviewed By: DurhamG

Differential Revision: D21134191

fbshipit-source-id: ca43ddeb2322a953aca023b49589baa0237bbbc5
2020-05-13 12:50:20 -07:00
svcscm
58478894d2 Updating submodules
Summary:
GitHub commits:

963d617980
9d972c3d96
50d63a2af0

Reviewed By: zpao

fbshipit-source-id: 020dc9a8d951955fbb42873887d6af56ac31d024
2020-05-13 12:22:05 -07:00
Xavier Deguillard
b90a9504f0 win: improve getFileSha1 to not trigger a stack overflow
Summary:
In order to build a StringPiece from a C-string, the length of the that
string needs to be known, and a constexp strlen is performed on it. That
strlen is however a recursive one, causing the stack to blow up on big file.

Interestingly enough, this also means that binary files potentially had a
wrong sha1 being computed, potentially causing `hg status` to report some
files as being modified, while they aren't. By switching to using a vector
instead of a string, the intent should of this should be more obvious.

Reviewed By: simpkins

Differential Revision: D21551331

fbshipit-source-id: 2dc1f08d96f49d310593e0e934a03215be2b5cbb
2020-05-13 11:44:30 -07:00
Mark Thomas
c1b3bc1104 mutationstore: exit early if there is nothing to do
Summary:
If a push or pull operation doesn't involve any changesets for which mutation
information might be relevant, don't spend any time querying the database, and
instead exit early.

Reviewed By: krallin

Differential Revision: D21549937

fbshipit-source-id: a6f992e621456b826acd1bddde3591e751d23b31
2020-05-13 11:00:58 -07:00
Mark Thomas
57cfcf96d5 mutationstore: avoid SQL requests with empty sets
Summary:
MySQL returns an error for a query of the form `WHERE value IN ()`.  Avoid
these by checking that collections are not empty before making the query.

Reviewed By: krallin

Differential Revision: D21549690

fbshipit-source-id: 1507d36e81f7a743d2a1efb046e52a5479633ab9
2020-05-13 11:00:57 -07:00
Mark Thomas
1110a36017 add test-infinitepush-mutation.t to the mysql tests
Summary:
The `test-infinitepush-mutation.t` test covers the new mutation database, so
add it to the mysql tests.

Reviewed By: krallin

Differential Revision: D21548966

fbshipit-source-id: 0dc1f90129fa61fb6db1c1b5a747efa3d20041f5
2020-05-13 11:00:57 -07:00
Mark Thomas
1b79736298 remove support_bundle2_listkeys flag
Summary:
The `support_bundle2_listkeys` flag controls at runtime whether we support
`listkeys` in bundle2.  Since this was added before tunables were available,
it uses a value in the mutable counters SQL store.

We could migrate this to tunables, but in practice we have never disabled it,
so let's just make it the default.

Reviewed By: krallin

Differential Revision: D21546246

fbshipit-source-id: 066a375693757ea841ecf0fddb0cc91dc144fd6f
2020-05-13 11:00:56 -07:00
Mark Thomas
14dfeecda8 getbundle: include mutations in getbundle response for draft commits
Summary:
When the client pulls draft commits, include mutation information in the bundle
response.

Reviewed By: farnz

Differential Revision: D20871339

fbshipit-source-id: a89a50426fbd8f9ec08bbe43f16fd0e4e3424e0b
2020-05-13 11:00:56 -07:00
Mark Thomas
5774dbde9d unbundle: accept mutation entries and store them in the mutation store
Summary:
Advertise support for `b2x:infinitepushmutation`.  When the client sends us
mutation information, store it in the mutation store.

Reviewed By: mitrandir77

Differential Revision: D20871340

fbshipit-source-id: ab0b3a20f43a7d97b3c51dcc10035bf7115579af
2020-05-13 11:00:56 -07:00
Mark Thomas
2373628aba blobrepo: add mutation store
Summary: Add the mutation store to blobrepo.

Reviewed By: krallin

Differential Revision: D20871336

fbshipit-source-id: 777cba6c2bdcfb16b711dbad61fc6d0d2f337117
2020-05-13 11:00:55 -07:00
Thomas Orozco
4852b9a9ff mononoke/segmented_changelog: remove a warning
Summary: What it says in the title

Reviewed By: StanislavGlebik

Differential Revision: D21549635

fbshipit-source-id: 75939ebbfb317a9beaa9acd1fc1a7c6f41b0f88f
2020-05-13 10:47:10 -07:00
Xavier Deguillard
dc589c38e5 revisionstore: don't import unused format_err
Summary: The compiler is warning about it.

Reviewed By: singhsrb

Differential Revision: D21550266

fbshipit-source-id: 4e66b0dda0e443ed63aeccd888d38a8fcb5e4066
2020-05-13 10:44:07 -07:00
Jun Wu
0ac5c6d4f3 pymutationstore: expose the getdag API
Summary: Expose the API that returns a real graph.

Reviewed By: DurhamG

Differential Revision: D21486520

fbshipit-source-id: 4ebdb4011df8971c54930173c4e77503cd2dac47
2020-05-13 09:45:24 -07:00
Jun Wu
4f39a8e5a6 mutationstore: add a method that returns a dag
Summary:
Part of the mutation graph (excluding split and fold) can fit in the DAG
abstraction. Add a method to do that. This allows cross-dag calculations
like:

  changelogdag = ... # suppose available by segmented changelog

  # mutdag and changelogdag are independent (might have different nodes),
  # with full DAG operations on either of them.
  mutdag = mutation.getdag(...)
  mutdag.heads(mutdag.descendants([node])) & changelogdag.descendants([node2]) # now possible

Comparing to the current situation, this has some advantages:
- No need to couple the "visibility", "filtered node" logic to the mutation
  layer. The unknown nodes can be filtered out naturally by a set "&"
  operation.
- DAG operations like heads, roots can be performed on mutdag when it's
  previously impossible. We also get operations like visualization for free.

There are some limitations, though:
- The DAG cannot represent non 1:1 modifications (fold, split) losslessly.
  Those relationships are simply ignored for now.
- The MemNameDag is not lazy. Reading a long chain of amends might be slow.
  For most normal use-cases it is probably okay. If it becomes an issue we
  can seek for other solutions, for example, store part of mutationstore
  directly in a DAG format on disk, or have fast paths to bypass long
  predecessor chain calculation.

Reviewed By: DurhamG

Differential Revision: D21486521

fbshipit-source-id: 03624c8e9803eb1852b3034b8f245555ec582e85
2020-05-13 09:45:24 -07:00
Egor Tkachenko
992e4a33c2 Replace hardcoded db_tier configs with configerator's values in scmadmin
Summary: Add usage of configerator config using thrift interface in scmadmin

Reviewed By: krallin

Differential Revision: D21452477

fbshipit-source-id: 5ae3fdea5cf2187284891ce4ba1ac42ad75cc486
2020-05-13 05:41:56 -07:00
Stanislau Hlebik
5f8ab2526c mononoke: make sure commit is regenerated when backfill_derived_data single is
Summary:
subcommand_single calls `derived_data_utils.regenerate(vec![cs_id])` with the
intention that derived data for this commit will be regenerated. However
previously it didn't work because DerivedDataUtils::derive() was ignoring
regenerate parameter. This diff fixes it.

Reviewed By: krallin

Differential Revision: D21527344

fbshipit-source-id: 56d93135071a7f3789262b7a9d9ad84a0896c895
2020-05-13 03:27:46 -07:00
Stanislau Hlebik
d1b8399a16 mononoke: allow overriding lfs params in sync job
Reviewed By: krallin

Differential Revision: D21500773

fbshipit-source-id: b280b6759b0be066025f33bbf0b12a3359d227ba
2020-05-13 01:26:58 -07:00
svcscm
c4709f47b8 Updating submodules
Summary:
GitHub commits:

debe32b24c
20b37e9bff

Reviewed By: zpao

fbshipit-source-id: 8985e158d3dee85f4c6b2c5b49d0aed6ba1b4add
2020-05-13 01:26:57 -07:00
svcscm
1f887381e6 Updating submodules
Summary:
GitHub commits:

fb500be709

Reviewed By: zpao

fbshipit-source-id: 7c053596ba3107fbaf7c400831f777b6ec3a4d08
2020-05-12 17:04:19 -07:00
Jun Wu
ff7a6b43d3 pyre2: use Rust regex backend
Summary: Switch from re2 to the Rust regex engine.

Reviewed By: DurhamG

Differential Revision: D20973178

fbshipit-source-id: 2707bfb2120ceb3758a81c01a5a6f4f8c61758bc
2020-05-12 16:32:51 -07:00
Jun Wu
e817197b09 bindings: add bindings to regex
Summary:
This allows us to replace the pyre2 C++ bindings so the fast regex engine can
work with Python 3, and simplify our build steps.

Reviewed By: DurhamG

Differential Revision: D20973179

fbshipit-source-id: e123ac18954991f2c701526108f5c2ecd2b31a3b
2020-05-12 16:32:50 -07:00
Arun Kulshreshtha
7514241c38 edenapi_server: add history endpoint
Summary: Add a `/history` endpoint that serves EdenAPI history data. Like the other endpoints, this one currently buffers the response in memory, and will be modified to return a streaming response in a later diff.

Reviewed By: krallin

Differential Revision: D21489463

fbshipit-source-id: 259d2d1b7d700251fe902f1ac741545e5895404a
2020-05-12 16:26:22 -07:00
Arun Kulshreshtha
647a91647b edenapi: add history support to data_util
Summary: Add the ability to parse EdenAPI history responses to `data_util`.

Reviewed By: quark-zju

Differential Revision: D21489228

fbshipit-source-id: 42dda64273673431a6f3e4d7bd430689c76c387f
2020-05-12 16:26:22 -07:00
Arun Kulshreshtha
48a0b33093 edenapi_server: factor out handler boilerplate
Summary: Factor out logic that will be common to many handlers into new functions in the `util` module.

Reviewed By: krallin

Differential Revision: D21489469

fbshipit-source-id: 9aff4e5182748ab0a0bedd6038852692b8e721a7
2020-05-12 16:26:21 -07:00
Arun Kulshreshtha
3ac2032c07 edenapi_server: split up test-edenapi-server.t
Summary: Break up the EdenAPI server integration tests to prevent the test from getting too long.

Reviewed By: krallin

Differential Revision: D21464056

fbshipit-source-id: 076aaf8717547fe9188f40c078d577961c02325d
2020-05-12 16:26:21 -07:00
Arun Kulshreshtha
4af81d590e edenapi_server: add trees endpoint
Summary: Add an endpoint that serves trees. Uses the same underlying logic as the files endpoint, and returns the requested nodes in a CBOR DataResponse.

Reviewed By: krallin

Differential Revision: D21412987

fbshipit-source-id: a9bcc169644a5889c3118a3207130228a5246b2f
2020-05-12 16:26:20 -07:00
Arun Kulshreshtha
40928f027c make_req: take array instead of object as input for data requests
Summary: Change `make_req` to take a JSON array as input when constructing `DataRequest`s instead of a JSON object. This is more correct because DataRequests can include multiple `Key`s with the same path; this cannot be represented as an object since an object is effectively a hash map wherein we would have duplicate keys.

Reviewed By: quark-zju

Differential Revision: D21412989

fbshipit-source-id: 07a092a15372d86f3198bea2aa07b973b1a8449d
2020-05-12 16:26:20 -07:00
Arun Kulshreshtha
b3fe7c5a3a edenapi_server: make data fetching code generic
Summary: EdenAPI data responses can contain data for either files or trees. As such, the implementation of both the files and trees endpoints is almost identical. To allow the logic to be shared between both, this diff makes the handler code generic.

Reviewed By: krallin

Differential Revision: D21412986

fbshipit-source-id: 89501915b0401214b373ed1db2eb09e59de2e5b7
2020-05-12 16:26:20 -07:00
Arun Kulshreshtha
2fcf4c4901 mononoke_api: add HgDataContext and HgDataId traits
Summary: In order to allow writing code that is generic over files and trees, move the functionality common between the two to a separate trait. This will allow for a significant amount of code sharing in the EdenAPI server. (This diff does not introduce any new functionality; it's mostly just moving existing code into the new traits.)

Reviewed By: krallin

Differential Revision: D21412988

fbshipit-source-id: 31b55904f62ccb965b0f9425de875fc069e10b5a
2020-05-12 16:26:19 -07:00
Arun Kulshreshtha
955a057e8f edenapi_server: add files endpoint
Summary:
Add an endpoint that serves Mercurial file data.

The data for all files involved is fetched concurrently from Mononoke's backend but in this initial version the results are first buffered in memory before the response is returned; I plan to change this to stream the results in a later diff.

For now this version demonstrates the basic functionality as well as things like ACL enforcement (a valid client identity header with appropriate access permissions must be present for requests to succeed).

Reviewed By: krallin

Differential Revision: D21330777

fbshipit-source-id: c02a70dff1f646d02d75b9fc50c19e79ad2823e6
2020-05-12 16:26:19 -07:00