Commit Graph

64094 Commits

Author SHA1 Message Date
svcscm
fdbaeb23ab Updating submodules
Summary:
GitHub commits:

e7c48a6ed4
2a12b80769
c7af2626ce

Reviewed By: bigfootjon

fbshipit-source-id: 02241c9047e999ba5cffa731e2d91ebf596b9a81
2021-03-23 11:02:07 -07:00
Jun Wu
151698a7fe indexedlog: be compatible with MultiLog changes written by older software (2)
Summary:
This is a follow-up to D27093942 (59b8287c85). But D27093942 (59b8287c85) forgot one `read_log` spot, making it
possible to lose data.

Reviewed By: andll

Differential Revision: D27265233

fbshipit-source-id: ab1e73cdcfd3cc9da2e19000ee5fd5761977dc4a
2021-03-23 10:57:27 -07:00
Jun Wu
af420423eb indexedlog: add a test showing mixed old/new read/write is problematic
Summary:
Turns out D27093942 (59b8287c85) was not a complete fix. It misses a `read_log`. Add a
test showing the problem.

Reviewed By: andll

Differential Revision: D27265232

fbshipit-source-id: 103e543abacbb2cbaf10aa3fe3d9693922d9daad
2021-03-23 10:57:27 -07:00
Jun Wu
adb24ca54d do not show Rust progress in curses interface
Summary: Rust progress bar renderer wasn't aware of the curses interface.

Reviewed By: kulshrax

Differential Revision: D27266773

fbshipit-source-id: 66294c8fef50d01f327642beeec03fc414173d5e
2021-03-23 10:52:56 -07:00
svcscm
53c155452f Updating submodules
Summary:
GitHub commits:

db82ddce82
57e3562c4c
bd04b30340
2347f7a062
ee001c5fa3

Reviewed By: bigfootjon

fbshipit-source-id: 90d47f86d9d0cc928924facca06419a1333611b4
2021-03-23 10:52:56 -07:00
svcscm
7f00b1a80f Updating submodules
Summary:
GitHub commits:

b3fc13d4d3

Reviewed By: bigfootjon

fbshipit-source-id: a79dd13b31bb22bf699185a742b03b6b7a906d0b
2021-03-23 04:31:51 -07:00
Thomas Orozco
9057903c3d revisionstore: lfs: separate download & upload paths
Summary:
There are a few abstractions in this that make it a little hard to
have different behavior between the download & upload paths.

This makes it hard to have different behavior for the two. It's a bit of a
problem right now in the sense that we end up doing things like sending a
Content-Length on a GET, but the reason I'm changing it is because I want to
chunk downloads and that requires having different logic in the upload &
download paths.

As part of doing this, I also moved a bunch of parameters away from
HttpLfsRemote and into HttpOptions, which makes the function signatures a
little more manageable.

Reviewed By: quark-zju

Differential Revision: D27191593

fbshipit-source-id: c332229bb3c5a4c1eaedb54dc12c3ddc19205050
2021-03-23 03:20:35 -07:00
Thomas Orozco
820b538001 mononoke/lfs_server: add support for Range
Summary:
This will let us better load balance across our clients by having them send
requests that are a fixed size. Indeed, right now, load imbalanced between
our hosts seem to be largely attributable to the fact that some hosts are
responsible for a few 150MB+ blobs, whereas others have none of those.

The motivation here is to let clients query us by range. Then, we can just have
clients fetch e.g. ~40MB at a time, and route those to different hosts, thus
eliminating said load imbalance.

Reviewed By: StanislavGlebik

Differential Revision: D27188610

fbshipit-source-id: b9bbe18904cdd88ec7bab2b76e096fd3585c7b78
2021-03-23 03:20:35 -07:00
Thomas Orozco
35c1222af8 mononoke/filestore: return correct size when fetching a range
Summary:
Right now, this always returns the total size of the file instead of the bytes
we'll actually return. This is annoying because we use this to allocate
buffers in SCS.

Let's return the size of what will actually be returned.

Reviewed By: farnz

Differential Revision: D27188611

