Commit Graph

58182 Commits

Author SHA1 Message Date
Xavier Deguillard
d40d5360b0 prjfschannel: do not do IO in the constructor
Summary:
This will simplify some later diffs where the channel construction doesn't
change any state.

Reviewed By: fanzeyi

Differential Revision: D21797077

fbshipit-source-id: 67d9ee693b067a08986e9bd33f9d91f9a1dadac1
2020-06-10 19:29:36 -07:00
Xavier Deguillard
c5b06ecc0f prjfschannel: remove re-creation of mount directory
Summary: This is already created, no need for re-recreating it.

Reviewed By: fanzeyi

Differential Revision: D21676314

fbshipit-source-id: 8e3eecfb6069f9bed5bfec7ad6631ed8830d796d
2020-06-10 19:29:35 -07:00
Xavier Deguillard
e83578d0b6 prjfschannel: move the static function out of the class
Summary:
These are pure implementation details of ProjectedFs, and don't need to be in
the class, let's move them onto an anonymous namespace in the cpp file.

Reviewed By: chadaustin

Differential Revision: D21676315

fbshipit-source-id: 4fa7088a10256581d7eed2c7cbd90c30a7fef3d2
2020-06-10 19:29:35 -07:00
Xavier Deguillard
7baa3c3bc0 prjfschannel: inline initialize the notification mapping
Summary:
I find this approach to be slighly less error prone due to not having
to manually specify the array size in advance. We lose the field names,
but they should be pretty self explanatory.

Reviewed By: chadaustin

Differential Revision: D21676319

fbshipit-source-id: db4dc993d3dd2a502ae188b08b8d4230939c0415
2020-06-10 19:29:35 -07:00
Xavier Deguillard
3f7a0c519f prjfschannel: use RelativePathPiece instead of wchar_t*
Summary:
This moves the edenToWinPath inside Windows specific files and makes
the interface clear about the kind of path that is expected.

Reviewed By: fanzeyi

Differential Revision: D21676318

fbshipit-source-id: d153bb543da5f481e94f83d52e45c6cc871d1f54
2020-06-10 19:29:34 -07:00
Xavier Deguillard
a29cd80510 mount: remove the need for setFsChannel in tests
Summary:
The only reason tests need to set an FsChannel is for calling
cleanupPrjfsCache. For consistency sake, let's do the same as what we do on
unices: verify if we have a valid channel first.

Reviewed By: wez

Differential Revision: D21676316

fbshipit-source-id: 022ca91d32a7ab047a79acccd7d17dfd7906d527
2020-06-10 19:29:34 -07:00
Xavier Deguillard
d559d2d217 mount: remove most of the ifdef in EdenServer::mount
Summary:
The only missing piece on Windows is the bind mount/redirection due to
folly::Subprocess not being present on Windows.

Reviewed By: wez

Differential Revision: D21676313

fbshipit-source-id: a5ba09be04c94b66edf9d40884753afa3865def2
2020-06-10 19:29:34 -07:00
Xavier Deguillard
1844b98457 mount: rename the various mount/unmount promises
Summary:
We want to use these on Windows too, so let's rename them to not be FUSE
specific.

Reviewed By: wez

Differential Revision: D21676317

fbshipit-source-id: 9f1bde9e0467d8828d4168a69581c8fea54669cd
2020-06-10 19:29:33 -07:00
Xavier Deguillard
e28113b695 mount: move setFsChannel
Summary:
This moves it out of EdenServer and into EdenMount directly. This is closer
to what is happening in the Linux code and thus better.

Reviewed By: fanzeyi

Differential Revision: D21663501

fbshipit-source-id: 84420fcb37586cc2695568f0167b39f91c9bfb63
2020-06-10 19:29:33 -07:00
Xavier Deguillard
74404f1b41 mount: unify EdenMount::start
Summary:
Instead of having 2 different functions for Windows and other unices, let's
only have one. This allows more of the mount code to be shared between both.

Reviewed By: wez

Differential Revision: D21517477

fbshipit-source-id: 185ce864aecdf9a7880a9c705df444ec1e39319a
2020-06-10 19:29:32 -07:00
Mark Thomas
1105b8a9b0 mononoke_api: add service permission checker
Summary:
Add a permission checker that verifies that the user is permitted to make
requests on behalf of a service.  This uses a different ACL than the usual repo
ACL.

Reviewed By: mitrandir77

