Commit Graph

20033 Commits

Author SHA1 Message Date
Mateusz Kwapich
f7e8639689 option to rewrite dates in forward syncer
Summary:
We need that for current catchup to avoid confusing clients with backdated
commits.

Reviewed By: markbt

Differential Revision: D46743487

fbshipit-source-id: a71ee30eada63dab7c64cbe43a4495662fe04371
2023-06-16 04:08:02 -07:00
Mark Juggurnauth-Thomas
8eed042d80 cmdlib_caching: remove deprecated cachelib options
Summary: Remove the deprecated `--skip-caching`, `--blobstore-cachelib-only` and `--cachelib-only-blobstore` options.

Reviewed By: clara-9

Differential Revision: D45089767

fbshipit-source-id: 52707ce00865bfd9ed7e09f0df4f6ce190ac7481
2023-06-16 03:21:13 -07:00
Mark Juggurnauth-Thomas
32d13cc799 walker: specify cache-mode default
Summary: Walker previously specified a default for the deprecated `cachelib-only-blobstore` argument.  Switch to `cache-mode`, allowing us to specify local caching for all types, not just the blobstore.

Differential Revision: D45089769

fbshipit-source-id: 978ac545590935be5a825669db9df58f0281c41a
2023-06-16 03:21:13 -07:00
Jan Mazur
f34aeb993a show the path used when cert is not found
Summary: This is useful for debugging

Reviewed By: zzl0

Differential Revision: D46736892

fbshipit-source-id: cd8521b46c650888ec75ed0782f2792ae8ffdcff
2023-06-15 22:22:54 -07:00
Muir Manders
33e1d136d6 tests: enable rust status for test-commit.t
Reviewed By: sggutier

Differential Revision: D45510006

fbshipit-source-id: d7c8768762a0131be3cf1aebfddec6454d58f308
2023-06-15 19:48:34 -07:00
Muir Manders
2b6c27c219 workingcopy: ignore Git submodules in "status"
Summary: To avoid showing a bunch of "?" files, we need to ignore things within submodules. For watchman, we do similar to Python and add submodules to the ignored dirs list. For the manual walker, we similarly skip directories in the ignore list. Note that the walker already skipped the submodules due to the presence of the "dot dir" (e.g. ".sl") in the submodules, but I piped through the ignored dirs skipping to be consistent.

Reviewed By: quark-zju

Differential Revision: D46547238

fbshipit-source-id: b001dc02a3c73f69d74fe36615a812f9ac983944
2023-06-15 19:48:34 -07:00
Muir Manders
ae180addae status: fallback to Python for Git repos
Summary: Python status for Git has submodule aware logic we don't have in Rust, so we need to defer to Python. However, Python will still be able to use the internal Rust status API.

Reviewed By: zzl0

Differential Revision: D46547239

fbshipit-source-id: 2caf1436819219cea007307f602627fd1a38ef51
2023-06-15 19:48:34 -07:00
Muir Manders
9c2de6e351 workingcopy: kill SingleWalker fs walker
Summary: It wasn't used from Rust (only MultiWalker(threads=8) was used), and Rust walker is not enabled from Python. It's annoying to have to make changes twice, so let's kill the non-parallel walker.

Reviewed By: zzl0

Differential Revision: D46547240

fbshipit-source-id: 4a57222ec705059acbc6865f8e1a9701ae584ccc
2023-06-15 19:48:34 -07:00
Muir Manders
1648d2a0a6 filesystem: remove rust walker support
Summary: This wasn't enabled in production, and the parallel walker doesn't currently work from Python due to matcher GIL deadlock. Anyway, I'm working to make Python use the Rust status directly, so this intermediate optimization of using the Rust walker in the Python status won't buy us anything.

Reviewed By: zzl0

Differential Revision: D46646007

fbshipit-source-id: 645d88adb85700062c3edf2483fb5a5ffb76cca2
2023-06-15 19:48:34 -07:00
Muir Manders
c620498ea3 repo: add storage format type/methods
Summary: These make it more convenient to conditionalize logic based on storage format.

Reviewed By: zzl0

Differential Revision: D46547242

fbshipit-source-id: ef833c954090f5cb2b1c2c6e616d5d67a442886d
2023-06-15 19:48:34 -07:00
Muir Manders
d8a436f3f5 git: move ".gitmodules" parsing to Rust
Summary: I'm going to use this to skip submodules in the Rust status implemenation.

Reviewed By: zzl0

Differential Revision: D46547241

