Commit Graph

63914 Commits

Author SHA1 Message Date
Mark Juggurnauth-Thomas
e9806d5a6f scs_server: commonize methods that resolve two commits
Summary:
Several methods (`commit_compare`, `commit_is_ancestor_of`, `commit_file_diffs`
and `commit_common_base_with`) operate on a pair of commits.  Currently these
all resolve the other commit manually and in different ways.  Commonize the
code, and add contextual information so the caller can see which of the two
commits failed to resolve.

Reviewed By: StanislavGlebik

Differential Revision: D27079920

fbshipit-source-id: a2b735801ed75232dd302061aaff2da23448d812
2021-03-16 08:02:20 -07:00
Mark Juggurnauth-Thomas
ee82a59544 scs_server: add context for service errors
Summary:
Add a `.context` method for `ServiceError`, which allows the addition of
context information in errors.

Since these are wrapped Thrift errors, we can't use the usual error-chain
mechanism of `std::error::Error`.  Instead, we just prepend the message that
the Thrift client will see with the context.

Add an extenstion to `Result` for results that contain an error that can be
converted into a `ServiceError` to allow the addition of context when
processing a chain of `Result`s.

Reviewed By: StanislavGlebik

Differential Revision: D27079921

fbshipit-source-id: a1200f44346530c91bd559f4be0ca2b04f7d4480
2021-03-16 08:02:20 -07:00
Toan Mai
adb30561fc Autocargo-ed serde_php (#80)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/80

Trying to use this in `ctp` codebase, where most things are autocargo compatible.
Looks like it can be auto-cargoed as it doesn't have any fancy deps.

So I followed the instructions here to make that happen:
https://www.internalfb.com/intern/wiki/Rust-at-facebook/Cargo.toml_from_Buck_(autocargo)/

Reviewed By: farnz

Differential Revision: D27079404

fbshipit-source-id: 83c10c2899a6a0da52c8f3379c9fbfcde5052eea
2021-03-16 07:52:34 -07:00
Stanislau Hlebik
01b6a2faa8 mononoke: init cachelib only once and add more logging
Summary:
Initializing twice causes it to fail. Let's not do that, and also let's use
init_mononoke function instead of our adhoc logger and runtime creationg (at
the very least it also initializes tunables and sets correct tokio runtime
parameters).

Also let's add more logging to see the progress of uploading

Reviewed By: ahornby

Differential Revision: D27079673

fbshipit-source-id: 940135a9aed62f7139835b2450a1964b879e814b
2021-03-16 06:20:00 -07:00
Stanislau Hlebik
2e3b7d0a65 mononoke: add --skip-last-chunk argument to streaming changelog
Summary:
The way I plan to use new streaming_changelog in prod is by running it
periodically (say, every 15 mins or so). However some repos won't get many
commits in the last 15 mins (in fact, they might get just 1 or 2).
And even for high commit rate repos most of the times the last chunk
will not be a full chunk (i.e. it will be less that --max-data-chunk-size).

If we were just uploading last chunk regardless of its size then the size of
streaming changelog database table would've just keep growing by 1 entry every
15 mins even if it's completely unnecessary. Instead I suggest to add an option
to not upload the last chunk if it's not necessary.

Reviewed By: farnz

Differential Revision: D27045681

fbshipit-source-id: 2d0fed3094944c4ed921f36943b881af394d9c17
2021-03-16 03:29:54 -07:00
Stanislau Hlebik
fb4c1544b9 mononoke: add update command to streaming changelog
Summary:
This command can be used to update already existing streaming changelog.
It takes a newly cloned changelog and updates the new streaming changelog
chunks in the database.

The biggest difference from "create" command is that we first need to figure
out what's already uploaded to streaming changelog. For that two new methods
were added SqlStreamingChunksFetcher.

Reviewed By: farnz

Differential Revision: D27045386

fbshipit-source-id: 36fc9387f621e1ec8ad3eb4fbb767ab431a9d0bb
2021-03-16 03:29:54 -07:00
Stanislau Hlebik
d7d3064a79 mononoke: refactor upload_chunks_to_blobstore
Summary:
Small refactoring that will be used in the next diff. In the next diff we'll add
"update" command, and this command will specify the chunk number's itself.

So let's move setting chunk numbers from upload_chunks_to_blobstore function

Differential Revision: D27045387

fbshipit-source-id: c5387a60841fe184c6db5edc4812ddd409eb2215
2021-03-16 03:29:54 -07:00
Stanislau Hlebik
7163c47c82 mononoke: refactor split_into_chunks a bit
Summary:
Small refactoring that makes a few things easier to do in the later diffs:

1) Adds a verification that checks the data offset
2) We now read the first chunk's offset from revlog, instead of hardcoding it
to 0, 0. This will be useful in "update" commands which needs to skip revlog
entries that already exists in the database