Differential Revision: D21886531

fbshipit-source-id: bceb63aed12c11ebe2a3d65a2560c014267b0e20
2020-06-10 19:29:32 -07:00
Mark Thomas
2ad3269a29 metaconfig: add types and parser for Source Control Service params
Reviewed By: mitrandir77

Differential Revision: D21886535

fbshipit-source-id: a12e7e8a3d2f70ece13e4fc736acbbf12e79d1e0
2020-06-10 19:29:32 -07:00
Mark Thomas
0780f00ef9 metaconfig/parser: wrap regexes in a newtype for comparisons
Summary:
Regexes stored in config need to be comparable so that config is comparable.

Normally regexes are not comparable, so wrap them in a newtype wrapper that
implements comparison, rather than manually implemented PartialEq and Eq for
anything that contains them.

Reviewed By: mitrandir77

Differential Revision: D21886533

fbshipit-source-id: 1fb39c0874daed383624eeda61c903a4731b9cb8
2020-06-10 19:29:31 -07:00
Mark Thomas
1b549f73a9 mononoke_api: move create_changeset into its own file
Summary:
The repository write methods are likely to get fairly large.  Move
`create_changeset` to its own module so that we can add future methods as
separate modules.

Reviewed By: mitrandir77

Differential Revision: D21886532

fbshipit-source-id: 08de34a400d056bc97cf6e54856f2a2fd185814c
2020-06-10 19:29:31 -07:00
Stanislau Hlebik
ffd60c01b0 blobimport: do not use batch_derive
Summary:
batch_derive() is a dangerous function to use. I'd love to delete it but this
function is very useful for backfilling, so unfortunately I can't.

The problem arises when one tries to backfill blame and unodes simultaneously
(or just derive blame  which in turn derives unodes). While batch_derive()
tries to be careful with inserting "outer" derived data's mappings (i.e. blame
mapping), it doesn't do it for inner derived data mappings (i.e. unodes). So we
might end up in the situation where we insert unodes mapping before we inserted
all the manifests for it. If this thing fails in the middle of derivation then
we have a corruption.

Let's do not use it in blobimport. It will make derivation slower, but I'd
rather make it slower than incorrect.

Reviewed By: farnz

Differential Revision: D21905619

fbshipit-source-id: c0227df195a8cf4482b2452ca928acbc5750b3e5
2020-06-10 19:29:31 -07:00
Kostia Balytskyi
8cda84ca26 infinitepush: add an ability to disable writes on servers
Summary: This will be very useful when we migrate to Mononoke.

Reviewed By: StanislavGlebik

Differential Revision: D21912115

fbshipit-source-id: 1ed2204f17f90152a67fd4e10b0ae61aacfc41d7
2020-06-10 19:29:30 -07:00
Johan Schuijt-Li
1d4c5cbfc4 mononoke: replace instances of whitelist/blacklist/blackhole
Summary:
There are people that are hurt by usage of these terms, this should be more
then enough reason to replace these. Newly chosen terms are more
self-explanatory as well.

This doesn't yet touch the actualy config files, as that requires a bit more
effort than 1 diff and will require more coordination.

Reviewed By: krallin

Differential Revision: D21924440

fbshipit-source-id: e24fc638dc8c9d6d20b6f3fa5f0d0bbc91bbf77b
2020-06-10 19:29:30 -07:00
Stanislau Hlebik
6ca1d57cb8 mononoke: add an integration test where filenodes are disabled
Summary:
This test checks that we can start Mononoke and serve pull/push/update with
filenodes

Reviewed By: ahornby

Differential Revision: D21904753

fbshipit-source-id: 86690c5ed5ce7d022844809b09beb25c7961cac8
2020-06-10 19:29:29 -07:00
Stanislau Hlebik
6f9e685a1a mononoke: add counters for fetching disabled filenodes
Summary: Let's log to ods so that we can check what's hapenning with filenodes.

Reviewed By: ahornby

Differential Revision: D21904400

fbshipit-source-id: e602dfc338c02252cad286176a1965bdc7043d7f
2020-06-10 19:29:29 -07:00
Stanislau Hlebik
14e4d561b3 mononoke: add_filenodes now return FilenodeResult and removes TODO
Summary:
This diff migrates add_filenodes method to return FilenodeResult.
That means that all filenodes methods now return FilenodeResult and it's time
now to remove TODOs from derived_data filenodes.

