Commit Graph

82806 Commits

Author SHA1 Message Date
Jun Wu
acf9c13edb nodeipc: add NodeIpc::from_raw_file_descriptor
Summary:
Exposes the ability to construct `NodeIpc` from a Windows HANDLE, not a
msvcrt/ucrt's fd.

Reviewed By: zzl0

Differential Revision: D46811167

fbshipit-source-id: 94f48dc0d059bca109c1792dceb0b733e4737adf
2023-06-21 14:49:59 -07:00
Jun Wu
d027cea337 nodeipc: rename raw_fd to libc_fd
Summary:
In the next change I'm adding "raw ..." concept. Let's rename `raw_fd` to
`libc_fd` to make it obvious that the raw something is different from the raw
"HANDLE" on Windows.

Reviewed By: zzl0

Differential Revision: D46811165

fbshipit-source-id: e0fe48633fd8d928ce7d7ae0652f041a90aec922
2023-06-21 14:49:59 -07:00
Open Source Bot
5fa7ab83cc Updating submodules
Summary:
GitHub commits:

16cb556c25
594363cd65
98c6d7fd80
54c6345f24
24c844032b
2d642ec96a

Reviewed By: jailby

fbshipit-source-id: da66fd3832bbdf49d445d1201b48a1503d6f7d0f
2023-06-21 13:50:45 -07:00
Jeremy Braun
e24f2bf601 format operations in the tracefs log that have two associated paths
Summary:
While most PrjFS operations only communicate about the filesystem object they're modifying via the [`PRJ_CALLBACK_DATA->FilePathName`](https://learn.microsoft.com/en-us/windows/win32/api/projectedfslib/ns-projectedfslib-prj_callback_data) member, notifications via the [`PRJ_NOTIFICATION_CB`](https://learn.microsoft.com/en-us/windows/win32/api/projectedfslib/nc-projectedfslib-prj_notification_cb) have a `destinationFileName` argument as well.

This is documented as:
> If notification is PRJ_NOTIFICATION_PRE_RENAME or PRJ_NOTIFICATION_PRE_SET_HARDLINK, this points to a null-terminated Unicode string specifying the path, relative to the virtualization root, of the target of the rename or set-hardlink operation.

While the individual STRACE `NotificationArgRenderer` functions handled the extra path, `PrjfsLiveRequest::formatTraceEventString` does not.

This forwards the string to that object, allowing it to be rendered if needed, so that it shows up in the `eden trace fs` output.

Reviewed By: xavierd

Differential Revision: D46809287

fbshipit-source-id: 781db1d911a975902d0b27d9ba4f553cc3b85299
2023-06-21 11:48:17 -07:00
Open Source Bot
fcdc308e3e Updating submodules
Summary:
GitHub commits:

f758579ffb
aaa1b708e6
0abd76d5df
0ee52c8903
b5f3ae1cc9
97e002d55c

Reviewed By: jailby

fbshipit-source-id: 8d044a7c55e5f7e3aa0d63df03d74b94750fcd0d
2023-06-21 11:42:21 -07:00
Egor Tkachenko
0c0282221b non-oss work 82/n
Differential Revision: D46836985

fbshipit-source-id: da87e06165fe72044c2944f45fcac045c8a40286
2023-06-21 10:04:36 -07:00
Open Source Bot
ab52846188 Updating submodules
Summary:
GitHub commits:

84cbdcfb2e
4a892bbcf5
4f15885d38

Reviewed By: jailby

fbshipit-source-id: 16485f8eb324f08c9d58f2bc5c606ee31427fbc8
2023-06-21 09:11:25 -07:00
Muir Manders
2ddb02440c RepoPath: validate \r as invalid byte
Summary: We were forbidding \n but not \r. A couple Python spots validate against "\r" and "\n" in filenames (scmutil.checkfilename and manifest._checkforbidden), so let's do it in Rust as well.

Reviewed By: zzl0

Differential Revision: D46646011

fbshipit-source-id: 41b5cbad057e2b966e3c00011d75cd6cd6e804fc
2023-06-21 08:29:03 -07:00
Muir Manders
3bf46e3cd8 tests: use Rust status in test-audit-path.t
Summary:
This test needed significant changes to use remotefilelog (unrelated to Rust status).

In particular:
- "hg cat" doesn't report "no such file" for non-existing files. Previously that came from py manifest, but Rust manifest walk doesn't support.
- Kill tampered bundle check. I tried for a while to get this working, but everything fails really early with the Rust manifest since bad paths are immediately rejected by the RepoPath type.
- Various update-over-symlink tests now work since the Rust vfs will remove symlinks in order to write the new file (thus avoiding the "xxx traverses symbolic link yyy" audit error).