Differential Revision: D27045388

fbshipit-source-id: 4ee80c96d9307c77b1108889e457f10e83c8beb7
2021-03-16 03:29:54 -07:00
svcscm
5de2ae9a40 Updating submodules
Summary:
GitHub commits:

e0f215a938
d99e84ce17

Reviewed By: jurajh-fb

fbshipit-source-id: 26080b0f98f40296e6a61d3675f12cd85e319619
2021-03-16 03:29:53 -07:00
svcscm
647368f8ac Updating submodules
Summary:
GitHub commits:

040b38e2fa

Reviewed By: jurajh-fb

fbshipit-source-id: 3e419de90e3a566a82fc48367d5e5b098a7ae7c2
2021-03-16 00:44:28 -07:00
Anna Kukliansky
d54bb04c4f Handle unused variables
Summary: got this from here: https://stackoverflow.com/questions/1486904/how-do-i-best-silence-a-warning-about-unused-variables

Reviewed By: mzlee

Differential Revision: D27037968

fbshipit-source-id: b5b7ae30fdc192e3d99d3ed857209761a56b5e6f
2021-03-15 23:56:08 -07:00
Stanislau Hlebik
3d8cf49381 mononoke: fix getdeps build
Summary: Duplicate name caused getdeps build to fail. This diff fixes it

Reviewed By: krallin

Differential Revision: D27049661

fbshipit-source-id: b23fe52ad89cbe764e656dfe960921ff1ac92b32
2021-03-15 23:07:45 -07:00
Anna Kukliansky
b8be7b6b29 fix compilation error of missing type
Summary:
example failure:https://www.internalfb.com/intern/buck/build/89566c50-0f40-4940-bee8-c58e4597db69/

{F508857478}

Reviewed By: mzlee

Differential Revision: D27037961

fbshipit-source-id: dd77219870f368586567b4acf2247cde2855042e
2021-03-15 22:31:25 -07:00
Andrey Chursin
a43d7c5029 checkout: log when native checkout is used to scuba
Reviewed By: DurhamG

Differential Revision: D27064447

fbshipit-source-id: aabb79657e6e48779126733d0ab2b326c91e807e
2021-03-15 21:58:48 -07:00
svcscm
7fdd69d7db Updating submodules
Summary:
GitHub commits:

93ea6d5d92

Reviewed By: jurajh-fb

fbshipit-source-id: 54b298dc748749b751349c46176ebe52a3886f87
2021-03-15 21:33:26 -07:00
Jun Wu
f2ed2600d2 test-sparse-fetch: improve robustness
Summary:
`hg stauts` can be "indeterministic" because of the last second mtime fix
special rule (see pytreestate/src/lib.rs:invalidatemtime).
The test sometimes fails like:

  test-sparse-fetch-t.py:140: [] != ['x', 'x/x']

Update it to support both `[]` and `['x', 'x/x']` case.

Reviewed By: sfilipco

Differential Revision: D27071225

fbshipit-source-id: c413906897b408c1e85912852afed1717a87ffc9
2021-03-15 20:04:54 -07:00
svcscm
f12b7b9531 Updating submodules
Summary:
GitHub commits:

