Commit Graph

5593 Commits

Author SHA1 Message Date
Michael Cuevas
adf6f65063 add filter path arguments to clone library functions
Summary:
# Problem

The `eden clone` and `hg clone` command currently allow you to specify that you want to use FilteredFS, but they don't allow you to specify the filter to active after the clone completes. Instead, the user has to manually set the filter themselves by running `hg filteredfs enable {path_to_filter}`.

This is annoying for many reasons, and it prevents us from easily rolling out filters on Sandcastle/ODs.

# Solution

We should allow users to pass in the Filter they want to enable at clone time. This will allow them to skip the `hg filteredfs enable {path_to_filter}` step. Even better, we'll allow passing this filter via an Hg Config. That way we can easily enable FilteredFS + use a specific filter just by setting a config value.

# This diff

All of these should take an optional filter_path argument. This will be used by clone to set the active filter at clone time.

Reviewed By: jdelliot

Differential Revision: D53599527

fbshipit-source-id: c6573cd4886620a21471101e5cc2151e815de7f1
2024-02-12 13:40:38 -08:00
Michael Cuevas
f333975578 change Python FilteredRootId creation
Summary:
# Problem

The `eden clone` and `hg clone` command currently allow you to specify that you want to use FilteredFS, but they don't allow you to specify the filter to active after the clone completes. Instead, the user has to manually set the filter themselves by running `hg filteredfs enable {path_to_filter}`.

This is annoying for many reasons, and it prevents us from easily rolling out filters on Sandcastle/ODs.

# Solution

We should allow users to pass in the Filter they want to enable at clone time. This will allow them to skip the `hg filteredfs enable {path_to_filter}` step. Even better, we'll allow passing this filter via an Hg Config. That way we can easily enable FilteredFS + use a specific filter just by setting a config value.

# This diff

Instead of making the caller create the FilterID themselves, have them pass in a filter path which will be used to create the FilterID. This will be used in the next diff since clone will now take a --filter-path argument.

Reviewed By: jdelliot

Differential Revision: D53599529

fbshipit-source-id: 3d200b817e9928180a8cfd319f39188bd41dae8f
2024-02-12 13:40:38 -08:00
Chris Dinh
9102cff8d8 Add explanatory comments to eden du
Summary: Add comment explaining how eden du calculates size

Reviewed By: MichaelCuevas

Differential Revision: D53582679

fbshipit-source-id: c62c0a4626d83d79676c95d7d49a0f58fb3fe2cf
2024-02-09 12:05:11 -08:00
Michael Cuevas
0d8f33b98a Allow comparison of different FOID types
Summary: We will log the occurrences for now so we can track how often this occurs.

Reviewed By: kmancini

Differential Revision: D53595535

fbshipit-source-id: acaf331d9eb6ed297eafd174c8141b066422f478
2024-02-08 18:56:18 -08:00
Chris Dinh
b4f2f8b692 Migrate eden du to getScmStatusV2
Summary:
# Context
The "eden du" command displays the actual storage used on disk. This is used when users want to know how much actual storage is being used by eden for purposes such as clearing up disk space.

# This Diff
This diff migrates the thrift endpoint from getScmStatus to getScmStatusV2

# Technical Details
getScmStatusV2 packages the previous values of getScmStatus into a substruct and adds some new field. This diff moves the previous values of getScmStatus into that substruct and uses default values for the fields not previously present.

Reviewed By: MichaelCuevas

Differential Revision: D53581822

fbshipit-source-id: 7fcb756d5096a2a0a53075870bae979a301f0e87
2024-02-08 18:45:16 -08:00
Carlos Fernandez
e8dd0a071c eden cli: Automatically accept EULA when calling handle.exe
Summary:
The first time handle.exe is called is shows a popup asking the user to accept the EULA.

Passing the argument -eulaaccepted bypasses this popup.

Reviewed By: MichaelCuevas

Differential Revision: D53589443