Also this test revealed the need to process directories in the Rust status to catch a file being replaced by a directory. I changed the (Watchman) code path to no longer skip directories returned from watchman.

Reviewed By: zzl0

Differential Revision: D46646010

fbshipit-source-id: a2f8a92e85a97611212d917b2a6118f0dd1f5eed
2023-06-21 08:29:03 -07:00
Muir Manders
b4a36a0221 tests: remove test-advice-header.t
Summary:
The x2p auth advice header is handled/displayed by the network doctor in practice now.

I'm making tests support the Rust status, and opting to remove this one instead of update it.

Reviewed By: zzl0

Differential Revision: D46646012

fbshipit-source-id: 72bd074b0e8d76ecbc4206920f6c8867d6d794cd
2023-06-21 08:29:03 -07:00
Muir Manders
b4986423d1 status: use Rust status in test-casecollision.t
Summary: I had to tweak the case collision auditor to exclude untracked files. The Rust status (using Watchman) seem so to add untracked files to the dirstate earlier than Python, which was causing extra "possible case-folding" warnings.

Reviewed By: quark-zju

Differential Revision: D46832704

fbshipit-source-id: fa0e30df757804804ca437df94a4fb4b56dcbeda
2023-06-21 08:29:03 -07:00
Muir Manders
6a017d0f75 status: support match.bad() for Rust status
Summary:
Some Python commands depend on the "bad" matcher callback getting called by dirstate.status(). Tweak things so this happens when we use the Rust status as well. This also adds support for the "clean" option when using the Rust status since clean files and "bad" are somewhat coupled.

I moved invalid file type detection from filesystem.py into dirstate.py so it covers Rust status as well.

Reviewed By: quark-zju

Differential Revision: D46646006

fbshipit-source-id: 28278af15e02e0f794aefc7bde850ce58b319ac6
2023-06-21 08:29:03 -07:00
Muir Manders
0313941fa6 status: enable workingcopy.ruststatus for some tests
Summary: It aleady passes for these, so turn it on.

Reviewed By: quark-zju

Differential Revision: D45510980

fbshipit-source-id: f45a2dbe11186411adc259863b88c6ff5ee1914e
2023-06-21 08:29:03 -07:00
Muir Manders
aeb54654a3 tests: enable workingcopy.ruststatus for debugruntest
Summary: It's annoying to have to remember when this setting is and isn't enabled by default.

Reviewed By: quark-zju

Differential Revision: D45510982

fbshipit-source-id: 7d54c0c95d7edf61f358692b1a7c487e5889b5fa
2023-06-21 08:29:03 -07:00
Open Source Bot
3265fe849f Updating submodules
Summary:
GitHub commits:

dbd9f5fdb0
6472d2d5f4
f44dcd2314
0f4adcf81b

Reviewed By: jailby

fbshipit-source-id: 8f11205345df2fd05bae27523541f13e2e5b0bab
2023-06-21 05:37:58 -07:00
Liubov Dmitrieva
0e7419f010 add option for consistent routing of single tree requests and single
Summary:
add option for consistent routing of single tree requests and single blob requests

Meta:

Background:

We are having a lot of traffic for single tree blob or single file blob:
https://fburl.com/scuba/mononoke_test_perf/0eainxd3
https://fburl.com/scuba/mononoke_test_perf/0ye4eduq
Let's route them consistently!

Reviewed By: quark-zju

Differential Revision: D46860178

fbshipit-source-id: 50298c583d82585b3345ec4c4ca6b7ab4ab57ab1
2023-06-21 04:14:20 -07:00
Open Source Bot
bf3dd634c2 Updating submodules
Summary:
GitHub commits:

53c3aae6ab
84de8ba0af
0803e4cd3d
228da7a8b3
ed8aa91871
9367edef9d
459f6366fa
6bdf894f98
a0c5a7218e
04e5b7d63d
3e6f81271e
c5be8c9d15

Reviewed By: jailby

fbshipit-source-id: 4dfd897341b37b80264b6c043e57c7826d81b803
2023-06-21 01:03:05 -07:00
Open Source Bot
cd95188cef Updating submodules
Summary:
GitHub commits:

7ae149b678
9a5d0ec397
c3c1126def
331180d8bc
db94bf110f
f8357ae265
7a90a1dc2c
2926e0718c
2cf803545e
f4dd29c548
0490e63a2b
a26d4c8a83
8f585bcef6
7300aa31d1
19e37767ea
8d90bd88ba
83f60c640b
c9278c44dc
8f1b877774
5bc32eb109
bd1c76f294