eef86a2526
bd470d9232

Reviewed By: jurajh-fb

fbshipit-source-id: 71c018c51a52bfb2bd4e2580741ce92364ccad29
2021-03-15 19:39:10 -07:00
Jun Wu
b8fa495ea8 indexedlog: make finalize_indexes report more detailed error
Summary:
The error was triggered but it's unclear what's wrong. Make the error
more detailed.

Reviewed By: xavierd

Differential Revision: D27058212

fbshipit-source-id: 3f6220e2d100d9118c05a8b4c75c5ba19c9181db
2021-03-15 18:49:16 -07:00
Jun Wu
e312b57623 doctor: repair segmented changelog
Summary: Add repair logic for segmented changelog.

Reviewed By: sfilipco

Differential Revision: D27057695

fbshipit-source-id: 2c1c367ce161e830219f449993fbf371f9330f16
2021-03-15 18:45:07 -07:00
Jun Wu
b573e1b866 pydag: add API to repair NameDag
Summary: This will be used by `doctor` command.

Reviewed By: sfilipco

Differential Revision: D27053349

fbshipit-source-id: bc33e25997f30107f919a090ff68693bfdd7199d
2021-03-15 18:45:07 -07:00
Jun Wu
a904d5606d dag: move MultiLog OpenOptions to a DefaultOpenOptions
Summary:
By implementing DefaultOpenOptions, indexedlog provides `repair()` for free.

Re-export the `Repair` trait so other crates can use `repair()` without
importing indexedlog.

Reviewed By: sfilipco

Differential Revision: D27053352

fbshipit-source-id: 8fa952f0e51e007b9d348bc12699ef1d65000c6b
2021-03-15 18:45:07 -07:00
Jun Wu
6e85ede2c1 indexedlog: implement repair for MultiLog
Summary:
With the new log for MultiMeta. It's now possible to repair a MultiLog by:
- Repair all Logs
- Scanning through the MultiMeta Log and find a valid MultiMeta.
- Set the current MultiMeta to the picked MultiMeta.

Reviewed By: sfilipco

Differential Revision: D27053346

fbshipit-source-id: d60596fb00323b3bcadd5ade2e34cad29a37d64a
2021-03-15 18:45:07 -07:00
Jun Wu
f2f7d49a0a indexedlog: make a few APIs crate visible
Summary: They will be used later.

Reviewed By: sfilipco

Differential Revision: D27053348

fbshipit-source-id: 85b534873a4470532cde1f2b201469a034f08d55
2021-03-15 18:45:07 -07:00
Jun Wu
568ad7a7cb indexedlog: track multilog meta in a separate log
Summary:
We recently saw a few reports about "multimeta" being 0-sized. MultiLog cannot
be repaired like other logs because the logs (ex. IdDag and IdMap) have to be
in sync. To implement Repair for MultiLog, let's track MultiMeta in a Log so
we can check its previous entries and fix the multimeta.

Reviewed By: sfilipco

Differential Revision: D27053347

fbshipit-source-id: af99b13d658ee62bfe63973ab9d37338d14a7d4a
2021-03-15 18:45:06 -07:00
svcscm
9ca5307ece Updating submodules
Summary:
GitHub commits:

7e6ca6211c
11dbd0fa9e
0304352882
309e176b50
b1e22bfa63

Reviewed By: jurajh-fb

fbshipit-source-id: aec2d2abc8446de53d2abed370024ac136c839b9
2021-03-15 18:31:04 -07:00
Jun Wu
7eea44ce4e test-doctor: improve robustness
Summary:
The test failed sometimes on Linux:

    --- test-doctor.t
    +++ test-doctor.t.err
    @@ -204,11 +204,11 @@
       M A2
       A A0
         A
    -  A X
       R A
       R A1
       ? B
       ? C
    +  ? X
       ? Y
       ? Z

The treestate fix appears to rollback to even a previous version, which is also
a valid fix. Let's accept that state too.

