Summary:
getpid() is an unconditional syscall on Linux/glibc. Therefore, it
costs about 250 nanoseconds. There are a couple places in EdenFS where
getpid() is an inner-ish loop so use folly::get_cached_pid() instead.
Reviewed By: kmancini
Differential Revision: D42044221
fbshipit-source-id: e9c8f8a00febeaf6c9a0a3481879040d739038f5
Summary:
While the `public()` revset is updated, there could be other "stale" revsets
that are using incompatible versions that triggers slow paths.
Original commit changeset: c8a5c9e0d5dd
Original Phabricator Diff: D47384752
Reviewed By: fanzeyi
Differential Revision: D47478975
fbshipit-source-id: f4eca716bf4268e5ac1e750430f31de2c9751cb1
Summary:
liubov-dmitrieva reported in P788939965 that commands like:
hg log -r " reverse(master~1000::master) & not(file(r're:.*'))"
causes lots of 1-by-1 location -> hash lookups. This diff resolves it by
skipping the problematic code path:
File "edenscm/revset.py", line 1456, in matches
files = getfiles(x)
File "edenscm/changelog2.py", line 382, in readfiles
text = self.revision(node)
File "edenscm/changelog2.py", line 495, in revision
p1, p2 = self.parents(node)[:2]
File "edenscm/changelog2.py", line 648, in parents
parents = list(self.dag.parentnames(node))
error.UncategorizedNativeError: Resolving id exceeds threshold 10 set by EDENSCM_REMOTE_ID_THRESHOLD
The troublesome code path was found by setting
`EDENSCM_REMOTE_ID_THRESHOLD=10`.
Reviewed By: zzl0
Differential Revision: D47417522
fbshipit-source-id: 2830e825a362c6a1ea26f2627fef65dd5b7dcf4b
Summary:
Now `#!/usr/bin/env bash` is used for bash scripts (by D47269779) we need to
update the bash detection for test compatibility.
Reviewed By: evangrayk
Differential Revision: D47457479
fbshipit-source-id: c6a449f53fb265f8a01d6368fe807e0b8bae03aa
Summary:
Partially enables symlink support on Windows by making symlinks appear on Windows as actual symlinks as opposed as regular files containing only the place where the symlink would point in other systems.
Creating new commits with symlinks also works (after editing `fscap.py` on hg's side as well as the requirements file for the current directory for enabling symlinks on Windows EdenFS) when the symlinks are in the same directory.
Reviewed By: xavierd
Differential Revision: D44218035
fbshipit-source-id: 0e3094dc5a13cabef1cd24f8fe18cc73ca40d4a8
Summary:
The methods mentioned in the title changed a bit on Windows, now allowing them to respond that a TreeEntry can be a symlink.
In order to gate this change, on Windows now there is a helper method that is used for reverting the changes for `TreeEntry:: getType` to its previous behavior, in order to be able to tell whether symlinks are enabled for the current Eden checkout or not. Where possible, (which is in most places) the config for whether symlinks are enabled or not on the Eden checkout is passed down.
The non-gated changes are kept since in those cases we actually want to register that a TreeEntry is actually a symlink, even when symlinks are "not enabled".
Originally this was intended to be part of D44218035, but was split for clarity.
Reviewed By: xavierd
Differential Revision: D47326228
fbshipit-source-id: be6cfae6626bf3a32aa119d25bf8b5fe6a549898
Summary:
Update num_cpus to version 1.16.0. We need this version as it is a requirement
of libbpf-sys v1.2.1+v1.2.0, which is to be imported subsequently.
Reviewed By: zertosh
Differential Revision: D47380958
fbshipit-source-id: d1fa12a1c8a974686d70d47876e990da4a73b839
Summary:
clang-tidy had some automated suggestions for our code. Apply the ones
that make sense.
Some of them didn't, like removal of all uses of `volatile`. I
manually reverted those changes.
Reviewed By: genevievehelsel
Differential Revision: D41051052
fbshipit-source-id: 3fe22a91e929d3bb8e6346126c2c7bf9f027eb32
Summary: We should prefer string_view over folly::StringPiece..
Reviewed By: xavierd
Differential Revision: D47406695
fbshipit-source-id: 0c557c1d933a8196f4c5b7fbe97c3ca8bda06bda
Summary:
I'm not sure when or how this is possible, but EdenFS should handle
the possibility that getPeerEffectiveCreds returns nullopt.
Reviewed By: genevievehelsel
Differential Revision: D47421072
fbshipit-source-id: c77746b5d9476e131fcb0173e13d63e36e4a61d9
Summary:
We have seen reports of people seeing unexpected fetch activity. This
diff plumbs process ID through HgImportRequest so it can be streamed
to `eden trace hg` output.
Reviewed By: kmancini
Differential Revision: D42040798
fbshipit-source-id: 0a18fba6a55e584a4334088efde761a7c1d8fe6e
Summary: Add an infallible ProcessId::current() to replace uses of gitpid() and GetCurrentProcessId().
Reviewed By: kmancini
Differential Revision: D42037244
fbshipit-source-id: b5b7dced241d0a70e9d43b40827d741d7049345d
Summary:
Now that ProcessId exists, we should use it instead of pid_t in
ObjectFetchContext.
Reviewed By: genevievehelsel
Differential Revision: D42037216
fbshipit-source-id: 34cd89f78be35a15d73b26edc840e917fd642723
Summary: Add additional context (commit and new file name) to the rebase prompt message, this will help avoid conflict resolution errors.
Reviewed By: quark-zju
Differential Revision: D47312287
fbshipit-source-id: 2ed162ae44eb518a33d23aa17f6720ad137d4a04
Summary: expose the commit info to Python world, it will be used in the following diff to add more context to the rebase prompt messages
Reviewed By: quark-zju
Differential Revision: D47312286
fbshipit-source-id: c896d913660cabffc4c654ba83b8fa9a1e2b24ef
Summary: this will be useful to users as well
Reviewed By: quark-zju
Differential Revision: D47389984
fbshipit-source-id: 05a13e1085820a6dd779e230f9ae98df38243354
Summary:
In preparation for unifying unmount() in FsChannel, return SemiFuture
from EdenMount::unmount.
Reviewed By: kmancini
Differential Revision: D45300725
fbshipit-source-id: 4eeb7a19d4140f9985c8a46dd357f7631ff9d490
Summary:
This makes the test intention more explicit. Auto fix won't break the test
intention.
Reviewed By: sggutier
Differential Revision: D47412807
fbshipit-source-id: 1a8a12c7604753b4eb30a158460c17a237234799
Summary: Similar to IPython, use `_` to refer to the previous output.
Reviewed By: sggutier
Differential Revision: D47412808
fbshipit-source-id: d3a72293fc2ae90f0326c1152a352fdf35a438ff
Summary:
The conch_parser is now part of bindings and no longer have import issues.
So let's enable the test.
Reviewed By: sggutier
Differential Revision: D47412806
fbshipit-source-id: 7392ec7fa0664dfe7d9d0c9d3878b59addcc9703
Summary: Now that Windows has an actual PrivHelper, we can remove some ifdefs.
Reviewed By: mshroyer
Differential Revision: D45300700
fbshipit-source-id: e5e59fafd95c1a44a51f5caa04331fb8d887d426
Summary:
Aiming towards moving unmount() into FsChannel, move the knowledge of
how to unmount an NFS mount into Nfsd3.
To support unmounting on Windows, we can eventually add an invocation
of unmount.exe to the Windows PrivHelper implementation.
Reviewed By: kmancini
Differential Revision: D45296963
fbshipit-source-id: 55fa7fe0f6190d3708caa21a0cd4b3868f464f8b
Summary:
Aiming towards moving unmount() into FsChannel, move the knowledge of
how to unmount a FUSE mount into FuseChannel.
Reviewed By: kmancini
Differential Revision: D45296899
fbshipit-source-id: 3f270bcc21386224cf7472eb88c851ca1f718e8a
Summary: Additionally log remote derivation requests to the main request context scuba table, so that they are visible in that table as well as the derived data table.
Reviewed By: mitrandir77
Differential Revision: D47340735
fbshipit-source-id: 6a538c9a69bc832561cd2dbb3870a2654934119c
Summary: Extract the logging of remote derivation requests to new methods on `DerivedDataScuba`. Their behaviour should be the same.
Reviewed By: RajivTS
Differential Revision: D47340734
fbshipit-source-id: 106785cde002a763d3988366aefa8c51742fb49c
Summary: The scuba logging methods on derived data manager require the caller to carry around the scuba sample builder. Simplify this by extracting it to a custom type that holds the sample builder, along with type information about the derived data type.
Reviewed By: RajivTS
Differential Revision: D47340736
fbshipit-source-id: 6372335acd5375a67ca9814add2721e2d96ffda1
Summary:
While technically one can use debugexportstack to export a commit, then
debugimportstack repeating the commit's content to achieve amend. The ISL
"Operation" is abstracted around one instead of two commands. We need
one-command amend. This diff updates debugimportstack to support one-command
amend.
Reviewed By: zzl0
Differential Revision: D47282370
fbshipit-source-id: 54026766d91cc0e073b9e76b27ea98b9809bcedb
Summary:
fix routing keys
the original keys contain both hg id and path making them long
we don't need to take into account the path part of the key for routing purposes
Reviewed By: clara-9
Differential Revision: D47395901
fbshipit-source-id: c5b18e437490c14b810c555cd10a68000e52d088
Summary:
An alternative to D47376881. Instead of invalidating `public()` manually, let's
detect potential slow paths and invalidate them on access automatically.
The `draft()` set is considered small and skips this check for now.
Reviewed By: zzl0
Differential Revision: D47384752
fbshipit-source-id: c8a5c9e0d5ddd131a86890550a67141a1ddb6d65
Summary: This makes it possible to compare `VerLink` between the current changelog and a cached set.
Reviewed By: zzl0
Differential Revision: D47384780
fbshipit-source-id: f753512ead4f1b01cb65be7da568813631c66b1e
Summary:
This makes it easier to look into the "versions" associated by the `nameset`s
from Python.
For example, to understand more about D47376881, with the temporary change like:
--- a/fbcode/eden/scm/edenscm/localrepo.py
+++ b/fbcode/eden/scm/edenscm/localrepo.py
@@ -1230,7 +1230,12 @@
# Invalidate revsets like "public()".
if heads or remotenamechanges:
+ r1 = self.revs("public()")
self.invalidatevolatilesets()
+ r2 = self.revs("public()")
+ import IPython
+
+ IPython.embed()
Then we can check that the versions of `r1` and `r2` are different:
In [3]: r1._set.hints()
Out[3]:
{'map_version': <VerLink 0x55655c855fb0->0x55655c875f50->12>,
'dag_version': <VerLink 0x55655c844000->0x55655c86c7e0->13>,
...}
In [4]: r2._set.hints()
Out[4]:
{'map_version': <VerLink 0x55655c4aa1f0->0x55655c86e740->18>,
'dag_version': <VerLink 0x7f26200cf3e0->0x55655c3fc260->19>,
...}
# None: considered as "incompatible"
In [7]: r1._set.hints()['map_version'].cmp(r2._set.hints()['map_version']) is None
Out[7]: True
For more context of `dag::VerLink`. Check its docstrings.
Reviewed By: zzl0
Differential Revision: D47383634
fbshipit-source-id: 84d95a5442f3901ad331e7724eeebea3419788d2
Summary:
Reported by liubov-dmitrieva in P785997251. The autopull does not invalidate certain
revsets like `public()` causing suboptimal massive remote hash<->location
lookups.
Reviewed By: zzl0
Differential Revision: D47376880
fbshipit-source-id: 0383574feece99962232de36c17b686686f7b3ee
Summary: The method responsible for storing raw git objects and all the errors associated with git methods are currently present in the `mononoke_api` crate. This diff moves it out to `git_types` crate so it can be used for git data derivation along with API endpoints in SCS.
Reviewed By: markbt
Differential Revision: D47315212
fbshipit-source-id: 79ffad807474efedc3aacd33e5438267a6d41ac2
Summary:
picking up from D37112756.
given thrift library `foo`, where before we'd generate target `foo-rust` (containing a `types.rs` module) we now generate two targets, `foo-rust` & `foo-rust-types` where the `types.rs` module is in the latter crate which is depended upon by the former. the motivation is to enable greater build parallelism (see D37112756 for more).
## buck
### files and symlinks in buck-out/.
single-file-thrift-library-foo multi-crate {F1041073024}
multi-file-thrift-library-foo multi-crate
{F1041073062}
## autocargo
### files in target/.
single-file-thrift-library-foo multi-crate {F1041073095}
multi-file-thrift-library-foo multi-crate {F1041073125}
## deployment plan
- diff (1) land autocargo changes (D47342888)
- will break autocargo workflows not using `arc`
- diff (2) initiate an autocargo bump
- https://www.internalfb.com/intern/msdk/bump/autocargo
- diff (3) (D46573767 - this diff) rebase all remaining changes on (2) and land it
- thrift compiler, compiler wrapper, rust thrift build defs
- regenerated 'Cargo.toml', 'thrift_build.rs' and 'thrift_lib.rs' files
- will break autocargo thrift builds (bad "thrift1"; invoking incompatible thrift compiler)
- diff (4) initiate a thrift1 bump (now (3) has landed) and land it
- https://www.internalfb.com/intern/msdk/bump/thrift1
Reviewed By: zertosh
Differential Revision: D46573767
fbshipit-source-id: b2db8e3bf307a6498f92cdb8a64c26b8871a0a1d
Summary:
This diff includes two changes as a preparation step for deriving `RawGitTree`s:
- Make the `upload_git_object` take a `Blobstore` argument instead of using a `impl RepoBlobstore`. This will allow the git tree derivation module to reuse this functionality
- Change the `blobstore_key` for the current Git Tree type
Note that this by itself will not make the storing git tree object reusable since currently it lives in `mononoke_api` crate and referencing it in `git` crate leads to a cycle. In the next diff I will move this logic in the `git` crate so that it can be used without cyclic dependencies.
Reviewed By: markbt
Differential Revision: D47315214
fbshipit-source-id: fbc8787633aaa38089e17f005750f8dbe4b03a15
Summary: We are migrating away from `folly::to`.
Reviewed By: xavierd
Differential Revision: D45935360
fbshipit-source-id: c33f0ecb0e7b2482dd7d49a8a00f3309c17caded
Summary: This diff adds a new test case, where we have multiple input files that contains the key to delete.
Reviewed By: mitrandir77
Differential Revision: D47230796
fbshipit-source-id: c109e3028c11ca0d5ef38ef5cb0dacb0d75c80f2
Summary: This diff added a new test case: when the given key, which with a non-existing repo.
Reviewed By: mitrandir77
Differential Revision: D47230657
fbshipit-source-id: 3f316a360043373bd9b42212675920f60a8fc9e4
Summary:
This diff adds a new test case for the integration test:
* A good key, and we successfully delete the key
This diff also fixes a problem of the cleanup test results, and make the test file name more reasonable.
Reviewed By: mitrandir77
Differential Revision: D47228786
fbshipit-source-id: ed0d56007f4b19412b2b26b7ae00c4c48f8721c6
Summary:
This diff does the follow:
* fix linter problems in the pre diffs in this stack
* remove the directory creating for error log files, to prevent typos
Reviewed By: mitrandir77
Differential Revision: D47228262
fbshipit-source-id: 5422ce01809100732070dafebf6dbda06ce5a872
Summary:
This diff adds a new case for bulk unlinking integration test: the key doesn't match the regex.
We should stop the program immediately, as a protect mechanism.
Reviewed By: mitrandir77
Differential Revision: D47228117
fbshipit-source-id: 542516488c77370e09ae94333056030515e65496
Summary:
This diff adds a new integration test for bulk unlinking.
The integration test now only test the situation where the given key is a bad format.
Next diffs will add more cases.
Reviewed By: mitrandir77
Differential Revision: D47226110
fbshipit-source-id: 5061d6fd4f4ce6c043b37dad9f2f61df71af75eb
Summary: This diff makes the new admin tool doesn't print inner store ids when constructing a Multiplexed blobstore
Reviewed By: mitrandir77
Differential Revision: D47226109
fbshipit-source-id: 4ff4d135102758b088497bc1719b669b5ab64561