Reviewed By: jailby

fbshipit-source-id: fade021fc92f12b5a746a1cc8645e3d617a5d7ab
2023-06-20 23:06:09 -07:00
Genevieve (Genna) Helsel
68fac5cd33 explicity copy stats in lambda in LocalStore
Summary: Followup from D46706164

Reviewed By: xavierd

Differential Revision: D46877765

fbshipit-source-id: 4a5ea4676c55d13e6292472d26089e2b0f653788
2023-06-20 17:22:09 -07:00
Mateusz Kwapich
0ee50a92c3 pushrebase - allow exemptions from casefolding check
Summary:
The casefolding pushrebase check is blocking the sync of www commits causing
problems. Let's exempt www/ dir from it.

We'll also have to modify commit hooks - but that's a separate thing.

Reviewed By: markbt

Differential Revision: D46860559

fbshipit-source-id: 87db959e0d025c0c1fc5c6cfecbdcf96af9e0f81
2023-06-20 16:48:55 -07:00
Zhaolong Zhu
e662d3f7cd bisect: skip the sparseskip logic for Eden repo
Summary: skip the unnecessary sparseskip logic for Eden repo.

Reviewed By: quark-zju

Differential Revision: D46865714

fbshipit-source-id: 660ccc8e1ed740ad6db9aeff350fd5e87089816d
2023-06-20 15:26:46 -07:00
Haitao Mei
a66a40a339 new admin tool bulk unlinking refactoring
Summary:
This diff does the following refactoring:
* Remove redundent  key checking when parsing blobstore key, and repo_id from it
* Replace all the `writeln!` with `println!`
* Print errors using `eprintln!`
* Remove misuse of verbose

Differential Revision: D46857681

fbshipit-source-id: 1b065756eb91d8b4b67422ef49ded2783660992f
2023-06-20 10:39:12 -07:00
Haitao Mei
4d25e33775 new admin tool print how long does it take to delete all the keys from a file
Summary: This diffs allows the new admin tool to print out how long it takes to process each file during bulk blobstore key unlinking.

Differential Revision: D46838088

fbshipit-source-id: 92fa57edcce5b171a1d4f6be6d7a57571fdb618b
2023-06-20 09:07:49 -07:00
Haitao Mei
39d3400de2 new admin tool uses HashMap to cache the blobstores regarding a given repo_id
Summary:
This diff:
* Adds a new HashMap to store the blobstres, regarding a given repo_id, to avoid duplicated computation
* Removes some debugging output

Differential Revision: D46802649

fbshipit-source-id: 8ddf0243b192b5684af2d4a430cdb8873a78246d
2023-06-20 09:07:49 -07:00
Haitao Mei
29d634f146 new admin tool does the actual deletion for the bulk key unlinking
Summary:
This diff allows the new admin tool to actually delete the content from the blobstore.

When the key is not present, there is nothing happening.

Differential Revision: D46802651

fbshipit-source-id: ac1d9aabcb4fd17455263c29b1348f5d1619868b
2023-06-20 09:07:49 -07:00
Pierre Chevalier
6ed7f57fcc non-oss work 80/n
Summary:
[plan_deletion] Add subcommand to redact relevant blobs

To make it easy to use in the context of plan deletion, we take the provisional deletion plan issued from the `propose-deletion-plan` subcommand in and we output the redaction id to a file.

In the real world, one would use this redaction id to make a diff to the mononoke config in configerator and restart the mononoke servers to make sure that the redaction actually takes effect before moving on to the next step.

Reviewed By: markbt

Differential Revision: D46768075

fbshipit-source-id: 368dafd485a02d677f3a74c6ede59a80cbe931d4
2023-06-20 07:15:08 -07:00
Pierre Chevalier
f377936c00 Expose fetch-key-list through the API and the CLI
Summary:
The current interface relies on the assumption that redacted content only relates to file contents.
`list`, which is the way to read what was redacted discovers the blobs for filecontents by walking the fsnodes manifests.

For a feature I'm working on, I need to be able to redact arbitrary blobs, so I need a way to identify what was redacted
without relying on some derived data blobs being available.

Reviewed By: markbt

Differential Revision: D46806525

fbshipit-source-id: 78b5470d4dd741538e3e85353c0b1634f3b83b1c
2023-06-20 07:15:08 -07:00
Pierre Chevalier
14bbdd45bf Make the API to the redaction crate more minimal
Summary: Instead of taking in the full context of a `MononokeApp`, only take the two blobstores that we need.

Reviewed By: markbt

Differential Revision: D46768087