fbshipit-source-id: 0a05cc8ef6fb8e083dd0def405dfe1d0eecfd253
2021-03-23 03:20:35 -07:00
Thomas Orozco
7644185846 mononoke/filestore: expose Range as an input in range fetches
Summary:
I'd like to add support for Range queries in LFS. In HTTP, the range header
isn't start + size, it's start / end, so I'll need a slightly lower API. This
makes that possible.

Note: Range should have a private constructor, because otherwise we'll get
errors if start > end. Hence the `Range` / `RangeInner` here.

Reviewed By: StanislavGlebik

Differential Revision: D27187817

fbshipit-source-id: 20183d8b200fef6c16e45a66886ce8886d92e4f6
2021-03-23 03:20:35 -07:00
Simon Farnsworth
f8247dbc53 Remove Thrift Manifold client
Summary: It's no longer in use, so remove it completely to simplify the code

Reviewed By: ahornby

Differential Revision: D27234699

fbshipit-source-id: ec26f4e283d48b05e19b951b8485ca6fa7751072
2021-03-23 03:08:22 -07:00
Jan Mazur
1ca5f6bfae quiet git init command not to print out hint
Summary:
Git client was updated and it started outputting a hint that breaks our tests. It has no meaning in tests so just quiet it.

```
➜  fbcode git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
Initialized empty Git repository in /data/users/mzr/fbsource/fbcode/.git/
```

Reviewed By: StanislavGlebik

Differential Revision: D27232853

fbshipit-source-id: 683ebebb36049adb758e7c26f843f12159a45301
2021-03-23 02:28:52 -07:00
Alex Hornby
617489bdc5 eden/scm/lib: default to python3-sys
Summary:
eden/scm/lib: default cpython_ext to python3
```

CI internally,  try a PR on github once its landed.

Reviewed By: quark-zju

Differential Revision: D27237636

fbshipit-source-id: 1768f778d75b5d6c62dfd5641f911604a37d3163
2021-03-23 01:13:08 -07:00
svcscm
0571a0aeb0 Updating submodules
Summary:
GitHub commits:

90a5e0c9e7
435d469396
ddbda91394
5f75d3a8a2
eef1704310
ed340e9f12
c511403267
71a95bdffe
98dde76c9e
6bbb8508a4
2b2a1b3835

Reviewed By: bigfootjon

fbshipit-source-id: ec279bcb8607b21c9802daf3ab70f498f53bfe69
2021-03-23 01:13:08 -07:00
svcscm
5be924011a Updating submodules
Summary:
GitHub commits:

7a9a8f3560
4988699d50
1289946faf
8ebb6e9e54
7392d34d3b
93cfd30e14
a657b0c502
8280aa3aa7
0c0bbfbea7
cc44eafbb9
30575c26ec
8998e6f1d7
6757d70fdc

Reviewed By: bigfootjon

fbshipit-source-id: 35fc26ded7c93f6b09b2b1dcc824f1795f85f316
2021-03-22 23:31:48 -07:00
Udip Pant
805b4a9131 update URL for the libmnl to the official site
Summary: submitted by mchtech in https://github.com/facebookincubator/katran/pull/117

Reviewed By: sharmafb

Differential Revision: D27224983

fbshipit-source-id: f427f91a94ee35a48f66330e17cd56b4f9ce22c6
2021-03-22 22:50:29 -07:00
svcscm
0591dc947d Updating submodules
Summary:
GitHub commits:

da9d605903
a9ac1c3fe6

Reviewed By: bigfootjon

fbshipit-source-id: c8b977ee34c81e902f1fb196e89004a2f9b298be
2021-03-22 22:37:16 -07:00
Arun Kulshreshtha
9e251b0dce clidispatch: remove unused dispatch function
Reviewed By: quark-zju

Differential Revision: D27243030

fbshipit-source-id: 82fe0940658e760b96d0ce318415434003597d2e
2021-03-22 22:09:15 -07:00
Arun Kulshreshtha
c13c6cb4fd hg-http: tidy up imports and doc comment
Summary: Fix malformed module-level doc comment and rearrange import groups (based on the de facto Rust style conventions at FB).

Reviewed By: quark-zju

Differential Revision: D27243739

fbshipit-source-id: 21614d16e5fbfecd793939325ef52819db9a4cb8
2021-03-22 22:09:14 -07:00
svcscm
beae08540e Updating submodules
Summary:
GitHub commits:

18f15bf9be
4d87be598d
b801447eb8

Reviewed By: bigfootjon

fbshipit-source-id: 90a84e8e16413c297ec5f13f24ce3b1c8e6eeeba
2021-03-22 21:45:53 -07:00
Jun Wu
f269281622 help: hide private functions
Summary:
Hide private functions that might not have a stable interface guarantee in
`help`. For example, `help revset`:

Before:

    Predicates
    ==========

    The following predicates are supported:

    "_all()"
      All commits regardless of visibility

    "_destrestack(SRC)"
      restack destination for given single source
      revision

    "_localbranch"
      "_localbranch(changectx)" localbranch commits

After:

    Predicates
    ==========

    The following predicates are supported:

    "adds(pattern)"
      Changesets that add a file matching pattern.

      The pattern without explicit kind like "glob:" is expected to be
      relative to the current directory and match against a file or a
      directory.

Reviewed By: DurhamG

Differential Revision: D27130002

fbshipit-source-id: ee098489223c4033edeca2e5b6acab9475e63eb5
2021-03-22 20:48:58 -07:00
svcscm
10b9ca7853 Updating submodules
Summary:
GitHub commits:

023e454fff
c7fcc0ef05
46330b60f0
8ae2751679
6d7a5f0b7d
f522caa646
7f78584e76

Reviewed By: bigfootjon

fbshipit-source-id: 0925a6ac6a7e54417440d243e6fec20a0f2f6874
2021-03-22 20:38:47 -07:00
Meyer Jacobs
2e5bc61498 newstore: remove #[async_trait] use in new storage APIs
Summary:
Remove use of `#[async_trait]` in the new storage API, and eliminate the outer Future on the `fetch_stream` and `write_stream` methods, which was not used. The methods are now normal trait methods, which accept and return a stream.