Reviewed By: DurhamG

Differential Revision: D27064825

fbshipit-source-id: 6aab04e66ad14ad651f93805c9652c7423178665
2021-03-15 18:22:50 -07:00
Jun Wu
c554c56494 test-fb-hgext-fastlog: improve robustness
Summary:
The test failed sometimes on OSX:

    --- test-fb-hgext-fastlog.t
    +++ test-fb-hgext-fastlog.t.err
    @@ -34,6 +34,7 @@
       $ hg log dir -T '{desc}\n'
       b
       a
    +  Exception in thread Thread-3 (most likely raised during interpreter shutdown): (no-eol)
       $ hg log dir -T '{desc}\n' --all
       b
       a2

The threading usage in fastlog does seem kind of risky (especially with async
Rust involved). Race condition in Py_Finalize is not at all fun. Let's just
make the test more robust for now. In the future we probably want to avoid
threading in fastlog.

Reviewed By: DurhamG

Differential Revision: D27064618

fbshipit-source-id: a6c2ee5eda0fbd5120c8b5e5cfcc7af0f158f9b9
2021-03-15 18:22:50 -07:00
svcscm
e3a5ef82a5 Updating submodules
Summary:
GitHub commits:

da1db045c8
29de57bd80
57dd09c4b1
a3d96403ad
d5207ca6a7
09d47890a3
953ee4420c

Reviewed By: jurajh-fb

fbshipit-source-id: 203df3dc9357de611eb7b6b65c1136d924e461d7
2021-03-15 17:59:12 -07:00
Jun Wu
a4912b15c7 tests: fix flakiness of test-fb-hgext-remotefilelog-repack-remove-old.t
Summary:
The test is failing:

    --- test-fb-hgext-remotefilelog-repack-remove-old.t
    +++ test-fb-hgext-remotefilelog-repack-remove-old.t.err
    @@ -63,7 +63,7 @@
       -r--r--r--      80 *.datapack (glob)
       -r--r--r--      80 *.datapack (glob)
       -r--r--r--      80 *.datapack (glob)
    -  -r--r--r--     144 *.datapack (glob)
    +  -r--r--r--      80 ef52660a201e447b43868610b08c72e22067b8b2.datapack

We are migrating away from repack so I just made the test pass without
investigating what's going on exactly.

Reviewed By: sfilipco

Differential Revision: D27064249

fbshipit-source-id: 6bcd583b6ecbe0b373d9fec2b23269b0da6a27f3
2021-03-15 16:00:20 -07:00
svcscm
8a0db1263b Updating submodules
Summary:
GitHub commits:

f4c2569375
38fd96f823
85d4f2c8b3
47daf13d1d
4e7dbd0a69

Reviewed By: jurajh-fb

fbshipit-source-id: 991af3e5746eebf77a1578167ed59235afeef448
2021-03-15 15:51:09 -07:00
Arun Kulshreshtha
0e6eba5880 edenapi_service: add edenapi prefix to scuba column names
Summary: Now that EdenAPI requests are being logged to the same dataset as regular requests (`mononoke_test_perf`), let's prefix the EdenAPI-specific columns with `edenapi_` to avoid confusion.

Reviewed By: krallin

Differential Revision: D26896670

fbshipit-source-id: 92a0710ff1a7297c9cf46ff9bd9576c9bc155e26
2021-03-15 15:44:34 -07:00
Anna Kukliansky
8da39ce0ae supress deprecated error for INSTANTIATE_TEST_CASE_P
Summary:
suppress the deprecated errors.
found something similar in here: https://stackoverflow.com/questions/1902021/suppressing-is-deprecated-when-using-respondstoselector

example failure:
https://www.internalfb.com/intern/buck/build/a3b550b8-4099-4f27-8975-5bfffd6447e5/