Note that I had to change the test "derive_disabled_filenodes" a bit.
Previously FilenodesOnlyPublic::mapping::get() method immediately returned
FilenodesOnlyPublic::Disabled, while now it returns None if hg changeset is not
derived. This is an expected change in behaviour, so I just updated the test to
try to derive FilenodesOnlyPublic first, which in turns triggers generation of hg changeset.

Reviewed By: ahornby

Differential Revision: D21904401

fbshipit-source-id: f6f4cd14e6cdce5a4b95d8f3f9acff305ae6fa88
2020-06-10 19:29:29 -07:00
Stanislau Hlebik
c34cfd9bbf mononoke: make get_filenode() return FilenodeResult
Summary:
Similar to get_all_filenodes_maybe_stale() make this method return
FilenodeResult if filenodes are disabled.

Note: this diff adds one TODO in fetch_root_filenode, which will be removed
together with other TODOs in the next diff.

Reviewed By: ahornby

Differential Revision: D21904399

fbshipit-source-id: 1569579699c02eb07021f8143aa652aa192d23bc
2020-06-10 19:29:28 -07:00
svcscm
3df579d412 Updating submodules
Summary:
GitHub commits:

f2162bf3a2
db790541cf
a86d55b5bc

Reviewed By: yns88

fbshipit-source-id: 893d01bd34383614a1370a118e37b08d768a8ba9
2020-06-10 19:29:28 -07:00
Mark Thomas
860594a0e6 streampager: fix progress rendering
Summary:
With the internal streampager, progress bars must be sent on a separate stream so that
streampager can render them correctly.

Reviewed By: quark-zju

Differential Revision: D21906173

fbshipit-source-id: eb41b0bf22807d9cae518b3f676996ab1c642c6e
2020-06-10 19:29:28 -07:00
Mark Thomas
ce3d15ef1d upgrade streampager to 0.8
Summary: Upgrade the internal streampager to the latest version, which includes line wrapping.

Reviewed By: quark-zju

Differential Revision: D21906172

fbshipit-source-id: 1bc63723f55ac115090e7ae0a2541158863056b9
2020-06-10 19:29:27 -07:00
svcscm
9f4c294d16 Updating submodules
Summary:
GitHub commits:

3c33c3cf99
e778b84267
709df14fc2
59a44176fa

Reviewed By: yns88

fbshipit-source-id: 76e5d7dc343d1fa82b0ea14ffbddffd8dea97257
2020-06-10 19:29:27 -07:00
Jun Wu
3ab369827a test-clone: enable visibility
Summary: The test is changed because an extra file is copied during local-repo clone.

Reviewed By: markbt

Differential Revision: D21894318

fbshipit-source-id: 4417fb5473dc2cb98eda4dcc4d0484cc3b31fae2
2020-06-10 19:29:27 -07:00
Jun Wu
d6263b9529 test-absorb: enable visibility
Summary:
Revision numbers changed since strip no longer happens.
Updated revsets to use `.^` instead of revision numbers.

Reviewed By: markbt

Differential Revision: D21894309

fbshipit-source-id: 0bea56c9e8c6fd306dc225e4cb64ed69739a697a
2020-06-10 19:29:26 -07:00
Jun Wu
a2d3da5114 bundlerepo: only enable index2 for changelog revlog
Summary:
`index2` is the Rust revlog index implementation that has extra requirements,
namely, the revlog cannot be inlined. We have code to make sure changelog is
not inlined, but manifest or filelog can still be inlined.

`index2` is only needed for changelog for phase and visibility calculations.
Therefore, disable it for manifest and filelog.

Reviewed By: singhsrb

Differential Revision: D21917447

fbshipit-source-id: c45f955175c623092e6f728042dbfd3b942fe911
2020-06-10 19:29:26 -07:00
Ailin Zhang
e9e6f94b92 update eden du to display a summary and display warnings with color
Summary: This diff updated `eden du` to display a summary and display warnings and cleaning information with colors.

Reviewed By: kmancini

Differential Revision: D21885051

fbshipit-source-id: be127b81c92bea1051a80715682cdbccf22f22e3
2020-06-10 19:29:26 -07:00
Ailin Zhang
a2a754b6f0 update eden du to display an aggregated result of all mounts.
Summary: This diff updated  `eden du` to display an aggregated result of all mounts instead of showing all details for each mount, as users generally just want to reduce disk usage but don't really care about details.