It's possible we'll want to make these methods `async` again in the future, but until this this is more ergonomic, faster (one less layer of indirection), and avoids some of the type system limitations of `#[async_trait]`.

Reviewed By: andll

Differential Revision: D26695517

fbshipit-source-id: 2db60a3f37d594b0b9d1e1a2708532ef0ddaf585
2021-03-22 19:36:49 -07:00
Meyer Jacobs
bc28d0a94e newstore: Introduce FilterMapStore combinator
Summary:
Introduce `FilterMapStore` combinator to support cases like LFS, where values of the same type may or may not be supported by a given store implementation.

Use `FilterMapStore` in Python bindings to prevent LFS files from being accidentally written to the non-LFS indexedlog.

With this change, the new storage API should be safe to use without corrupting local storage.

Reviewed By: kulshrax

Differential Revision: D26651254

fbshipit-source-id: 629cb43d85f43117a32b577777e13ff8fb801d57
2021-03-22 19:36:49 -07:00
Meyer Jacobs
6d20cd3b1e newstore: HashMap-based in-memory ReadStore / WriteStore implementations for testing
Summary:
Introduce `HashMapStore`, a HashMap-based, generic, in-memory `ReadStore` / `WriteStore` implementation for testing purposes (and perhaps other uses in the future).

Introduce a minimal `KeyedValue` trait so that `HashMapStore` can determine the key to be associated with a written value in a generic way.

Reviewed By: kulshrax

Differential Revision: D26859235

fbshipit-source-id: 66032f072148796bde7a3a176fb2bb6707b95287
2021-03-22 19:36:48 -07:00
Meyer Jacobs
b51e7a510f newstore: introduce WriteError error enum and ReadWriteStore store trait
Summary:
Introduce `WriteError` type (similar to `FetchError` for reads) to support strongly-typed write errors. Eventually we'll probably want this type to carry the value that we tried to write (to allow write fallbacks, retries, etc) and perhaps add more enum variants (rejects, unavailable, etc).

Introduce `ReadWriteStore` trait for stores that support both reading and writing. This trait is automatically implemented for types which implement `ReadStore` and `WriteStore` with the same key and value types. This trait is intended to be used via the `BoxedRWStore` trait object. This type will be used in the Python bindings when `FallbackCache` is extended to implement `WriteStore` (in a future change).