fbshipit-source-id: 2cdb56c157a297f3107b822982074a89817335d2
2024-02-08 17:50:54 -08:00
Carlos Fernandez
ec7a73c6e4 Eden cli: On rm, check if the arg is a file instead of a directory
Summary:
During my first test of rm I saw that if rm is passed a file (that exists) instead of a directory the message is unclear (correct, but not obvious if you don't realize you passed the wrong thing).

I think just reporting that it's a file and not a directory and still allowing to delete it is a bit better.

Reviewed By: MichaelCuevas

Differential Revision: D53551256

fbshipit-source-id: 1ec367267d53185dec5ddac69d44039e39ea743c
2024-02-08 17:50:54 -08:00
Chris Dinh
4bd34a72d0 CLI: Improve output of eden du command with detailed breakdown of redirect storage usage
Summary:
# Context
The "eden du" command displays the actual storage used on disk. This is used when users want to know how much actual storage is being used by eden for purposes such as clearing up disk space.

# This Diff
This diff adds a new details section to the output that displays the individual storage usage of each redirect. This lets them
Old:
```
Summary
-------
 Materialized files:  311.2 MB
       Redirections:  29.9 GB
      Ignored files:  1.3 MB
      Backing repos:  46.0 MB
       Shared space:  254.7 MB

```
New:

```
Summary
-------
 Materialized files:  311.3 MB
       Redirections:  29.9 GB
      Ignored files:  1.3 MB
      Backing repos:  49.6 MB
       Shared space:  254.7 MB

Details
-------
   29.9 GB: buck-out
         0: fbcode/buck-out
         0: fbcode/.cpplsp-buck-out
         0: .pylsp-buck-out
```
# Technical Details
The detail output is formatted as
```
  Storage : local path
```
Storage is sorted by size descending.
I chose to have the path after the size due to variable length pathnames making it difficult to easily compare the storage being used

# Discussion Points
1. Should folders of size 0 be listed as 0 B
2. Other folder listings are displayed as fullpaths eg.
```
Buck redirections
-----------------
/data/users/cqd/fbsource/buck-out
/data/users/cqd/fbsource/fbcode/buck-out
```
 should detail also display the fullpath, eg as
```
Details
-------
   29.9 GB: /data/users/cqd/fbsource/buck-out
         0: /data/users/cqd/fbsource/fbcode/buck-out
         0: /data/users/cqd/fbsource/fbcode/.cpplsp-buck-out
         0: /data/users/cqd/fbsource/.pylsp-buck-out
```

Reviewed By: MichaelCuevas

Differential Revision: D53290943

fbshipit-source-id: 20f5e1ce32131130c2f6a9ff5bb8f8bd7a46e482
2024-02-07 16:32:24 -08:00
Andi Rauter
ec4399358b Move CAS counters into remote_execution/cas/capacity
Summary:
The DC for storage should all sit in the same place, i.e.
remote_execution/cas/capacity. This fixes it.

Differential Revision:
D53535912

Privacy Context Container: L1141686

fbshipit-source-id: e9383c2513ae731918ac37e95b7a4acf183d8145
2024-02-07 15:27:32 -08:00
Richard Barnes
c11c27020d Fix shadowed variable in eden/fs/inodes/EdenMount.cpp
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53478938

fbshipit-source-id: 686af60cacd2c6d356f2ad6464b51712b59ed96f
2024-02-06 16:38:53 -08:00
Richard Barnes
b30fce38b2 Fix shadowed variable in eden/fs/utils/test/ImmediateFutureTest.cpp
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53478924

fbshipit-source-id: 619cd5814bdc1804edb6366e381f26bfe75bb56d
2024-02-06 16:38:43 -08:00
Richard Barnes
bd3aa77356 Fix shadowed variable in eden/fs/service/EdenServiceHandler.cpp
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53478940

fbshipit-source-id: da0e0a0043f87fa27599ec051c3c772eba0721d4
2024-02-06 16:37:12 -08:00
Richard Barnes
2799d72dc1 Fix shadowed variable in eden/fs/inodes/NfsDispatcherImpl.cpp
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53451014

fbshipit-source-id: aec2e35fa3b105380c6d4115543bf753ceb259ea
2024-02-05 16:52:45 -08:00
Richard Barnes
55bae1ebf8 Fix shadowed variable in eden/fs/store/FilteredBackingStore.cpp
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53451028

fbshipit-source-id: fb39814f7e9a79349f7d780d835ac3b6476bf9a9
2024-02-05 16:36:37 -08:00
generatedunixname89002005287564
a67eefda3a eden/fs/facebook
Reviewed By: arun11111

Differential Revision: D53344378

fbshipit-source-id: a9bbdde21200f63f775088af553db3b3c452bdff
2024-02-05 10:48:18 -08:00
Nicholas Ormrod
cdaeeca3bd De-shim StringKeyedUnorderedMap in eden
Summary: StringKeyedUnorderedMap is a shim whose purpose is to provide F14Map. Just use the latter.

Reviewed By: genevievehelsel

Differential Revision: D53376952

fbshipit-source-id: c61ef2fdfe611ef9adb5ffefcc72b286e5ef093d
2024-02-05 09:45:18 -08:00
generatedunixname89002005287564
f4e7c2578f eden/fs/facebook/prefetch_profiles
Reviewed By: arun11111

Differential Revision: D53344181

fbshipit-source-id: 91de0087581db11ca7635a15ec61d257a7514690
2024-02-05 08:16:55 -08:00
David Tolnay
f31a683d77 Regenerate thrift_build.rs with labels
Summary:
Changes resulting from {D53374511}. I think this was supposed to be in that diff.

It doesn't necessarily make sense to have these fbcode target names in Autocargo-generated code that gets shipped to GitHub. I can look into getting autocargo to omit these.

Reviewed By: zertosh, shayne-fletcher

Differential Revision: D53379521

fbshipit-source-id: 6377e6181b0b1e0a86f6144e208773959fda0ac0
2024-02-03 06:25:38 -08:00
David Tolnay
df6405bf25 Disable Cargo documentation generation for Thrift targets
Summary:
I came across this failure in `oss-mononoke-linux-getdeps` likely caused by {D53302058}:

> error: document output filename collision
> The lib `bonsai_globalrev_mapping_thrift` in package `bonsai_globalrev_mapping_thrift_types v0.1.0 (/data/sandcastle/temp/skycastle/fbcode_builder_getdeps/build/mononoke/source/eden/mononoke/bonsai_globalrev_mapping/if/types)` has the same name as the lib `bonsai_globalrev_mapping_thrift` in package `bonsai_globalrev_mapping_thrift v0.1.0 (/data/sandcastle/temp/skycastle/fbcode_builder_getdeps/build/mononoke/source/eden/mononoke/bonsai_globalrev_mapping/if)`.
> Only one may be documented at once since they output to the same path.
> Consider documenting only one, renaming one, or marking one with `doc = false` in Cargo.toml.

We don't need Cargo-generated docs of Thrift targets.

Reviewed By: zertosh

Differential Revision: D53339579

fbshipit-source-id: 3dc0d404777ca436e0f6de7ae7491925d709e331
2024-02-02 07:45:58 -08:00
Michael Cuevas
cfd2159916 correct apfs.util command
Summary: Users will get the best results if they pass in `~/*` as the path argument for the apfs.util command.

Reviewed By: genevievehelsel

Differential Revision: D53326600

fbshipit-source-id: 521dcf05cae001747beaa3f117d215b33a7895db
2024-02-01 15:01:15 -08:00
David Tolnay
4a1a0d6284 Remove _types suffix from name of types crate
Summary:
The Rust Thrift implementation presently compiles to 4 crates:

```lang=mermaid
flowchart TD;
    foo --> foo-clients;
    foo --> foo-types;
    foo --> foo-services;
    foo-clients --> foo-types;
    foo-services --> foo-types;
```

Sadly, the one with the best name is the most useless. That top-level foo crate just contains the following:

```
pub use ::foo_types as types;
pub use ::foo_clients as client;
pub use ::foo_services as server;

pub use ::foo_types::consts;
pub use ::foo_types::errors;
pub use ::foo_types::services;
pub use ::foo_clients::mock;

pub use self::consts::*;
pub use self::errors::*;
pub use self::types::*;
```

Furthermore, it is extremely uncommon for anything to want to be both a client and a server of the *same* Thrift interface. It arises occasionally for proxies, but otherwise you are either implementing the server for a particular service, or accessing it as a client, not both.

I am interested in eliminating the useless crate, and renaming the types subcrate to the nice name.

```lang=mermaid
flowchart TD;
    foo-clients --> foo;
    foo-services --> foo;
```

### Implementation plan

1. This diff
2. Migrate everything that uses `:foo-rust` and needs a client to `:foo-rust-clients`, and everything that needs a server to `:foo-rust-services` -- after this point, everything still depending on `:foo-rust` only uses types
3. In the macros, atomically delete `:foo-rust` and rename `:foo-rust-types` into its place (this will be a small diff)

Reviewed By: zertosh, shayne-fletcher

Differential Revision: D53302058

fbshipit-source-id: 8d28c90f3a13e71e0cedd3ce3c1cb6fe40cffe27
2024-02-01 10:26:41 -08:00
generatedunixname89002005287564
3463949368 eden/fs/facebook
Reviewed By: arun11111

Differential Revision: D53305044

fbshipit-source-id: 04215b94892b58b7f31139f9bea5eb05aff2964a
2024-02-01 08:59:52 -08:00
David Tolnay
7cdd8ec65a Eliminate deps from clients to servers and vice versa
Summary:
# Before:

If a Thrift library A depends on Thrift library B, all of the dependencies on B are bottlenecked through B's main library. That means building A's clients requires building B's servers, and building A's servers requires building B's clients, neither of which should be necessary.

```lang=mermaid
flowchart TD;
    A --> A-clients;
    A --> A-types;
    A --> A-services;
    A-clients --> A-types;
    A-services --> A-types;

    B --> B-clients;
    B --> B-types;
    B --> B-services;
    B-clients --> B-types;
    B-services --> B-types;

    A --> B;
    A-clients --> B;
    A-services --> B;
    A-types --> B;
```

# After:

A tidy lattice. Projects that implement a Thrift service can build only the servers for A and B, without also building all their clients. Projects that need Thrift clients for various services can build just the clients without also building a bunch of unused infrastructure for writing a server implementation.

```lang=mermaid
flowchart TD;
    A --> A-clients;
    A --> A-types;
    A --> A-services;
    A-clients --> A-types;
    A-services --> A-types;

    B --> B-clients;
    B --> B-types;
    B --> B-services;
    B-clients --> B-types;
    B-services --> B-types;

    A --> B;
    A-clients --> B-clients;
    A-services --> B-services;
    A-types --> B-types;
```

Reviewed By: shayne-fletcher

Differential Revision: D53246158

fbshipit-source-id: 37cc5cb111c39c567c69e8fb2eaf23fd940082b3
2024-02-01 07:14:06 -08:00
Nicholas Ormrod
8301be9db6 Deprecate StringKeyedUnorderedMap for eden
Summary: `folly::StringKeyedUnorderedMap` used to be a complicated class, but is now a simple typedef to `F14NodeMap<std::string, Mapped>`. Just use the latter.

Reviewed By: bcardosolopes, xavierd

Differential Revision: D53232021

fbshipit-source-id: 4b545d1c912dae2bbf89e31354f831d818c85167
2024-01-31 11:38:58 -08:00
Sebastian Messmer
d43f59a90d Update webauthn-rs
Summary:
They still haven't released 0.5.0, but made some improvements on the path
there. This brings us back to their newest commit

To keep backwards compatibility (and fix the tests that break because of broken bc), this needs to be landed together with D53111463.

Reviewed By: dtolnay

Differential Revision: D53074256

fbshipit-source-id: 124badef3c923acda758e75f1a4437d8826d5f7c
2024-01-31 09:55:34 -08:00
Daniel Mueller
e34f90b36c Update libbpf-sys to 1.3.0+v1.3.0
Summary:
Update libbpf-sys to version 1.3.0+v1.3.0. This release includes libbpf in
version v1.3.0, which is what we were waiting on. Because this release contains
some incompatibilities, we also have to update libbpf-rs to the most recent
snapshot. A new libbpf-rs release will come once sufficient features have
accumulated.

Reviewed By: shayne-fletcher

Differential Revision: D53102023

fbshipit-source-id: 47b74d38b04237d4d5ba1f93fe19e83b9d2b6125
2024-01-30 13:34:35 -08:00
Genevieve (Genna) Helsel
b2365c9737 add trees-mobile as a subset of the trees profile
Reviewed By: kmancini

Differential Revision: D53096535

fbshipit-source-id: da6a3421b13dbbd09aa3fb952b57120bd7829a0a
2024-01-30 13:25:12 -08:00
Michael Cuevas
9dc06cc623 report APFS purgeable space as user-fixable
Summary:
## Problem

Having an "automatic remediation" for full storage is misleading:

1) Our remediation may not actually solve the full disk space issue
2) Our remediation doesn't actually work since the `apfs.util` command we run requires `sudo` to correctly purge all purgeable space.