```
eden/fs/inodes/test/OverlayTest.cpp:730:1: error:
'InstantiateTestCase_P_IsDeprecated' is deprecated: INSTANTIATE_TEST_CASE_P is deprecated, please use INSTANTIATE_TEST_SUITE_P [-Werror,-Wdeprecated-declarations]
INSTANTIATE_TEST_CASE_P(
/Users/kuki/fbsource/third-party/googletest/googletest/include/gtest/gtest-param-test.h:507:38:
 note:  expanded from macro 'INSTANTIATE_TEST_CASE_P'
  static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \
/Users/kuki/fbsource/third-party/googletest/googletest/include/gtest/internal/gtest-internal.h:1209:1:  note: 'InstantiateTestCase_P_IsDeprecated' has been explicitly marked deprecated here
GTEST_INTERNAL_DEPRECATED(
/Users/kuki/fbsource/third-party/googletest/googletest/include/gtest/internal/gtest-port.h:2215:59:
note: expanded from macro 'GTEST_INTERNAL_DEPRECATED'
#define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message)))
```

Reviewed By: mzlee

Differential Revision: D27037957

fbshipit-source-id: b12cc500441c9ed4ed72825475c57047fb0c2076
2021-03-15 15:29:12 -07:00
svcscm
cf60ef2537 Updating submodules
Summary:
GitHub commits:

51f3e92ca0
9a474aeccf

Reviewed By: jurajh-fb

fbshipit-source-id: 348d3a6b297f9658b43a835cb9cf45a9bdc2a120
2021-03-15 15:29:12 -07:00
svcscm
d059f33320 Updating submodules
Summary:
GitHub commits:

d7a1aef366

Reviewed By: jurajh-fb

fbshipit-source-id: dbc2d6f3c18bb56ab9d9579583774fca78871935
2021-03-15 13:53:27 -07:00
svcscm
84275d05b3 Updating submodules
Summary:
GitHub commits:

709a844f67
2b5c2ca8db
7a316277a7
aa610583f3
cba0c9cb89
94e0d47059
bed94de6d0
f393df2585

Reviewed By: jurajh-fb

fbshipit-source-id: f1308ffd4e92c41208310d3ec53e8d3eea72d875
2021-03-15 13:53:27 -07:00
svcscm
ee37e0a635 Updating submodules
Summary:
GitHub commits:

b4f7d82218
e6fbe06b82
e0ba09cf75
316ef4fbba

Reviewed By: jurajh-fb

fbshipit-source-id: 931e35abddf90e761713853191abc83ff41d862b
2021-03-15 12:50:01 -07:00
Zeyi (Rice) Fan
af1f5d62ee overlay: use PersistentSqliteStatement in TreeOverlayStore
Summary: This diff replaces `SqliteStatement` in `TreeOverlayStore` with the new `PersistendSqliteStatement`.

Reviewed By: chadaustin

Differential Revision: D26656314

fbshipit-source-id: dbbfeddd52d3be2a1b5d3b6121d3694c41841fd5
2021-03-15 12:01:48 -07:00
Zeyi (Rice) Fan
e79aa979ce overlay: add StatementCache to SqliteOverlay
Summary: This diff adds `StatementCache` to `SqliteOverlay` for reusing prepared `SqliteStatement`.

Reviewed By: chadaustin

Differential Revision: D26656316

fbshipit-source-id: de3fb2bf2a1ec3f057118308287802bd9babcef4
2021-03-15 12:01:48 -07:00
Zeyi (Rice) Fan
89b98ecba6 sqlite: persist statements used in SqliteDatabase
Summary: This diff introduce `StatementCache` for `SqliteDatabase` for caching transaction related SQLite statements.

Reviewed By: chadaustin

Differential Revision: D26656312

fbshipit-source-id: db8b061baa187c9540d1a1a5fcf2f95c3b8a40d0
2021-03-15 12:01:48 -07:00
Zeyi (Rice) Fan
6bba048ea7 sqlite: make SqliteStatement persistent
Summary:
This diff makes `SqliteStatement` to construct persistent statement by default.

This change should be harmless if the caching assumption is not true. If the statement is not cached by the caller, it's probably on a non-critical path.