fbshipit-source-id: 773f0f31e12c58ee0cc8341e638fcbcedde8bab9
2023-06-20 07:15:08 -07:00
Pierre Chevalier
2fe77034e8 Extract redaction feature to its own crate
Summary:
The crux of the redaction process is this `create_key_list` function which appends each key to the redaction blobstores and provides instruction to generate the correct redaction config.

I will need to re-use this mechanism, so extract it to an accessible crate.

Reviewed By: markbt

Differential Revision: D46763714

fbshipit-source-id: 8f06a12c6348bc49d0ca4fe65155818a216c5b88
2023-06-20 07:15:08 -07:00
Muir Manders
e809d770f9 tests: fix test-status-mlog.t on Windows
Summary:
The blackbox was reporting a mode mismatch. The cause was the filesysytem walk yielding a mode with permission bits set (e.g. 0666), but os.lstat within dirstate.normal() yields a mode without permission bits set (e.g. 0000). Fix by only reporting a mode change when the executable bit changes (which seems like the intention of the code).

I don't think this is a recent change in behavior, so I'm not going to look further into it. Hopefully the Python filesystem code will go away soon with the Rust status.

Reviewed By: zzl0

Differential Revision: D46848722

fbshipit-source-id: cdd73137ae891bc8038d7d7ddcd09d8c95170051
2023-06-20 06:19:16 -07:00
Rajiv Sharma
6da90296c8 Clippy Fixes
Summary: As in title

Reviewed By: mitrandir77

Differential Revision: D46855503

fbshipit-source-id: 715548f1a138e950bc2ae00e9b83a47a13944109
2023-06-20 05:19:24 -07:00
Haitao Mei
c8968599aa new admin tool extract the blobstore key from the given key
Summary:
This diff allows the new admin tool to extract the blobstore key from a given key.

For example, `flat/repo2122.blame.fileunode.blake2.2e58d897760aa5927c7ca1b0755992c9109be6048a9dc1deab1c86a4619f5839` will give `repo2122.blame.fileunode.blake2.2e58d897760aa5927c7ca1b0755992c9109be6048a9dc1deab1c86a4619f5839`.

Differential Revision: D46802650

fbshipit-source-id: bec63353b1ca50eeeab73cd84b5e3d8fb967c694
2023-06-20 05:17:23 -07:00
Haitao Mei
0b7b932ef6 Implement getting blobstores for a given repo id
Summary:
This diff adds
* a new function to extract repo id from a given key
* a new function to construct all the blobstores given a repo id

Differential Revision: D46763054

fbshipit-source-id: 64bb1ab4fd8bcae8ab414dd03e78f0a7c2dd5639
2023-06-20 05:17:23 -07:00
Youssef Ibrahim
034dc93e70 commit_graph: use fetch_edges_required and fetch_many_edges_required everywhere except in exists, changeset_parents and changeset_generation
Summary: Some of the usages of the commit graph (e.g. in pushrebase) query very recent commits that might not have been fully replicated in xdb yet. This diff switches to using fetch_edges_required and fetch_many_edges_required everywhere except in exists, changeset_parents and changeset_generation, to avoid any errors caused by replication lag. This shouldn't cause any performance degredation as we always use the normal read connection first and only query master in the rare case that a commit is missing from replicas.

Reviewed By: mitrandir77

Differential Revision: D46842804

fbshipit-source-id: 3822d883b079447d0af90c9169cd3db7600f9b25
2023-06-19 14:20:27 -07:00
Youssef Ibrahim
0b9254b329 commit_graph: use fetch_edges_required in changeset_generation_required and changeset_parents_required
Summary: The SQL implementation of fetch_edges_required first tries fetching the changeset edges using the normal read connection, then tries to fetch any missing changesets using the master connection. This can sometimes be the desired behavior when working with very recent commits so let's expose it through changeset_generation_required and changeset_parents_required.

Reviewed By: markbt

Differential Revision: D46796193

fbshipit-source-id: 38b3d79dd88ca4b8b98f36705ca1a215379a87b3
2023-06-19 08:30:20 -07:00
Youssef Ibrahim
1afff25d5b newadmin: add the missing blobstore fetch decodings
Summary: Added the missing blobstore fetch encoding except RedactionKeyList as that require creating a separate config and already has its own newadmin command.

Differential Revision: D46491769

fbshipit-source-id: 82208ac9dcb1acb5370ff7904c285e843be4f18f
2023-06-19 07:08:40 -07:00
Mateusz Kwapich
fbea1eb670 change the megarepo tool to not use commiter date
Summary:
This makes commits created by megarepo tools roundtrippable through bonsais (so far they were not).
D27852341 shows that it's not a problem for actual backup job but.. it's a
problem for example for mirror_hg_commits binary so let's make thos commits
nice and tidy.