## Solution

Instead of claiming that we automatically remediated the issue, let's inform the user of the potential problem, tell them how they can check if that's the *actual* problem, and then give them a remediation they can run to fix the problem. While this is strictly worse than automatically running the remediation for them, it's much better than running a remediation that doesn't actually work and claiming it fixed the problem.

Reviewed By: genevievehelsel

Differential Revision: D53200901

fbshipit-source-id: 23dc142b4c0d236d8b31bba85d0a8f98fe76aeba
2024-01-30 11:35:38 -08:00
David Tolnay
5fb68a9d47 Move server traits to a separate crate
Summary: This diff turns a `thrift_library` with `name = "foo"` into 4 Rust targets: `:foo-rust` (as before), `:foo-rust-types` (as before), `:foo-rust-clients` (as before), and `:foo-rust-services` (new).

Reviewed By: zertosh, shayne-fletcher

Differential Revision: D53166618

fbshipit-source-id: 6f94f7a70f70de928f7320b06e6d638cc6ac1206
2024-01-29 19:35:06 -08:00
David Tolnay
8c42689027 Move client traits to a separate crate
Summary: This diff turns a `thrift_library` with `name = "foo"` into 3 Rust targets: `:foo-rust` (as before), `:foo-rust-types` (as before), and `:foo-rust-clients` (new).

Reviewed By: zertosh, shayne-fletcher

Differential Revision: D53166614

fbshipit-source-id: 243c633ec018a9e2db230741b066897726226c7d
2024-01-29 17:45:56 -08:00
Michael Cuevas
0abc639002 Rust CLI: refactor Inode Catalog Type deserialization
Summary:
# Summary:
Keeping a vector of config options, manually deserializing/serializing them, and then using string-comparisions to check the type seems like a bad long-term trend. Let's move towards using enums for these types of things (like I introduced in D53146609).

# Solution:
This diff enum-izes (enum-erizes) the InodeCatalogType that we parse from the CheckoutConfigs.

Reviewed By: jdelliot

Differential Revision: D53151826

fbshipit-source-id: b646f92f5a308a46d37d43758535cc5dfdd58164
2024-01-29 17:22:00 -08:00
Michael Cuevas
f486622bd3 Rust CLI: change RepositoryType deserialization error message
Summary: See title. I liked this message better than the old one.

Reviewed By: jdelliot

Differential Revision: D53151834

fbshipit-source-id: 05dad98d79572972675653ec873f497ae8ab9ee3
2024-01-29 17:22:00 -08:00
Michael Cuevas
91813015cf Rust CLI: refactor mount protocol deserialization
Summary:
# Summary:
Keeping a vector of config options, manually deserializing/serializing them, and then using string-comparisions to check the type seems like a bad long-term trend. Let's move towards using enums for these types of things (like I introduced in D53146609).

# Solution:
This diff enum-izes (enum-erizes) the MountProtocols that we parse from the CheckoutConfigs.

Reviewed By: jdelliot

Differential Revision: D53151833

fbshipit-source-id: b2e71e6a8ba451fcf46e7d2119b6be3b3ce0f4c4
2024-01-29 17:22:00 -08:00
Michael Cuevas
5ba5d63e9c Rust CLI: fix getSnapshot for FilteredFS repos
Summary:
# Problem:
FilteredFS repos write FilteredRootIds to the Snapshot file so that they can track the current working copy parent, active FilterID, and parse those two pieces of information as needed.

This means that the current getSnapshot logic naively returns FilteredRootIds instead of the expected commit hashes as expected.

# Solution:
We can modify getSnapshot to properly parse the FilteredRootIds and return only the commit hash to the caller.

Reviewed By: jdelliot

Differential Revision: D53146665

fbshipit-source-id: c38980f00b977f525fba654e146e88f8e1693c43
2024-01-29 17:22:00 -08:00
Michael Cuevas
caa71e558c Rust CLI: refactor config deserialization
Summary:
# Problem:
The next diff implements correct getSnapshot() logic which requires doing a comparison of the repo_type config field. Instead of comparing raw strings, we should compare enums.

# Solution:
We can parse the repo_type CheckoutConfig option as an enum to avoid string comparison for determining repo types.

This requires implementing to/from string implementations for the new RepositoryType enum. We can use the strum crate to do this for us.

We can then use the to/from string implementations to deserialize (and serialize) CheckoutConfigs.

Reviewed By: kmancini

Differential Revision: D53146609

fbshipit-source-id: 29cc702695381021b210f85f83855b84dc11534e
2024-01-29 17:22:00 -08:00
Michael Cuevas
c49e6f279b add varint utils to Rust CLI
Summary:
I discovered a case where `eden du` passes in a FilteredFS commit hash into getScmStatus (v1). This causes `eden du` to crash.