fbshipit-source-id: e5cf5dc5ee77aa3e8927ab3cf5922f3e29a25ae5
2023-06-15 19:48:34 -07:00
Eddie Shen
5db8c486ab Replace remaining atty usages with stdlib
Summary:
`std::io::IsTerminal` was stabilized in 1.70. It is intended to be a drop in replacement for `atty::is(Stdout)`.

This codemod removes all remaining instances of atty

`arc f` was ran twice, followed by two invocations of `arc lint -e extra --take RUSTFIXDEPS`. `arc autocargo` was also ran

This script was a little naive though, and as a result, I had to manually move the newly added imports to the correct line. I ran lints again afterwards.

Reviewed By: dbxfb

Differential Revision: D46736264

fbshipit-source-id: a686b96b1fa0aa4389f65487ed426f226c86e8e9
2023-06-15 18:42:33 -07:00
Mateusz Kwapich
e7b8e8b8b5 option to skip syncing empty commits
Summary: www has lots of empty commits that are being synced to all small repos. Until we fix that problem let's refrain from backsyncing any empty commits. I'm making it a tunable for easy on-off

Reviewed By: liubov-dmitrieva

Differential Revision: D46727657

fbshipit-source-id: 5f204cc8231fec3e6a4eaf25b6575c0d637d67a3
2023-06-15 08:46:20 -07:00
Pierre Chevalier
1017a247d0 non-oss work 79/n
Summary:
[plan_deletion] Implement `commit-deletion-plan-to-deletion-log-db` subcommand

This is the last necessary step before enacting the deletion.
As the outcome of this step, the deletion_log db is populated and we can start taking the necessary steps to safely proceed with the actual deletion of changesets and blobs.

We still need to document and potentially write tools to help with the whole process, including blobs redaction.

Differential Revision: D46724273

fbshipit-source-id: bc60209a28e2ee8a50ac0371f78c0b3be234781b
2023-06-15 07:57:35 -07:00
Haitao Mei
c27e9a8576 new admin tool creates a new struct to implement all features of bulk unlink
Summary: This diff moves all the bulb unlinking functions into a struct.

Reviewed By: mitrandir77

Differential Revision: D46759318

fbshipit-source-id: 143171706485ec6a56152bdfea6202221d88fe03
2023-06-15 07:51:33 -07:00
Haitao Mei
61bcdc04d4 new admin tool making the geting blobstores function for unlinking a key to be public
Summary: This diff makes the `get_blobstores` function to be public, so that we can use it to get blobstores. These blobstores are going to be used to unlink keys in a bulk.

Reviewed By: mitrandir77

Differential Revision: D46729000

fbshipit-source-id: 11d7ddc5f90527ebdb79141f61f1671997108ac5
2023-06-15 07:51:33 -07:00
Haitao Mei
f76eb1f9c6 new admin tool bulk unlink keys subcommand read keys from all files
Summary:
This diff allows the new admin tool to do the following for the new bulk unlking keys subcommand:
* Read the key list from the files
* Print all the keys extracted when running in dry-run mode
* Report the progress
* Fix the argument to take a boolean value

Reviewed By: mitrandir77

Differential Revision: D46725312

fbshipit-source-id: c039b89e00a9ffbbbee41e20617f45543ef147ce
2023-06-15 07:51:33 -07:00
Haitao Mei
b556d7cc08 Adding a new command to bulk unlink keys into new admin tool
Summary: This diff adds a new subcommand for our new admin tool, so that we can delete keys bulkly. The input is the directory that contains a list of files, each file contains a list of *Manifold* keys to remove.

Reviewed By: mitrandir77

Differential Revision: D46689957

fbshipit-source-id: 077b6a4c76872ef01bc7f0eab7096abeb87d7047
2023-06-15 04:17:16 -07:00
Eddie Shen
842b985bd4 Replace atty::is(Stdout) with stdlib
Summary:
`std::io::IsTerminal` was stabilized in 1.70. It is intended to be a drop in replacement for `atty::is(Stdout)`.

This codemod replaces all usages of `atty::is(Stdout)` with `stdout().is_terminal()`, importing the necessary paths.

It used this script (generated with assistance from Metamate):
```
#!/bin/bash

files=$(fbgs -sl "atty::is(atty::Stream::Stdout)" | arc linttool debugfilterpaths --take RUSTFMT)

for file in $files; do
  sed -i 's/atty::is(atty::Stream::Stdout)/stdout().is_terminal()/g' $file
done

for file in $files; do
  sed -i '1i use std::io::{stdout, IsTerminal};' $file
done
```

`arc f` was ran twice, followed by two invocations of `arc lint -e extra --take RUSTFIXDEPS`.

This script was a little naive though, and as a result, I had to manually move the newly added imports to the correct line. I ran lints again afterwards.