Reviewed By: kulshrax

Differential Revision: D26646393

fbshipit-source-id: 96058cf1e826fdb6076a4162389829b3fe053686
2021-03-22 19:36:48 -07:00
Meyer Jacobs
c4dd06e57d newstore: python bindings for constructing newstore objects
Summary:
Introduce newfilestore class in pyrevisionstore, which constructs a newfilestore (BoxedReadStore for files) and a corresponding `ContentStore` which share the underlying IndexedLog object and EdenApi client.

Modify remotefilelog to construct ContentStore via this new class.

Currently, no methods are provided for the newfilestore - it is meant to be passed back into Rust code, where you may call it's Rust methods as shown in the `test_newstore` method (which will be removed in the future).

Currently the `util` module is made public for access from pyrevisionstore. In the future, this will be replaced in favor of a `NewFileStoreBuilder` which handles these concerns internally.

Reviewed By: DurhamG

Differential Revision: D26526331

fbshipit-source-id: c0f439fbee4c303db4a82171c866a3f3a5fc2324
2021-03-22 19:36:48 -07:00
Meyer Jacobs
c2366a0991 newstore: refactor FallbackStore to FallbackCache and Fallback
Summary:
Split `FallbackStore` (which supports writing fallback fetches) into `FallbackCache` (which behaves the same) and `Fallback` (which doesn't support writing fallback fetches). This eliminates the `From<>` bound on `Fallback` which is nonsensical in some cases where we don't want writing.

Replace `write_store` and `write` fields with a single `Option<>` `write_store` in `FallbackCache`, which cleans up the code a bit.

Separate the "fallback value type", "preferred value type", "write value type", and "output value type" separately control the output value type independent of the preferred store.

Reviewed By: kulshrax

Differential Revision: D26526149

fbshipit-source-id: aa9f25f5efb8a9ddab03a7d86a7a007f24d156ce
2021-03-22 19:36:47 -07:00
Xavier Deguillard
5a150e125a nfs: make XdrTrait<T>::serializedSize non constexpr
Summary:
While clang has no issue compiling this code, gcc appears to choke on it,
failing to compile. This is unfortunate as this means we need to hardcode the
size of the serialized datastructure and validate it with a test.

Reviewed By: fanzeyi

Differential Revision: D27243075

fbshipit-source-id: 5cd59921bbd5d5be4dfb22789942eb022dac5bbe
2021-03-22 19:27:38 -07:00
Stefan Filip
3094096af7 segmented_changelog: fix OverlayIdMap::get_last_entry
Summary:
The problem appears when we have shared idmap moving ahead of the memory idmap
before we ever write to the memory idmap. In that case we would incorrectly
fetch last shared from the shared idmap. When that shared last entry is larger
than the cutoff we would try to assign ids starting from the shared entry. When
updating the IdDag it would assume that it has to insert all ids above the
cutoff but it would fail to resolve all ids exactly above the cutoff.

For example, MemIdMap is empty, cutoff is 5, shared idmap last entry is 7. We
asign 8-10 then the IdDag tries to search for 5-10 and fails to resolve 5.

This function was not updated after adding cutoff to OverlayIdMap in an earlier
diff.

Reviewed By: quark-zju

Differential Revision: D27248367

fbshipit-source-id: 97fc1efe8cdfb446c4571196dcef7c2db9a43330
2021-03-22 18:54:23 -07:00
svcscm
55cc9bf41d Updating submodules
Summary:
GitHub commits:

810dd92300

Reviewed By: bigfootjon

fbshipit-source-id: 46fe0fe2797e97ea24e08cef3c1541abc9bef9a8
2021-03-22 16:39:45 -07:00
Stanislau Hlebik
78c1530354 mononoke: add a tunable to limit the number of commits in a push
Summary:
While Mononoke should support pushing large commits, it's not clear if we need
(or want) to support pushing a lot of commits. At the very least pushing lots of commits at the same
time can create problems with derivation, but there could be more places that might break.
Besides there's usually an easy way to work around that i.e. sqush commits or push in small batches.
If we ever need to import a lot of it we use tools like blobimport/repo_import,
so blocking pushing of lots of commits should be fine.

Reviewed By: farnz

Differential Revision: D27237798

fbshipit-source-id: 435e61110f145b06a177d6e492905fccd38d83da
2021-03-22 15:41:06 -07:00
svcscm
ff1332f773 Updating submodules
Summary:
GitHub commits:

fa8de2523a
0d800dadea

Reviewed By: bigfootjon

fbshipit-source-id: 822fac89d79829738b86dbc41a82035c9656b928
2021-03-22 15:41:06 -07:00
svcscm
87b565dc0e Updating submodules
Summary:
GitHub commits:

1021acb1de
f2d27cf4d6
4e3e01ef35
d6052d381e
f3abcb8b02

Reviewed By: bigfootjon

fbshipit-source-id: 14f4d8e5508f086c959eb5ae46648c5b8ed315d8
2021-03-22 14:40:45 -07:00
Arun Kulshreshtha
b06906d542 io: regenerate Cargo.toml
Summary: Ran autocargo on `eden/scm/lib`.

Reviewed By: quark-zju

Differential Revision: D27241613

fbshipit-source-id: 5dafc97fc104643d67368a05ced36f91ca582241
2021-03-22 14:09:45 -07:00
svcscm
f55b440d3f Updating submodules
Summary:
GitHub commits:

e6a01707cf
19f5ea0ca6
b8496fb300

Reviewed By: bigfootjon

fbshipit-source-id: 801ecf93dc02b08ff21add51546960427e4b076d
2021-03-22 12:04:09 -07:00
Arun Kulshreshtha
31d7561887 edenapi: add option to log requests
Summary:
Add an `edenapi.logdir` config option, which, when set, will cause the EdenAPI client to write a JSON version of every request it sends to the specified directory. This is intended for use when reproducing user issues (so that the developer can inspect and replay the requests that were sent).

The JSON request files can be directly given to the `edenapi_cli` or converted to CBOR using the `make_req` tool for manual testing with `curl`.

The approach right now is a bit simplistic, in that we just write a JSON file whenever the EdenAPI client makes a request. I'm open to suggestions on how to improve this. (For example, if there were a way for us to always have a record of the last N requests, that would be helpful for debugging user issues.)

Reviewed By: DurhamG

Differential Revision: D27145093

fbshipit-source-id: 3834c2052b0c5efa05d1d209962953b29f545a3f
2021-03-22 11:56:53 -07:00
Alex Hornby
9fce86450a fix rust warnings
Summary: noticed these in passing while working on previous diff

Reviewed By: mitrandir77

Differential Revision: D27227682

fbshipit-source-id: e7858c81951b780722b0836ecf6ee72aeb1ffa09
2021-03-22 11:47:55 -07:00
Jun Wu
e7ffe860c3 test-convert-git: fix test with latest git
Summary:
The latest git prints extra hints:

       $ git init repo
    +  hint: Using 'master' as the name for the initial branch. This default branch name
    +  hint: is subject to change. To configure the initial branch name to use in all
    +  hint: of your new repositories, which will suppress this warning, call:
    +  hint:
    +  hint: 	git config --global init.defaultBranch <name>
    +  hint:
    +  hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
    +  hint: 'development'. The just-created branch can be renamed via this command:
    +  hint:
    +  hint: 	git branch -m <name>
       Initialized empty Git repository in $TESTTMP/repo/.git/

Silent it to make the test pass.

Reviewed By: akushner

Differential Revision: D27235547

fbshipit-source-id: 6f7c8da3ac1e01ee9f57730e1586fa2053f9ca98
2021-03-22 10:49:09 -07:00
svcscm
cb2d853c75 Updating submodules
Summary:
GitHub commits:

e9168b4f85
254a127c7f

Reviewed By: bigfootjon

fbshipit-source-id: 2933abd1379650a379e0ed8f89a24de13b702416
2021-03-22 10:18:29 -07:00
Jan Mazur
24d2aa1442 bump region2region QPS
Summary:
We need to bump SCS counters expressing Mononoke's QPS. They will look something like:
`requests:mononoke:oregon:carolina` for requests coming from proxygen in prn and mononoke in frc.

CSLB expects regions' full names.

We're getting src region from proxygen as a header.

Reviewed By: krallin

Differential Revision: D27082868

fbshipit-source-id: 12accb8a9df5cf6a80c2c281d2f61ac1e68176d1
2021-03-22 10:12:43 -07:00
svcscm
57acf98236 Updating submodules
Summary:
GitHub commits:

1687a0fd59

Reviewed By: jurajh-fb

fbshipit-source-id: a362a049e51a819986bdf685a1c1f78ed6815f77
2021-03-22 07:29:25 -07:00
Mark Juggurnauth-Thomas
46e3a31d10 repo_derived_data: add new repo attribute to encapsulate derived data
Summary:
Add `repo_derived_data`.  This is a new struct that encapsulates derived data
configuration and lease operations, and will be used in the facet-based
construction of repositories.

Reviewed By: ahornby

Differential Revision: D27169431

fbshipit-source-id: dee7c032deb93db8934736c111ba7238a6aaf935
2021-03-22 07:26:48 -07:00
Mark Juggurnauth-Thomas
3d6160f216 repo_identity: add new repo attribute to encapsulate identity
Summary:
Add `repo_identity`.  This is a new struct that encapsulates repository
identity and will be used in the facet-based construction of repositories.

Reviewed By: ahornby

Differential Revision: D27169445

fbshipit-source-id: 02a435bba54a633190c6d2e4316e86726aecfdf0
2021-03-22 07:26:48 -07:00
Mark Juggurnauth-Thomas
db324150a1 blobrepo: make attributes real members again
Summary:
In preparation for making `BlobRepo` buildable by facet factories, restore
`BlobRepo` members that had been converted to `TypeMap` attributes back into
real members.

This re-introduces some dependencies that were previously removed, but this
will be cleaned up when crates no longer have to depend on BlobRepo directly,
just the traits they are interested in.

Reviewed By: ahornby

Differential Revision: D27169422

fbshipit-source-id: 14354e6d984dfdd2be5c169f527e5f998f00db1e
2021-03-22 07:26:47 -07:00
Mark Juggurnauth-Thomas
c83baeb00d segmented_changelog: split trait to separate crate
Summary:
Resolve a circular dependency whereby `BlobRepo` needs to depend on
`Arc<dyn SegmentedChangelog>`, but the segmented changelog implementation
depends on `BlobRepo`, by moving the trait definition to its own crate.

Reviewed By: sfilipco

Differential Revision: D27169423

fbshipit-source-id: 5bf7c632607dc8baba40d7a9d65e96e265d58496
2021-03-22 07:26:47 -07:00
Liubov Dmitrieva
77a1beb917 improve output of hg cloud status command for a renamed current workspace
Summary:
a workspace could be renamed from a different machine

educate users that they need to switch to a valid workspace

Reviewed By: markbt

Differential Revision: D27155544

fbshipit-source-id: eed066f2f3e6ebf99732499fdb355f8aebb4c1df
2021-03-22 07:03:17 -07:00
Liubov Dmitrieva
029a5b5d5a improve output of hg cloud list command for a renamed current workspace
Summary:
this could happen if it has been removed from a different machine

In this case, we should educate the users about the '--force' option

Reviewed By: markbt

Differential Revision: D27155423

fbshipit-source-id: 41cc3ac769dfd4145031fef687e8069d0ef8f4c9
2021-03-22 07:03:17 -07:00
Liubov Dmitrieva
072dcd06a2 provide better ux for switching workspace if the current workspace has been renamed
Summary:
provide better ux for switching workspace if the current has been renamed from another machine

sometimes users rename a workspace but it's unclear for them how to switch other machines to the new one

we should educate them about '--force' option

Reviewed By: markbt

Differential Revision: D27117194

fbshipit-source-id: faef1cf9ce64f054f715ef3683a133d3088ddc72
2021-03-22 07:03:16 -07:00
svcscm
8669a10663 Updating submodules
Summary:
GitHub commits:

cc13f6cff5
edc68a125b

Reviewed By: jurajh-fb

fbshipit-source-id: 0749bfe35dfddd7212b8a8b9c87397e863a43743
2021-03-22 06:51:09 -07:00