This bug stems from the Rust version of get_snapshot() not parsing out the filter information for FilteredFS Snapshot files: https://www.internalfb.com/code/fbsource/[8496d7622d579ebf9253522ec56b35a1353c25ad]/fbcode/eden/fs/cli_rs/edenfs-client/src/checkout.rs?lines=557-612

We correctly parse out the Filter info in the Python CLI (since we have varint utils implemented), but we don't in the Rust CLI because we don't have varint encode/decode functions available.

This diff adds the utils to the Rust CLI so I can correctly parse out filter info and fix `eden du`

Reviewed By: kmancini

Differential Revision: D52928980

fbshipit-source-id: 3258acacde639adaf66e53e0c49578fbb0b1e782
2024-01-29 17:22:00 -08:00
Yedidya Feldblum
e6cecdfce5 migrate from FOLLY_FALLTHROUGH to [[fallthrough]] (assorted)
Summary:
X-link: https://github.com/facebookincubator/velox/pull/8558

The attribute `[[fallthrough]]` is standard C++17. We no longer need to wrap it.

Reviewed By: Orvid

Differential Revision: D53034074

fbshipit-source-id: 19b1e8314e70f3e08882e76b93f7ded4df7ab9f2
2024-01-29 08:06:49 -08:00
Salvatore Benedetto
b26fe19f73 bump to rev with scratch_two fix
Summary: Use the commit with the fix while we wait for a new release.

Differential Revision: D53127691

fbshipit-source-id: 6128ea1ffe00d7e8d8081d7ea5093e8bb813c04f
2024-01-26 08:35:52 -08:00
Shayne Fletcher
98ec8f97ad upgrade shlex
Summary:
make it possible to call `shlex::try_join` and remove the temporary `#[allow(deprecated)]` from buck2_wrapper_common.

buck2/Cargo.toml is restored to the state it had in b9dddef8e77c334a30071810e4ef851e8ad945bb before the workaround applied in D53087714 (which implies at this time shlex-1.3.0).

Reviewed By: ndmitchell, samkevich

Differential Revision: D53001954

fbshipit-source-id: 4267b80b5884b1a1e75c938af641e3f2656bf9a7
2024-01-26 07:55:58 -08:00
Katie Mancini
2d775b9c19 bump the heavy write threshold
Summary:
Users are seeing the 10K write notification pretty frequently from
`eden doctor`, even when things are working ok.

From what I understand 10K was kinda an arbitrary number that seemed reasonable
to start with when we introduced this warning.

I'm gonna attempt to pick a better threshold.

We know that we see problems at 100K - George was able to repro slowness when
things got this high.

Looking at the percentiles p99.5 is less than the 10K in 10 minute limit.
but the p99.9 is pretty much the max -  >100sK in 10 minute. We don't have
global numbers which would probaly yeild more helpful percentiles. So I looked
at the top few users.

There is only a handful of users over 100K/10 min, but generally the chart is
much dense under 50K/10min. 50K probably better to warn a reasonable amount.

Let's try 50K per 10 minutes.

Differential Revision: D53066716

fbshipit-source-id: 5f99438f83db51f6d093ecb0124616ffb05fdf21
2024-01-24 18:49:54 -08:00
Yedidya Feldblum
ad75f16c64 migrate fields of type folly::SharedMutex to be marked as mutable in fbcode (assorted)
Summary:
The nested-name lock-holder `folly::SharedMutex::ReadHolder` accepts `folly::SharedMutex const&`, i.e., as ref-to-const, and it internally does a `const_cast` to remove the `const`. This internal `const_cast` is necessary because members `folly::SharedMutex::lock_shared` and related member functions are not `const`-qualified.

This lock-holder interface is a convenience since a shared-lock on a shared-mutex instance are commonly acquired in `const`-qualified class member functions, where the shared-mutex instance is a class data member and access to it from a `const`-qualified member function implicitly has only `const`-access to the shared-mutex instance.

But `std::shared_lock` does not have this convenience. It is the canonical lock-holder for shared locks and we wish to migrate all uses of `folly::SharedMutex::ReadHolder` to `std::shared_lock`. So we must mark relevant shared-mutex instances with `mutable`.

As a small shortcut, we search for and mark all class data members of type `folly::SharedMutex` as `mutable`.

Reviewed By: brekhus, mogeb

Differential Revision: D52921279

fbshipit-source-id: 99f0fc750a975d181b35c1320c964183f93caefd
2024-01-23 22:38:19 -08:00
Xinyi Wang
871e4a9760 bridge to mercurial for partial glob matching
Summary:
This version is working, see integration test in following diff

It can correctly do partial glob matching so that directories won't be filtered out prematurely

However, this version still needs improvement:

1. I can probably do similar thing to Michael's promise in HgSparseFilter
2. pass u8 to rust instead of a vec of string
3. check on windows

Reviewed By: kmancini

Differential Revision: D50427596

fbshipit-source-id: b95f1c6333978ee79ad1ba1f28cac9cd64441fc5
2024-01-19 09:15:08 -08:00
Katie Mancini
e947f1cb16 cleanup symlink config in the daemon
Summary:
There is a typo in this config name. The config we use in the CLI that
determines the state of the rollout is  `experimental:windows-symlinks` instead
of `experimental:windows-symlinks-enabled`. This causes warning for the users.

Confirmed we don't use the `experimental:windows-symlinks-enabled` value
anywhere. and checked that we don't use `EdenConfig.windowsSymlinksEnabled`
value anywhere in the daemon.

I'm changing the default value to false too because the cli was asking the
daemon for the config and defaulting to false when the config was not set.
This ensures that symlinks stay disable.

Reviewed By: sggutier

Differential Revision: D52891836

fbshipit-source-id: cd25f16a73a6d2e2202dc16a4bfa8e052c8240b7
2024-01-18 18:48:14 -08:00
Katie Mancini
e817db18f9 cleanup warning about config
Summary:
This config is only used in the CLI so the daemon doesn't know how to parse it
and shows a warning. Warning is noisy and makes users think there is something
wrong. Getting rid of the warning.

Reviewed By: genevievehelsel

Differential Revision: D52889490

fbshipit-source-id: f2525580c86c0cf78b71869eb27396ac2cdc282b
2024-01-18 18:48:14 -08:00
John Elliott
840cf92c65 Rename HgImporter remaining artifacts for improved clarity
Summary: After removing HgImporter there are still a few places where the name persists. Let's fix that. Renaming the thread pool factory to SaplingRetryThreadFactory and the thread pool member to retryThreadPool_. Also updated some docs to reflect and converted from Mercurial to Sapling.

Reviewed By: mshroyer, genevievehelsel

Differential Revision: D52571338

fbshipit-source-id: 4738c522d642d7a8aa66a368440e54b144a241b3
2024-01-17 15:49:04 -08:00
John Elliott
ed99297cbd Removed support to differntiate fetch_miss sources
Summary: With the removal of all HgImporter code, we no longer need to differentiate fetch_miss sources. If in the future we have other data stores that fetch from we can add this back. For now, it is just taking up extra space in our scuba table.

Reviewed By: genevievehelsel

Differential Revision: D52404111

fbshipit-source-id: 792d424d5b0459cdd0e47dad45d4bfb1298a1b3d
2024-01-17 13:24:03 -08:00
John Elliott
6782821902 Removing remaining hgimporter support and references
Summary: Removing the `eden stats hgimport` command; references to hgimporter in documentation; etc.

Reviewed By: kmancini

Differential Revision: D51963976