Reviewed By: danielocfb

Differential Revision: D46601191

fbshipit-source-id: 3f2269c518e36241ab0e995b87976323d7da9cc6
2023-06-14 15:29:14 -07:00
Eddie Shen
39b6073961 Replace atty::is(Stderr) with stdlib
Summary:
`std::io::IsTerminal` was stabilized in 1.70. It is intended to be a drop in replacement for `atty::is(Stderr)`.

This codemod replaces all usages of `atty::is(Stderr)` with `stderr().is_terminal()`, importing the necessary paths.

It used this script (generated with assistance from Metamate):
```
#!/bin/bash

files=$(fbgs -sl "atty::is(atty::Stream::Stderr)" | arc linttool debugfilterpaths --take RUSTFMT)

for file in $files; do
  sed -i 's/atty::is(atty::Stream::Stderr)/stderr().is_terminal()/g' $file
done

for file in $files; do
  sed -i '1i use std::io::{stderr, IsTerminal};' $file
done
```

`arc f` was ran twice, followed by two invocations of `arc lint -e extra --take RUSTFIXDEPS`.

This script was a little naive though, and as a result, I had to manually move the newly added imports to the correct line. I ran lints again afterwards.

Reviewed By: Imxset21

Differential Revision: D46601192

fbshipit-source-id: 18ef53a9fa25cbd733ca81f16b2c13ce8c5ddb98
2023-06-14 15:29:14 -07:00
Rajiv Sharma
c81071e34e Allow bypassing read-only status in gitimport
Summary: `gitimport` is typically used for mirror repos which by definition are locked. Creating or moving bookmarks on locked repos is disallowed by default. This behaviour can be overriden by passing the bypass flag. This diff adds argument support for bypassing the read-only check.

Differential Revision: D46722005

fbshipit-source-id: 9defcbc159a55d0e7ff197d8d732e3d5a208a998
2023-06-14 12:32:56 -07:00
Mark Shroyer
440f9da305 Use EDEN_TRY macro in FileUtils
Summary: Use the EDEN_TRY macro to reduce error-handling line noise.

Reviewed By: genevievehelsel

Differential Revision: D46668011

fbshipit-source-id: bb54ff710928b3a5c394b6e79474c25ef4775895
2023-06-14 12:16:45 -07:00
Mark Shroyer
46dde446e4 EDEN_TRY macro
Summary: Adds a macro to simplify bailing out of Try-returning functions, sort of like with Rust's question mark operator.

Reviewed By: chadaustin

Differential Revision: D46567326

fbshipit-source-id: f13eec678a101e423a99ba469a20d6de5513d73c
2023-06-14 12:16:45 -07:00
Zhaolong Zhu
ca12e2a75b bisect: optimize the check against skip revset
Summary: optimize the check against skip revset by reusing the unskipped result.

Reviewed By: muirdm

Differential Revision: D46687070

fbshipit-source-id: 01e5be4499daaa9e24437ddb16e2cc04f0436211
2023-06-14 12:08:24 -07:00
Zhaolong Zhu
a7e82b1613 bisect: support lazy evaluation for 'skip' option
Summary:
Currently, the 'skip' option is too slow when users want to use it to bisect on
a file or folder like below:

    sl bisect --skip "!( file('path:foo') & file('path:bar') )"

Since it tries to eval the skip revset upfront, which takes a long time for
current `file` implementation. This diff make it lazy evaluated.

Reviewed By: muirdm

Differential Revision: D46643574

fbshipit-source-id: c063fbea2bc0703772e07d5167adc8fbf989a68f
2023-06-14 11:07:02 -07:00
Zhaolong Zhu
38c190a35a bisect: add test for skipping revset
Summary: as title

Reviewed By: muirdm, sggutier

Differential Revision: D46643573

fbshipit-source-id: 1c1a46760667fc2b10623b709762eb1cbd9ba53e
2023-06-14 11:07:02 -07:00
Zhaolong Zhu
d0eff8a035 bisect: check bisect kind earlier
Summary:
move the bisect kind check earlier, so that it will not do unnecessary
node lookup

Reviewed By: sggutier

Differential Revision: D46643576

fbshipit-source-id: 624c6410aaf95f82a993093df4e24add6c5e48ea
2023-06-14 11:07:02 -07:00
Zhaolong Zhu
1c6609998e bisect: make state file format support 'revset' string
Summary: this will be needed for making 'skip' lazy evaluated

Reviewed By: muirdm

Differential Revision: D46643575