Reviewed By: mzr

Differential Revision: D46489608

fbshipit-source-id: d15ba6f6622f51189a1ba9e76efd68faf1bf2b71
2023-06-19 06:28:57 -07:00
Mateusz Kwapich
e058be184f new, faster verification
Summary:
Verification is used to verify if given megarepo mapping configuration can be cleanly applied to given pair of small repo and large repo commits. It's used when we want to change current config and we want to check if according to the new config the mapping is still sound.

The previous *fast path* verification worked by limiting the amount of visited entries to `O(small repo)`

The new fast path verification doesn't walk every file in the repository, instead it leverages FSNodes to compare hashes of entire directories. This was if the repository verifies OK the verification is very fast. The amount of entries visited is `O(differences to report + number of config entries)`. When the configuration is simple and the repository is intact (usual case) it's almost instant. In case of more complex configurations (like ovrsource one) it's still **much** faster than current one.

WARNING: The implementation is a bit hacky due to the path mover functions being orignally designed with moving file paths not, directory paths. The hack is mostly contained to wrap_mover_result functiton.

Differential Revision: D45864549

fbshipit-source-id: 2fad0ed29a5718e655fa4a69b28306ca3db31dda
2023-06-19 03:38:35 -07:00
Mateusz Kwapich
6dc96eaecf add committer date and time support
Summary:
I want to test for some bug in megarepotooling and I'd like to use that
feature.

Differential Revision: D46440647

fbshipit-source-id: 1f4bb0d937f6e681a02f9843a7241fde4ae9b774
2023-06-19 03:33:58 -07:00
Mateusz Kwapich
b15dc88eb6 add author_date
Summary: For completeness it would be great to have it.

Differential Revision: D46440646

fbshipit-source-id: 0c57ab1a5b865ba3a93cc46ac92c9345e2a39d86
2023-06-19 03:33:58 -07:00
Mateusz Kwapich
b203146f0f add committer and committer date to test commits
Summary:
Some of our commits have those fields set so let's allow setting them on test
commits.

Differential Revision: D46440648

fbshipit-source-id: 393d9fcb616ddee5481f239264ab87bf5c8315e9
2023-06-19 03:33:58 -07:00
generatedunixname89002005320047
34e5d05ffe Migrate "eden/testlib" from LLVM-12 to LLVM-15
Summary:
fbcode is migrating to LLVM-15 for safer and more up-to-date code and new compiler features. All contbuilds in your directory have passed our build test with LLVM-15, and your directory does not host any packages. This diff will migrate it to LLVM-15.

If you approve of this diff, please use the "Accept & Ship" button. If you have a reason for why it should not build with LLVM 15, please make a comment and send it back to author. Otherwise we will land this on Thursday 06/15/2023.

See the [FAQ post](https://fb.workplace.com/groups/llvm15platform010/posts/749154386769776/)! Please also direct any questions to [this group](https://fb.workplace.com/groups/llvm15platform010).

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

Build directives:

Reviewed By: meyering, zzl0

Differential Revision: D46662743

fbshipit-source-id: 1af43eea7bb103d29f3b409634f1b7a60ae84c88
2023-06-17 22:06:53 -07:00
Chad Austin
d110d684f2 hooks: allow other nocommit spellings
Reviewed By: mzr

Differential Revision: D46464575

fbshipit-source-id: d2cf8059062ea68f465a5db40185f0faec3b89e3
2023-06-16 14:53:10 -07:00
Shayne Fletcher
ca860fbcef Update autocargo component on FBS:master
Reviewed By: zertosh

Differential Revision: D46811187

fbshipit-source-id: 5d4e3993ccbc3871bf56495822d15de8d73f832c
2023-06-16 14:06:54 -07:00
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
Open Source Bot
0299d9bb5f Updating submodules
Summary:
GitHub commits:

37e3b8f02d
3bbe4aca62
788f650df5
478a705ee4

Reviewed By: jurajh-fb

fbshipit-source-id: 9969b9d93e65f0adae4da5a7d725ea031a2380ee
2023-06-16 01:55:45 -07:00
Open Source Bot
787949b159 Updating submodules
Summary:
GitHub commits:

6bb1732841
cf228b091f
9079e21d32
bc04ec85db
db40b17b67
e339b1044c
f2be07b23e

Reviewed By: jurajh-fb

fbshipit-source-id: 42e538b8df98b942391036e3ee3c299f2c8e0738
2023-06-16 00:14:06 -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