fbshipit-source-id: 19f998ea0f7ca7f132a6714232f03fdee2cf08c2
2024-01-17 13:24:03 -08:00
John Elliott
f7fa06d075 Remove remaining HgImporter code
Summary: HgImporter is no longer in use in our codebase. We can now safely remove it.

Reviewed By: genevievehelsel

Differential Revision: D51911685

fbshipit-source-id: 239d70fb89a5db364606cb0140bc585fc5128324
2024-01-17 13:24:03 -08:00
John Elliott
239b84868b Remove last uses of HgImporter
Summary: We had already removed fetching trees and blobs. Now, we need to remove the last bits of HgImporter.

Reviewed By: genevievehelsel

Differential Revision: D51911205

fbshipit-source-id: 07bdaf14a62f7af951eafa7e8720f681914ba3ab
2024-01-17 13:24:03 -08:00
John Elliott
0676b48d6a Remove HgImporter support for fetching trees
Summary: HgImporter is being removed - this change removes its support for fetching trees.

Reviewed By: kmancini

Differential Revision: D51872978

fbshipit-source-id: 5b373565c6b29ecc3dc7988695b6e4f62d9a04fb
2024-01-17 13:24:03 -08:00
John Elliott
62db053dc2 Remove HgImporter support for importing blobs
Summary: HgImporter is being removed - this change removes its support for importing blobs.

Reviewed By: kmancini

Differential Revision: D51832464

fbshipit-source-id: 504a307e3c5cb66366f50a43362667e709512552
2024-01-17 13:24:03 -08:00
Michael Cuevas
487d333d38 clarify NFS mount options on macOS
Summary: The comment was somewhat unclear. Expand on the soft vs hard choice and add a man page that future devs can reference to understand each option.

Reviewed By: genevievehelsel

Differential Revision: D52710081

fbshipit-source-id: 53bc2eae3799e775a8bbc5dad9bb99ca6e713632
2024-01-16 09:59:34 -08:00
Saul Gutierrez
51638da404 symlinks: prevent accidentally enabling symlinks when running Rust commands
Summary: Some users are reporting seeing symlinks enabled even with the config for explicitly disabling symlinks set to false. This was caused by the Rust CLI always defaulting this to true, regardless of anything else (which this diff fixes)

Reviewed By: kmancini

Differential Revision: D52665462

fbshipit-source-id: 3e4e60c2a7d95c863abdc3d2064a67a808fc5c45
2024-01-10 13:30:53 -08:00
Mark Shroyer
d4b2593d60 Generalze check for network connectivity
Summary:
Adds a generalized check for network connectivity that sees whether we can
establish a TCP connection to the configured EdenAPI endpoint (not just
mononoke.edge.x2p.facebook.net).

In addition to determining whether name resolution succeeds, this updated
check:

- Confirms that we have a configured route to the endpoint.  In particular, if
  we're configured to use an IPv6-only endpoint but don't have an IPv6 default
  route configured, this check will fail.