fbshipit-source-id: 53cfe2395d320d85582fbf707f62d69a5088bea2
2023-06-14 11:07:02 -07:00
Zhaolong Zhu
9772bf3c76 bisect: abstract a separate for updating state
Summary: we will update this function in the following diffs, abstract it to a separate function will avoid making the main function too complex

Reviewed By: muirdm

Differential Revision: D46643577

fbshipit-source-id: 227e0b60fe2efa1d6d00fa409ea95a30cc972747
2023-06-14 11:07:02 -07:00
Haitao Mei
354da6c438 newadmin tool now deletes keys from all the related blobstores II
Summary: We handle the error gracefully, when deleting a key from the underlying blobstores.

Reviewed By: RajivTS

Differential Revision: D46684795

fbshipit-source-id: 45349aab01e56b11fd1ab455aec2bb69d72c497b
2023-06-14 04:27:47 -07:00
Barys Skarabahaty
6e0743ebfc treat a failed blob metadata parse as missing cache
Summary:
If there's corruption in the cache, it should be considered a miss,
rather than failing.

Reviewed By: chadaustin

Differential Revision: D46577606

fbshipit-source-id: 4cc99e743e869422a149a073b726722896d971d4
2023-06-14 04:17:43 -07:00
Zhaolong Zhu
d3eaf5a42f copytrace: disable dagcopytrace for source missing files
Summary:
The dagcopytrace was enabled for source missing file in D46315431.

It's too slow if there are many files deleted in the source commit. I will debug the root cause tomorrow, let's disable it for hg repo first. We are not disabling it for git repo, because there is not alternative for git repos.

Reviewed By: muirdm

Differential Revision: D46711460

fbshipit-source-id: 4e20bbb34be126c13af081475953b83df61872df
2023-06-13 22:00:44 -07:00
Genevieve (Genna) Helsel
bcdb3c926f add Counters for failed local store lookups
Summary: Adding to track possible corruption issues we've been getting user reports about

Reviewed By: chadaustin

Differential Revision: D46706164

fbshipit-source-id: 6a868d9f9ffd3f72303123486bbb8312f2002072
2023-06-13 18:05:20 -07:00
Jan Mazur
5da5975071 import async-fcgi and http-body; add stream feature to hyper
Summary: Importing into third-party

Reviewed By: zertosh

Differential Revision: D46639634

fbshipit-source-id: c9eb7d056e75ae2c5d9a8bb9bcc781d419f65f4c
2023-06-13 17:56:22 -07:00
Haitao Mei
5f58f37936 newadmin tool now deletes keys from all the related blobstores
Summary: This diff allows the new admin tool to delete keys from all the related blobs (either the single blobstore specified by the id, or all the underlying blobstore given a repo)

Differential Revision: D46564415

fbshipit-source-id: d0299262a82acb4e1a9f4cedd5510418f270d527
2023-06-13 09:33:07 -07:00
Haitao Mei
8941996184 newadmin tool: adding a new func to construct all the underlying blobstores for multiplexed blobstre
Summary:
This diff adds a new function to construct multiple blobstores from a given repo.

The finaly step is to refactoring the existing `get_blobstore` function.

Reviewed By: RajivTS

Differential Revision: D46559402

fbshipit-source-id: 9b9901d00566556614264831f8643f7c6d4ee20f
2023-06-13 09:06:56 -07:00
Rajiv Sharma
eb70d07aeb Make statistics_collector job honor cancellation requests
Summary: Running a job in sharded setting requires it to support pre-emption in case ShardManager decides to move the repo around. This diff adds support for that pre-emption.

Differential Revision: D46514772

fbshipit-source-id: fb086e74a9c56e0ced5921877de49401bc426170
2023-06-13 04:01:12 -07:00
Rajiv Sharma
67a3a25555 Shard statistics_collector command
Summary: As in title. This tool is currently run as 5-6 different TW jobs that compute and publish data for specific repos. Instead of having multiple jobs, if we manage to shard this job across set of available tasks, it becomes much more easier to manage.

Differential Revision: D46483039

fbshipit-source-id: d7d879dee088c8f431c22915bd7ef9602b83aa00
2023-06-13 04:01:12 -07:00
Andres Suarez
af0f829543 Update strum and enable the derive feature
Reviewed By: diliop

Differential Revision: D46672815

fbshipit-source-id: e372ab53fd8f71b1011f8e1065c7d0ba38485c7a
2023-06-13 03:32:44 -07:00
Mark Shroyer
df148d223e Hostname normalization Python implementation
Reviewed By: xavierd

Differential Revision: D46503425