Reviewed By: genevievehelsel

Differential Revision: D21877178

fbshipit-source-id: dde43e51e96a5c2569c9fe21ab06cc7ea4295866
2020-06-10 19:29:25 -07:00
Zeyi (Rice) Fan
3754c14ec3 batch imports blobs from Rust stores from EdenAPI
Summary:
NOTE: This stack works together, they are separated for easier reviewing. Check D21723465 if you want to read this stack in one place.

This diff finally connects EdenAPI with EdenFS. Previously we only had basic EdenAPI implemented but the performance was not acceptable. This is largely due to overheads in talking with the remote server. Now EdenFS is able to import multiple files at once, we efficiently use EdenAPI to import these data now.

Reviewed By: chadaustin

Differential Revision: D21576569

fbshipit-source-id: a45e832ec63d057730138551393ff7547fa2c22f
2020-06-10 19:29:25 -07:00
Zeyi (Rice) Fan
854637e854 implement batch blob import for HgNativeBackingStore
Summary:
NOTE: This stack works together, they are separated for easier reviewing. Check D21723465 if you want to read this stack in one place.

This diff encapsulates the newly added batch blob import API in backingstore crate, and expose it to EdenFS. It converts incoming complex data structures down to primitive data types that can go through FFI boundary.

Reviewed By: xavierd

Differential Revision: D21697578

fbshipit-source-id: 8f5505ef4cab342dfa710798a04df4e0e94055d9
2020-06-10 19:29:25 -07:00
Zeyi (Rice) Fan
cfa5945749 implement batch blob fetching API in backingstore crate
Summary:
NOTE: This stack works together, they are separated for easier reviewing. Check D21723465 if you want to read this stack in one place.

This diff implements getBlobBatch in `backingstore` crate that is able to process multiple blob import request at once. This will help EdenFS to process blob import request efficiently. See following diffs in the stack for usage.

To import a list of import requests, the function first check if the file exists locally. When it is already in local store, the function will call the provided `resolve` function to send the blob back. Then it proceeds to send **ONE** request to remote store (in our case, EdenAPI) for all these missing files if this import permits remote importing.

We use the callback style `resolve` parameter because we want to awake waiting threads as soon as the blob is ready, so we don't waste time on unnecessary waiting.

Reviewed By: xavierd

Differential Revision: D21697580

fbshipit-source-id: b550accf6f6163cf6f2e9be6b628e46f44076c37
2020-06-10 19:29:24 -07:00
Jun Wu
18e012bb19 setup: remove .pyc if .py is deleted
Summary: This avoids issues importing stale .pyc files.

Reviewed By: singhsrb

Differential Revision: D21847270

fbshipit-source-id: cd788e8f7bf95d026248febaae6e67db0d2beca1
2020-06-10 19:29:24 -07:00
Jun Wu
92e7b5feb2 visibility: turn on visibility by default
Summary:
It was turned on in production (facebook.rc) except for hg servers.
This mainly affects tests.

Reviewed By: markbt

Differential Revision: D21894313

fbshipit-source-id: 5f12620cfc11bb243e96fba12a07cbf0241c738b
2020-06-10 19:29:24 -07:00
Mateusz Kwapich
41b87a449b hgsql: check if paths are not too long before inserting to DB
Summary:
This is a followup from s195788 - this little check should be enough to prevent
us from having the paths in our DB being truncated on insert.

Reviewed By: markbt

Differential Revision: D21904281

fbshipit-source-id: c9306e0cca4a2e009bb50bc287190d8f7ad12be4
2020-06-10 19:29:23 -07:00
Chad Austin
11d569b04d refactor EdenClient construction
Summary:
I am planning to start migrating Eden's CLI to the new Python 3 Thrift
implementation. In preparation, slightly clean up the interface and
implementation of our Python 2 Thrift wrapper.

Reviewed By: genevievehelsel

Differential Revision: D21854539

fbshipit-source-id: d398dd3f324c12288871cf0c9db41e64ed4cf7ed
2020-06-10 19:29:23 -07:00
Jun Wu
476afcb2f6 visibility: stop logging "repo visibility is tracked through visible heads"
Summary:
Visibleheads (and even narrow-heads) are enabled by default except for hg
servers. No need to log them specially.

Reviewed By: markbt

Differential Revision: D21894308