- Verifies that we can actually establish a TCP connection to the endpoint (so
  we know we aren't firewalled off, for example).

Reviewed By: kmancini

Differential Revision: D52631801

fbshipit-source-id: 3137cc602ac6cfd577da6f467567ac907ae236b6
2024-01-09 17:24:44 -08:00
Lior David
d14b420c4f Print config path on parsing errors
Summary:
Help noobs such as myself with occasional corruptions on Windows.

For me, I was getting this error when running `eden doctor`:
```
  <snip>
  File "C:\tools\eden\libexec\edenfsctl.real.par\eden\fs\cli\config.py", line 1320, in _read_config
  File "C:\tools\eden\libexec\edenfsctl.real.par\eden\fs\cli\config.py", line 1916, in load_toml_config
eden.fs.cli.config.FileError: toml config is either missing or corrupted : Reserved escape sequence used (line 18 column 1 char 386)
```
Which is completely useless because it doesn't say which file fail to parse.

After this change:
```
  <snip>
  File "C:\tools\eden\libexec\edenfsctl.real.par\eden\fs\cli\config.py", line 1320, in _read_config
  File "C:\tools\eden\libexec\edenfsctl.real.par\eden\fs\cli\config.py", line 1916, in load_toml_config
eden.fs.cli.config.FileError: toml config file C:\Users\liorda\.eden\clients\fbsource\config.toml is either missing or corrupted: Reserved escape sequence used (line 18 column 1 char 386)
```
The error, btw, was in this line:
```
active = [ "c:\open\fbsource\arvr\projects\xpd\projects\smials\*",]
```

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: xavierd

Differential Revision: D52531754

fbshipit-source-id: 298422ff283e2bd2688b4dcb9613751a6705c48a
2024-01-04 08:30:40 -08:00
Andreas Backx
ce0e0421f9 colored 1.9 -> 2.1.0
Summary: A newer version of colored adds support for true color terminal text coloring. The changelog only indicates "Alter Color interface to return Cow<'static, str>" besides the true color support as a "change" in the changelog and I'm not expecting people to really use this. If they do, I'll see it in Sandcastle?

Reviewed By: dtolnay

Differential Revision: D52391497

fbshipit-source-id: c08fffc171f7d5f9b75f96617aa673867ab45312
2024-01-02 15:28:35 -08:00
Genevieve (Genna) Helsel
456bb16faa edenfs_config_manager: add edenfs_config_util_test
Summary: Doesn't hurt to add some more tests, and I have a change I want to add a test for, so sets up some initial tests for the semi-complex functions that read from disk from `edenfs_config_util.py`

Reviewed By: MichaelCuevas

Differential Revision: D52383458

fbshipit-source-id: a512b75219740da8bef3d009c9d8a14b84b80083
2023-12-27 12:32:35 -08:00
Genevieve (Genna) Helsel
98f7927a8d cli: normalize global help flag descriptions between rust and python CLI
Summary: Nit to have both clis show the same global flag descriptions

Reviewed By: MichaelCuevas

Differential Revision: D52422910

fbshipit-source-id: 47027f0d4aa12aa22f45bef0d7df33bed2d4732a
2023-12-27 11:32:42 -08:00
Genevieve (Genna) Helsel
457fdcb692 cli: add global cli options to their own group in --help output
Summary: For readability/clearness, group the global CLI options separately from subcommand options in `--help`

Reviewed By: MichaelCuevas

Differential Revision: D52422889

fbshipit-source-id: 13b8d9361f4d5cc0b66713053ec0208c1ed8172e
2023-12-27 11:32:42 -08:00
Genevieve (Genna) Helsel
58e795022e pass CREATE_NO_WINDOW and STARTF_USESHOWWINDOW to ExternalTelemetryLogger log_sample
Summary:
`edenfsctl_config_manager` was previously causing cmd window to flash on Windows: https://fb.workplace.com/groups/edenfswindows/posts/1414741589441715

I attempted to use a subprocess like how we do for `edenfsctl start --if-necessary` and `CoCo`, but it was still popping up a window. I missed this instance of `subprocess`, which looks like it still causes the command window to flash.

Testing the config manager with this change gets rid of the command window flashing.

Reviewed By: MichaelCuevas

Differential Revision: D52371460

fbshipit-source-id: a1e791f122d44a7a00063b5ab33949d25fb7055a
2023-12-21 15:26:31 -08:00
Richard Barnes
da88e74b71 Remove extra semi colon from dyno/cpp/server/parsing/util.h (#794)
Summary:
Pull Request resolved: https://github.com/facebook/sapling/pull/794

`-Wextra-semi` or `-Wextra-semi-stmt`

If the code compiles, this is safe to land.

Reviewed By: palmje

Differential Revision: D51995090

fbshipit-source-id: 4267224b633ab3af176f11752d33b74b59bab5b0
2023-12-21 09:14:38 -08:00
Michael Cuevas
b6b4361dc6 change renderObjectId behavior
Summary: renderObjectID should probably show the actual FilteredObjectID even if it breaks tests. I'll update the broken tests in later diffs. For now, I'll skip them.

Reviewed By: kmancini

Differential Revision: D52302469

fbshipit-source-id: 6607c7bad95fd4e66b0701a88bfe58c3e4ad47b7
2023-12-20 12:59:55 -08:00
Michael Cuevas
8539ca2481 Use last active filter in unfiltered thrift endpoints
Summary:
I initially only added Filter parameters to thrift endpoints that were used by Mercurial. This is because Mercurial is the only tool that's allowed to change filters and therefore change the view of the repo.

However, this causes issues for other Thrift endpoints that accept Commit hashes or RootIds. Eden expects these passed in hashes/IDs to be FilteredBackingStore friendly, and they are usually not (instead they usually are only valid for the underlying BackingStore. In most cases these are Mercurial commit hashes).

To fix this, we assume that any RootIds/hashes we receive from non-Filtered endpoints should be transformed into a FilteredRootId/ObjectID and use whatever the last used Filter was. This allows us to pass valid IDs into the FilteredBackingStore without requiring the user to supply the filter they want to use.

In the future, we can add filter params to all thrift endpoints to allow all callers to use arbitrary filters, but we should carefully think through the implications of allowing any caller to apply any filter to the repo.

Note: another option was to apply the null filter to any IDs that were passed in by these thrift endpoints. That feels wrong to me, since most callers would want to match and get results based on the view of the repo that the user sees. Since the user will see the repo with whatever filter was last applied via checkoutRevision(), it makes sense to apply this filter to the passed in IDs.

Reviewed By: kmancini

Differential Revision: D51926554

fbshipit-source-id: b4f2190904096ca68a2679ac3c7b2d7f449ffeda
2023-12-19 22:20:08 -08:00
Michael Cuevas
ebf95e898d fix renderRootId behavior for FilteredBackingStores
Summary: The intent of RenderObjectId and RenderRootId is that it returns a string that's "human readable" or sane for a caller to examine. Returning a FilteredObjectId or FilteredRootId isn't really the correct thing to do here (callers don't care about the internal details of the FilteredBackingStore). Instead, we should render the Object/Root Id from the underlying BackingStore since that's what most callers would expect.

Reviewed By: kmancini

Differential Revision: D51926553

fbshipit-source-id: 1e23c2b9501a75d0b817e60b6f698e3b821f2551
2023-12-19 22:20:08 -08:00
Michael Cuevas
3764b0f71f fix some lifetime issues in FilteredFS related code
Summary:
Two lifetime issues:

1) We need to ensure the ParentCommit structure stays alive long enough to parse the VarInt and filterID from it.
2) The prefetchBlobs method expected the caller to preserve the lifetime of the ObjectIDs that were passed in. Since FilteredBackingStore::prefetchBlobs() transforms FilteredObjectIDs into regular ObjectIDs and then passes those into the underlying BackingStore, it needs to ensure that the regular ObjectIDs it created stay alive long enough to be used by the underlying BackingStore. This can be guaranteed with an ensure().

Note: I'd love to use a UniquePtr to guarantee the lifetime of the newly created ObjectIds, but that would require changing the signature of prefetchBlobs.

Reviewed By: kmancini

Differential Revision: D51926559

fbshipit-source-id: 45b52079f8081ee76368ae4167c29c11f5c97908
2023-12-19 22:20:08 -08:00
Michael Cuevas
5c55da0b8f add getLastActiveFilter() to CheckoutConfig
Summary:
In some cases, it may be necessary to determine what filter was last applied to the repo. This would be important for filter-unaware tools that want to issue thrift queries but don't have filter context. By default, these tools probably want to use the last applied filter, and therefore we need a way to figure out what the last applied filter was.

Luckily Eden already stores this information (indirectly) in the Snapshot file. The Snapshot file contains two things: the working copy parent RootID and the last checked out commit RootID. We can derive the last applied filter by looking at either one of these, since all FilteredBackingStore RootIDs contain filter information.

Reviewed By: kmancini

Differential Revision: D51926555

fbshipit-source-id: 818548f760046364a9abe758094d8234defc51f7
2023-12-19 22:20:08 -08:00
Michael Cuevas
23b29bcd75 move FilterId parsing logic into util function
Summary: We can now share parsing logic in the CheckoutConfig layer when we're parsing the last RootID from the SNAPSHOT file.

Reviewed By: kmancini

Differential Revision: D52185706

fbshipit-source-id: f9aa8a9d4b7d349917b80da38b6eb5ec368ba227
2023-12-19 22:20:08 -08:00
Michael Cuevas
c2b39e411a remove filter info from commit hashes in eden info
Summary:
When running `eden info`, users probably want the commit hash WITHOUT filter information attached to it. This diff removes filter information (and therefore fixes the `eden info` test).

I can consider adding a "Filter" field to Eden info. However, this is low priority right now since I want to get other tests fixed first.

Reviewed By: kmancini

Differential Revision: D51926557

fbshipit-source-id: 98480a252816384681008e9059b479e48639f9a2
2023-12-19 22:20:08 -08:00
Michael Cuevas
3b49449f20 add more varint utils
Summary:
When using FilteredBackingStores, Eden now stores FilteredRootIds in the Snapshot file. FilteredRootIds consist of the original underlying BackingStore's RootId, the length of the FilteredRootId (in varint format), and the filter that was applied to the repo during the last checkout.

To properly parse out the original underlying RootId (in most cases a Mercurial commit hash), we need to parse the varint that describes the length of the underlying RootId and parse the Snapshot file accordingly.

This diff introduces the utils that will be used to do that varint parsing logic.

Reviewed By: kmancini

Differential Revision: D51926558

fbshipit-source-id: f35ba4af4cf59e593fe86b4411d7f94cd722946d
2023-12-19 22:20:08 -08:00
Michael Cuevas
d492b09448 fix FilteredObjectID rendering
Summary: Readdir tests previously failed because the render method tried to pass a FilteredObjectID into the underlying BackingStore's renderObjectId() method. This diff parses the underlying ObjectID out and passes that into the underlying BackingStore instead of passing in an uninterpretable FilteredObjectId.

Reviewed By: kmancini

Differential Revision: D51829836

fbshipit-source-id: 865cbf8f5e5f73bce77fd8ab32a315c307a741e9
2023-12-19 22:20:08 -08:00
Saul Gutierrez
81e5df1336 config: prevent requires from the backing repo to affect symlinks and FilteredFS
Summary:
If a new repo was to be cloned with symlinks disabled on Windows, this would make the repo have a wrong config for symlinks.
In order for symlinks to be enabled for a working copy, they have to be enabled both in the EdenFS config for that checkout as well as having them inabled in hg by having `windowssymlinks` in `.hg/requires`.
Having symlinks enabled **in only one of the two** can cause really wonky behavior.

Some users were reporting having issues with symlinks being partially enabled on their working copies. This was caused by the backing repo having `windowssymlinks` enabled on the backing repo, since the requires is copied from there into the newly cloned repo.

This diff makes changes to that, preventing copying the requires file into a new one for both symlinks and FilteredFS, since both can be affected by this kind of behavior.

Reviewed By: MichaelCuevas

Differential Revision: D52311410

fbshipit-source-id: bca76757f1b9b6f2cafd4e024b8eafc0735e7e89
2023-12-19 18:09:50 -08:00
David Tolnay
0c77436ee0 Rerun autocargo to generate resolvers for virtual manifests
Summary:
Generated changes from {D52231478}.

NOTE: This needs to be folded into the MSDK-built autocargo binary diff. https://www.internalfb.com/intern/msdk/bump/?schedule_fbid=342556550408072

Reviewed By: zertosh

Differential Revision: D52231497

fbshipit-source-id: baadabc9dfabeb2ab0232568c2e4bf4df55e26eb
2023-12-16 13:33:41 -08:00
Bayarmunkh Davaadorj
25c93ffd88 add oncall annotation for TARGETS files in fbcode based on contbuild information - /data/users/bayarmunkh/target_oncalls_26_sapling
Summary:
This diff adds oncall to Buck TARGETS files in fbcode repository based on their contbuild information.
This diff was generated by this command:
  ./fbcode/ownership/coverage/submit_diff_with_file_oncall_mapping.sh /data/users/bayarmunkh/target_oncalls_26
see more context here: https://fb.workplace.com/groups/fbcode/posts/6551897871513663 and https://fb.workplace.com/groups/fbcode.devx/permalink/3149549092006627/
drop_conflicts

Reviewed By: markisaa

Differential Revision: D52166498

fbshipit-source-id: 5bf25a26cbd700b32bbb585d987d21137c8fc545
2023-12-15 16:34:00 -08:00
Andres Suarez
f6b8422289 Cleanup unnecessary dep removal
Summary:
`None` means "remove this dep from `Cargo.toml`". These deps are either
not autocargo managed or not actually used, so there is nothing to
remove.

Reviewed By: dtolnay

Differential Revision: D52216173

fbshipit-source-id: e94473d247f19b01be9099a50d97712144b40299
2023-12-15 14:40:01 -08:00
Andres Suarez
e105515507 Remove unused autocargo target configs
Summary:
These were missed before because they're listed in exclusions or are in
non-standard locations (e.g. `xplat/`).

Reviewed By: dtolnay

Differential Revision: D52217525

fbshipit-source-id: 0bd5a9832ead34869c46b7396521ecb364787001
2023-12-15 14:40:01 -08:00
Revathy Kasipandian
876fb99a92 apfs util command options changed.
Summary:
System/Library/Filesystems/apfs.fs/Contents/Resources/apfs.util options have changed.

https://fb.workplace.com/groups/edenfsmacos/permalink/1403036230302564/

Reviewed By: jdelliot

Differential Revision: D52210946

fbshipit-source-id: d9591f6ee52b74a67a76e6844e22918efa670fe7
2023-12-15 14:31:52 -08:00
Saul Gutierrez
4ea1e5038f symlinks: disable symlinks by default
Summary: There are some users reporting issues with symlinks again, so let's disable them for now. This diff essentially undoes the changes done on D51284233 without actually reverting most of the code in case we want to permanently disable them again

Reviewed By: jdelliot

Differential Revision: D52211990

fbshipit-source-id: 50f541ee984793c13c45b093377a4caeb11b7fc8
2023-12-15 12:30:06 -08:00
Katie Mancini
7dd594e55e make extension lists in doctor configurable
Summary:
It's a pain to add and remove extensions from our warn and blocklists in
eden doctor. It it takes a while for things to rollout since the change
is dependent on the eden package which only rolls out once a week.

Let's move these to eden configs so that we can change them with chef and
the new configerator configs.

Reviewed By: genevievehelsel

Differential Revision: D52140236

fbshipit-source-id: 737595f4fdc964b334cc3479a3a4a6369251306d
2023-12-14 19:01:50 -08:00
John Elliott
b8b2b89592 Add support to get the repo name from SaplingNativeBackingStore
Summary: HgImporter was the only way to get the repo name. With the removal of it, we a new way. Adding that to SaplingNativeBackingStore.

Reviewed By: xavierd

Differential Revision: D51911195

fbshipit-source-id: 7fcb61d72219d4e5851b31507c53c62f68df8476
2023-12-13 11:56:35 -08:00
generatedunixname89002005307016
a4926eabd9 Add annotations to eden/fs/py/eden/thrift/windows_thrift.py
Reviewed By: genevievehelsel

Differential Revision: D52118815

fbshipit-source-id: 01a0d40fd0c30741d28bb84aef2a1a1fcd6ee94f
2023-12-13 10:36:39 -08:00
John Elliott
70dc22aadc config: update config to enable inmemory catalog on Windows
Summary: The rollout of this feature has completed, but users need to reclone. Let's update the users checkout config to set the inode catalog type to be inmemory on Windows.

Reviewed By: kmancini

Differential Revision: D52005759

fbshipit-source-id: 0e3c6948fb57496bae87e71eb25e5eb1c88979f4
2023-12-12 18:51:42 -08:00
generatedunixname89002005307016
61d7fd01f2 upgrade pyre version in fbcode/eden - batch 1
Differential Revision: D52084766

fbshipit-source-id: 7896585c9d34aa108ee14237ddf598a0776dc857
2023-12-12 17:27:23 -08:00
Muir Manders
a7afe19498 cli: pass along SL_LOG env var to daemon
Summary: This is the Sapling form of EDENSCM_LOG.

Reviewed By: kmancini

Differential Revision: D52001131

fbshipit-source-id: 5932f96d0647e064cffa6279adebbf1c16a521d6
2023-12-11 08:59:58 -08:00
Richard Barnes
7b14f73cf8 Remove extra semi colon from eden/fs/inodes/FileInode.cpp
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`

If the code compiles, this is safe to land.

Reviewed By: palmje

Differential Revision: D51995015

fbshipit-source-id: c92e3c06ae30b98afdcb204c52db8ea3a4e28729
2023-12-08 17:29:10 -08:00
John Elliott
a7d8e63a0f Add ODS counters for backingstore retry failures
Summary: We have counters for retry success, but not for failure. Now that failure will not always result in a fallback to HgImporter we should add them.

Reviewed By: genevievehelsel

Differential Revision: D51794512

fbshipit-source-id: 108463e55c4feb20c19f7ab602365c089930601f
2023-12-07 13:03:02 -08:00
John Elliott
4fd7cd9c46 Report backingstore retry missing to scuba
Summary:
To get a full picture of the kinds of misses we have at each step adding in the backingstore misses on retry.

NOTE: we could go in a refactor HgImporter to return folly::Try<[Object]Ptr>, clean up the code a bit and unify the retry reporting here, but we are planning to remove that code soon.

Reviewed By: genevievehelsel

Differential Revision: D51784901

fbshipit-source-id: b0cb876c892ba2de077d38df49e73fa4785069b1
2023-12-07 13:03:02 -08:00
John Elliott
68ec4dde72 Move fallback to HgImporter to where fallback occurs
Summary:
The test for configuration falling back to HgImporter was placed earlier in the flow preventing using this test after falling back to backingstore. This change moves that test to between the fallback to backingstore and the actual fallback.

This is done so that we can add a GK (D51784706) to control rolling out configuration changes to stop the fallback path - the final step before removing it completly.

To ensure we only apply this new behavior to the versions of the code that include these changes, we are creating a new config setting (hgImporterFetchFallback) to replace the previous, similar settings. This will ensure that during rollout previous versions of EdenFS are not affected.

Reviewed By: genevievehelsel

Differential Revision: D51784900

fbshipit-source-id: fd3e6a160ceaaf2a125812bb42f2382324239e83
2023-12-07 13:03:02 -08:00
Andres Suarez
f715a62d73 Apply RUSTFIX
Reviewed By: abesto, shayne-fletcher

Differential Revision: D51944882

fbshipit-source-id: 77cd8ca3394924bbccfc9eb97aa2565a08bb7d31
2023-12-07 12:01:11 -08:00
Saul Gutierrez
92c1c209c9 build: increase stack size on Windows for avoiding stack overflows on non-oss target
Summary: D51538112 increased the stack size on Windows for the `eden/fs/edenfs-oss` target, which is only actually used for development. We should have done the same for the non-oss target, which this diff does.

Reviewed By: jdelliot

Differential Revision: D51929793

fbshipit-source-id: 3b749584718ac3211e9a2b2e9e3a564a249575d1
2023-12-06 21:40:49 -08:00
Katie Mancini
18936d5a40 better error message when eden fails to start flock
Summary:
Sometimes when there are two EdenFS's attempting to start at the same time
we run into flock error. It's possible we need to take the lock earlier to
avoid two eden's from getting this far in the process. Seems like this
locking code throws instead of returning false, so maybe this error should just
be swallowed and we fall back to the "another eden is running code path".

While we sort that out let's at least give the user a more informative error
message.

Reviewed By: genevievehelsel

Differential Revision: D51903606

fbshipit-source-id: 062921a6899a9e62b7770a199d329bf233f1168e
2023-12-06 15:21:09 -08:00
Genevieve (Genna) Helsel
2b4796c343 port more configs to EdenConfig.h
Summary: I am planning on moving these into `edenfs.rc`, so in order to avoid the confusing parse error startup message, this adds them.

Reviewed By: jdelliot

Differential Revision: D51829423

fbshipit-source-id: 7d8a45b33aaeed92a6f81c1b8819985d9ff5d992
2023-12-05 11:29:43 -08:00
John Elliott
b295dc093b Propagate errors from backingstore up through stack
Summary:
SaplingNativeBackingStore "eats" errors for single object fetches. This prevents certain kinds of logging to scuba and other actions that might be taken by higher layers of code.

Eventually, we wil changes these APIs to return futures, but in the meantime, we will switch them to return folly::Try's.

The propagation goes from SaplingNativeBackingStore to HgDatapackStore to HgBackingStore and all of their callers.

Reviewed By: kmancini

Differential Revision: D51777559

fbshipit-source-id: 177e97fc12a5438abe0ba83f97aa3b1367074b3a
2023-12-04 19:43:29 -08:00
John Elliott
dd06d8144e Unifiy object fetching miss reporting and add some new data
Summary:
Our object fetch miss reporting done via two different events: EdenApiMiss and HgImportFailure. EdenApiMiss is misleading (no pun intented) as it represents backingstore misses (local and remote). Neither of these events capture all that we want and EdenApiMiss had some wonky names.

This change fixes that, replacing both with ObjectFetchMiss. Additonally, it adds miss events for BlobMetadata.

Up next: we need to expose the failure causes from single object fetches through HgDatapackStore->SaplingNativeStore. Today they are eaten and only a pointer is returned.

Reviewed By: genevievehelsel

Differential Revision: D51733914

fbshipit-source-id: c592520da56a58a1d3e5a6198695857fe6c19451
2023-12-04 19:43:29 -08:00
John Elliott
65ff27b9ad Fix subtle issue where we could underreport EdenApiMiss events
Summary:
We were reporting EdenApiMiss events if a) there was an error and b) we had set the hg<Tree|Blob>FetchFallback flag.

We should have been reporting the even if there was an error and falling back if both conditions are true.

Reviewed By: genevievehelsel

Differential Revision: D51730692

fbshipit-source-id: e6471a706d4263321bfb4a0c56c97224c4365d5c
2023-12-04 19:43:29 -08:00
Saul Gutierrez
bbf2db1c2a edensparse: limit disabling sparse extension to filteredhg repos
Summary: Users may still want to run debug commands that involve sparse profiles on EdenFS repos, so we cannot really disable sparse profiles everywhere. This diff re-enables them for all non-filteredhg EdenFS repos.

Reviewed By: MichaelCuevas

Differential Revision: D51772393

fbshipit-source-id: 30052aebcf0f16e90de50ee5a2dccc0e380e8245
2023-12-04 13:35:20 -08:00
Genevieve (Genna) Helsel
53e02a29a8 replace config_test test value
Summary: I'm not sure this matters or not, but to clean up `zbgs`, replace `experimental_systemd` with a different bool config

Reviewed By: kmancini

Differential Revision: D51728414

fbshipit-source-id: 3b6c6756e84ccee16e7c8222f46f06c816616197
2023-12-04 13:21:55 -08:00
Jon Oh
60773d8f99 Change source of config to a configerator
Summary: Changes the config source to the configerator made before. It'll be easier to maintain and change

Reviewed By: genevievehelsel

Differential Revision: D51720288

fbshipit-source-id: 7854f324c694f7850454fafddb2eb403b1c22d98
2023-12-04 11:53:28 -08:00
Nikita Patskov
e2a08b0dab Remove explicit key
Summary: Title

Reviewed By: jbardini

Differential Revision: D51813530

fbshipit-source-id: dd472fd3fc937568a1c1b214faa6504878a6c116
2023-12-04 10:03:02 -08:00
David Tolnay
47c8f223f2 update platform010 & platform010-aarch64 symlinks
Summary:
Release notes: https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html

This release is coupled with an update of the `anyhow` and `thiserror` crates because the unstable standard library API for backtraces has changed.

Fbcode changes:

- `feature(default_free_fn)` deleted (D50300881)
- `noop_method_call` lint becomes warn-by-default (D50486032, D50516201)
- stronger `invalid_reference_casting` detection (D50488164)
- `feature(unix_chown)` has been stabilized
- `feature(provide_any)` and `std::provider` deleted
- `clippy::unwrap_or_else_default` renamed to `clippy::unwrap_or_default`
- type inference ambiguities (D51780425)
- `nu-command` build error (D51779062)

Reviewed By: AndreasBackx, shayne-fletcher

Differential Revision: D50294321

fbshipit-source-id: 0fac87f6ba072ad029f9ce41ce94ed813e855b20
2023-12-02 13:52:50 -08:00
Richard Barnes
6d6b5253ce Remove extra semi colon from eden/fs/telemetry/TraceBus.h
Summary:
`-Wextra-semi` or `-Wextra-semi-stmt`

If the code compiles, this is safe to land.

Reviewed By: dmm-fb

Differential Revision: D51777971

fbshipit-source-id: 773e23e38af97640a244306fa4205d0f2c9e40c5
2023-12-01 22:38:22 -08:00