Reviewed By: chadaustin

Differential Revision: D26639365

fbshipit-source-id: 26af6ccdba036dc0fccf774e9ffb6bb2a014c5ff
2021-03-15 12:01:48 -07:00
Zeyi (Rice) Fan
6162023789 sqlite: split Sqlite.h
Summary: This diff splits Sqlite.h into smaller files so it's easier to change.

Reviewed By: xavierd

Differential Revision: D26656315

fbshipit-source-id: 8156b1d8feef47e5bad4ab66ad5f5f96cf32547e
2021-03-15 12:01:47 -07:00
Zeyi (Rice) Fan
1651dd1898 inodes: implement non-Windows virtual functions for SqliteOverlay
Summary: This diff implements the newly added methods to `IOverlay` so we can build & test `SqliteOverlay` on devserver.

Reviewed By: chadaustin

Differential Revision: D25283647

fbshipit-source-id: 50d0c2dd47cd8f74c860a131ffad1d6342a86ea2
2021-03-15 12:01:47 -07:00
generatedunixname89002005307016
41c3dff77f Add annotations to eden/fs/cli/doctor/test/stale_mount_test.py
Reviewed By: xavierd

Differential Revision: D27038411

fbshipit-source-id: ccaebafebe97767b84981f5c654ce207efed0a87
2021-03-15 09:58:09 -07:00
Alex Hornby
44cff08838 mononoke: add --read-count option to benchmark_filestore
Summary: Was fixed at 2 reads, add an option to allow testing read performance more throughly.

Reviewed By: farnz

Differential Revision: D27043234

fbshipit-source-id: 4bb5f49007a4fa67c42e872e236417fa5ce5c9a0
2021-03-15 08:50:09 -07:00
svcscm
a56d27e188 Updating submodules
Summary:
GitHub commits:

50c72c1ced
386f6a840e

Reviewed By: yns88

fbshipit-source-id: 82671bc1516fdf444579782314ac3737373b773e
2021-03-15 08:36:51 -07:00
Thomas Orozco
7ad1561b68 mononoke/fileblob: create tempfiles in blobstore location
Summary:
Right now, fileblob crashes if those two things are on different devices
(because you cannot atomically rename across devices), so you need to make sure
your TMPDIR is on the same volume as your fileblob.

This is kinda annoying and kinda unnecessary. Let's just fix default to putting
the temporary files into the same location as the blobstore.

Note: while the temp files will be in the same directory as the rest of our
blobs, they don't have the `blob-` prefix (their prefix will be `.tmp`), so
they cannot be read by accident as if they were blobs.

Reviewed By: farnz

Differential Revision: D27046889

fbshipit-source-id: c2b47cd6927eef34ac19325f87f446a6f6532eaf
2021-03-15 08:32:59 -07:00
svcscm
ca7bba10eb Updating submodules
Summary:
GitHub commits:

30b97aab8e
ab90cf2314
3dff28cf9b

Reviewed By: yns88

fbshipit-source-id: 568d12839a4b91a8c31c232460b4191bd45abff5
2021-03-15 05:50:22 -07:00
Alex Hornby
76e60fd0da mononoke: use the constants in benchmark_filestore
Summary: Tidy up a bit and use the constants

Reviewed By: krallin

Differential Revision: D27043233

fbshipit-source-id: 3208e2f35c67b4b22bb5f8189cd8c5b399604833
2021-03-15 03:53:41 -07:00
svcscm
f376508548 Updating submodules
Summary:
GitHub commits:

084d5a26f7
b1127fc4ed

Reviewed By: yns88

fbshipit-source-id: a611ed5034b14090e0488f1d827ce941d678ede4
2021-03-15 03:53:41 -07:00
svcscm
54cafadd31 Updating submodules
Summary:
GitHub commits:

634d499f22

Reviewed By: yns88

fbshipit-source-id: f32e54ba63788710738175f350dd0e69886e9700
2021-03-14 17:23:38 -07:00