fbshipit-source-id: 7ffe0977e51c17e743b62da0e2bfbe7618c64610
2020-06-10 19:29:22 -07:00
Jun Wu
1586c31ebb visibility: skip unknown nodes in some places
Summary: This is required to make some tests pass.

Reviewed By: markbt

Differential Revision: D21894312

fbshipit-source-id: 481bcc42f8f7fbb5c1707e66da31aee29932484c
2020-06-10 19:29:22 -07:00
Jun Wu
d6ed467b66 convert: use unfiltered repo
Summary: This avoids some issues.

Reviewed By: markbt

Differential Revision: D21894316

fbshipit-source-id: 98c75704bb3ace9fc9ac912711a8cd2d77dfeaf0
2020-06-10 19:29:22 -07:00
Jun Wu
64585a5895 hgsql: disable conflicting features explicitly
Summary:
If hgsql is enabled, disable visibility and narrow-heads explicitly to avoid
surprises.

Reviewed By: markbt

Differential Revision: D21894320

fbshipit-source-id: 335cf92dc1c62e2801e7407b706f6fc5dd59d5b4
2020-06-10 19:29:21 -07:00
Jun Wu
ae58e90f07 prune: update visibility
Summary: Make `prune` remove visible heads. This affects tests.

Reviewed By: markbt

Differential Revision: D21894322

fbshipit-source-id: 7cfa102b1be72c83a2ccdbc2d396a74ec1de2cfe
2020-06-10 19:29:21 -07:00
Jun Wu
20ea1b6543 debugobsolete: update visibility
Summary: Make `debugobsolete` also update visibility. This affects many tests.

Reviewed By: markbt

Differential Revision: D21894310

fbshipit-source-id: eba6ecb07fdd8f5a13085434b303581ec5acf463
2020-06-10 19:29:21 -07:00
Jun Wu
0fbd279db9 test-check-code: skip checking Python code in tests/
Summary: This makes tests more stable when changed.

Reviewed By: markbt

Differential Revision: D21894314

fbshipit-source-id: 73c36f79763643ccbe5dd52522fa8f22fa17a08a
2020-06-10 19:29:20 -07:00
Jun Wu
b5e2c381f0 tests: remove test-obsolete-divergent.t
Summary: We don't use obsmarker but mutation records. Therefore, remove the test.

Reviewed By: markbt

Differential Revision: D21894315

fbshipit-source-id: a1ccd8f78bea8adcba419b0d8ec99d52cd14d4e4
2020-06-10 19:29:20 -07:00
Jun Wu
6384b6aaba tests: remove test-obsolete-changeset-exchange-t.py
Summary:
We don't use obsmarker exchange but mutation record exchange.
Therefore, remove the test.

Reviewed By: markbt

Differential Revision: D21894311

fbshipit-source-id: 73d1f8031b2f601d133a98ffaa92a890bb59a656
2020-06-10 19:29:20 -07:00
Stanislau Hlebik
f6ab4bb8bd mononoke: log the name of fetched undesired file
Summary: Let's log the name as well - it will help with investigation.

Reviewed By: farnz

Differential Revision: D21906595

fbshipit-source-id: 51eb49354017c17ba3304f0a66c95dfc3c695e6a
2020-06-10 19:29:19 -07:00
Stanislau Hlebik
ceed8ea37f mononoke: add must_use to FilenodeResult
Summary: Let's make sure it's always processed

Reviewed By: krallin

Differential Revision: D21904402

fbshipit-source-id: da95273d10ecf69ad99cf6fe5e41bb6bb20e8d59
2020-06-10 19:29:19 -07:00
Lukas Piatkowski
e38fc40b9f mononoke: replace direct usages of ServiceData by dynamic singleton counters
Summary: The replacement will make lfs_server, mononoke_api, edenapi_server and walker OSS buildable.

Reviewed By: krallin

Differential Revision: D21884324

fbshipit-source-id: e6cdf8356b13056a9944ab9da18dc15977b6a2ec
2020-06-10 19:29:19 -07:00
Kostia Balytskyi
4cdc8a994c thrift: sync commitsync.thrift
Summary:
This adds changes, introduced by me in D21841293.

For my stuff: I will only land this once the configerator diff is reviewed.

Reviewed By: farnz

Differential Revision: D21862276

fbshipit-source-id: d4f5ccdd4ef9d62bb1e394d4db36930413633fa6
2020-06-10 19:29:18 -07:00