fbshipit-source-id: dae33a377a656d14c55f6095aea38b208d3e8c8d
2023-06-12 16:59:17 -07:00
Mark Shroyer
bd8b347dc7 Hostname normalization C++ implementation and test cases
Reviewed By: xavierd

Differential Revision: D46300186

fbshipit-source-id: f4784e03eb8d2f055db2015ee326ae24bc63de26
2023-06-12 16:59:17 -07:00
Mark Shroyer
056e016af7 Return correctly-sized string from win32 readFile
Summary:
In the win32 implementation of `readFile`, the ret string wasn't being resized
to the number of bytes actually read, which may be smaller than given in
`num_bytes`. This change makes it match the behavior of folly's readFile.

Reviewed By: xavierd

Differential Revision: D46532796

fbshipit-source-id: 1da3e4ff4190673796731610ae8a798b953d0c96
2023-06-12 11:11:55 -07:00
Haitao Mei
f98f3e94e6 newadmin tool: adding a new func of constructing a single blobstore from config and inner_id
Summary:
This diff adds a new function of constructing a single blobstore from config and inner_id.

Next step is to add a new function to construct multiple blobstores from a given repo.

The finaly step is to refactoring the existing `get_blobstore` function.

Reviewed By: RajivTS

Differential Revision: D46559565

fbshipit-source-id: b59e77e13fbe76ba013caa62bfeb9f56cbcf31d2
2023-06-12 07:50:08 -07:00
Haitao Mei
1a8a6bb35b newadmin tool: Construct blobstore inner ids from a multiplexed blobstore
Summary: This diff added a function to retrieve all the inner blobstore ids from a given multiplexed blobstore.

Reviewed By: RajivTS

Differential Revision: D46523044

fbshipit-source-id: e4c3b02e1672bc2eea3208bac4f23d879c004515
2023-06-12 07:50:08 -07:00
Youssef Ibrahim
49693566a4 remove mention of skiplist in comment
Summary: What are skiplists?

Reviewed By: mitrandir77

Differential Revision: D46640446

fbshipit-source-id: 485d3615a8344b3c217a3a378d37c231603c51a6
2023-06-12 05:13:04 -07:00
Rajiv Sharma
f65ed93617 Migrate statistics_collector to new Mononoke App
Summary: Now that the `blob_repo` dependency has been removed from `statistics_collector`, this diff migrates the tool from old Mononoke App to new Mononoke App getting rid of the old clap dependency.

Differential Revision: D46478775

fbshipit-source-id: dd713eef2175fa01934508445866d64ef01657f0
2023-06-12 03:41:37 -07:00
Barys Skarabahaty
429d9a6655 Add data integrity checks
Summary: In order to better understand what happens in cases described in https://fb.workplace.com/groups/edenfswindows/permalink/1315557692693439/ adding better logging and some data integrity checks.

Reviewed By: chadaustin

Differential Revision: D46605682

fbshipit-source-id: 485c5c83834cdde9ccfea9cfa94323cf03df7002
2023-06-09 14:29:55 -07:00
Katie Mancini
f4da0e5eb5 Add missing inodes in windows doctor
Summary:
eden doctor can discover when an inode is missing for a file, but can't
remediate the issue. restart usually remediates the issue, but it would be
better to have doctor remediate since restart can be very slow.

We could do something similar to our remediation for phantom inodes (performing
a filesystem operation). However, messing with the filesystem leaves us open to
races with concurrent modifications. The point of the filesystem io is to make
eden see a notification about a certain path and match it's state to the
filesystem. So we can directly do that instead.

We can more directly do this by introducing a thrift call to make eden match
it's internal state to the filesystem.

We could replace the other remediation with this thrift call. I'll leave that
for a follow up.

Reviewed By: xavierd

Differential Revision: D46243633

fbshipit-source-id: a1df5929428dc4f6c8fd71d826fe1e7371ebf283
2023-06-09 11:52:50 -07:00
Katie Mancini
5512c63552 gather all prjfs integration test basics
Summary:
We've got a couple sets of prjfs tests now and they have some utility functions.
Let's move this all into a base class so it can easily be reused.

Reviewed By: xavierd

Differential Revision: D46379827

fbshipit-source-id: c4b708a1effebe5f11c97a63519295be625c8018
2023-06-09 11:52:50 -07:00
Zhaolong Zhu
f570a5fe68 fbscmquery: optimize expensive repo scan
Summary:
`subset.filter(lambda r: False)` triggers an expensive repo scan. This
diff optimize that with an explicit empty smartset.

Reviewed By: quark-zju

Differential Revision: D46266771

fbshipit-source-id: bb6c8b4842369d3e165183bef0e22c3cb524111a
2023-06-09 09:05:58 -07:00