Commit Graph

19904 Commits

Author SHA1 Message Date
Xavier Deguillard
1c20e574cc telemetry: fix typo in counter name
Summary:
Both the getBlobMetadata and fetchBlobMetadata were publishing to the same counter, making them indistinguishable.

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

Reviewed By: genevievehelsel

Differential Revision: D46343472

fbshipit-source-id: 04e09372c21dd5cb09336259ff34a5394d10d3b4
2023-05-31 20:38:26 -07:00
Liubov Dmitrieva
45565b3045 add new ods logging for bookmark fetching from phases crate
Summary:
add new ods logging for bookmark fetching from phases crate

This would help with investigation sevs like S344849, also having this info we
can setup alerts.

Reviewed By: YousefSalama

Differential Revision: D46314640

fbshipit-source-id: 66e72da19ad4eb528c78d0783c297746f57cd4f1
2023-05-31 13:57:24 -07:00
Xavier Deguillard
61b02f8f86 Back out "linearize control flow in EdenServer::mount"
Summary:
We've seen crashes on Windows when the mount is initialized but a later step at
mount time fails. In between these 2 events, if a write to the working copy
happens the ProjectedFS code assumes that the InodeMap is initialized and thus
tries to access the rootInode. This assumption is unfortunately broken by the
call to mountFinished and the code should instead follow the regular unmount
code path to make sure that no pending notifications are inflight.

I suspect NFS and FUSE also would exhibit the same issue.

Reviewed By: kmancini

Differential Revision: D46169999

fbshipit-source-id: ed1eb17dc2f084acb7e2d88c555150b3b8c6662e
2023-05-31 12:15:03 -07:00
Pierre Chevalier
2db9d7227d Enable shard manager to load unredacted repos
Summary:
This offers a  new interface for Shard Manager managed repos to be able to load redacted content.

The new API entry point: `open_managed_repos_unredacted` is analogous to `open_repo_unredacted`, but supports a Shard Manager based workflow.

Reviewed By: RajivTS

Differential Revision: D46280863

fbshipit-source-id: e2e4aebcb08d01f3be97d11d6fe8da2822ba6f29
2023-05-31 04:50:12 -07:00
Pierre Chevalier
4c8b8f43b6 non-oss work 61/n
Differential Revision: D46228970

fbshipit-source-id: 81a0b823ef88e27c324f16de412fce0d10bf7633
2023-05-31 04:50:12 -07:00
Barys Skarabahaty
cecd3a9582 Adding a possibility to configure the blake3 key
Summary: Adding a way to configure the blake3 key for blake3 hashing

Reviewed By: chadaustin

Differential Revision: D44499469

fbshipit-source-id: 344edd91cfc867c8a49d0db9369dfe2132e86c77
2023-05-30 23:10:10 -07:00
Zhaolong Zhu
3bc3732b8d copytrace: add metrics for content similarity fallback result
Summary: I am planning to enable `copytrace.fallback-to-content-similarity=True` for hg repos, and will use this metric to monitor how useful the content similarity fallback is

Reviewed By: muirdm

Differential Revision: D46163311

fbshipit-source-id: d21b0288965f8ec4da7c6c80e37d1b557b357ea6
2023-05-30 20:32:55 -07:00
Zhaolong Zhu
19d7f8214c copytrace: make dagcopytrace instance a singleton
Summary: Our cache is in the dagcopytrace instance, so let's make it a singleton.

Reviewed By: quark-zju

Differential Revision: D46105882

fbshipit-source-id: 0984015e7b052482b27f950fc05563c432aa23b1
2023-05-30 20:32:55 -07:00
Zhaolong Zhu
d9171bcf51 copytrace: add batch move candidates cache for rename finders
Summary: Optimization for directory move caused renames.

Reviewed By: muirdm

Differential Revision: D46105883

fbshipit-source-id: 69aee540b14cde9112f6327b6c782714109cac04
2023-05-30 20:32:55 -07:00
Zhaolong Zhu
875c353d48 copytrace: add test for batch move
Summary: Add tests for dir move

Reviewed By: muirdm

Differential Revision: D46149478

fbshipit-source-id: 28d98a33ac2f1c47e407f744ecfa496e4376e4bd
2023-05-30 20:32:55 -07:00
Zhaolong Zhu
96f993dcae copytrace: add batch move detection
Summary: this function will be used in the following diff

Reviewed By: quark-zju

Differential Revision: D46105885

fbshipit-source-id: 9d02fb62a44b1e5bd18eba5236522e297fae0f64
2023-05-30 20:32:55 -07:00
Rajiv Sharma
af2314d831 Using BonsaiTagMapping in GitImport and RemoteGitImport
Summary:
This diff modifies the behavior of `gitimport` and `remote-gitimport` when importing `annotated-tags`. In addition to:
- storing the raw tag
- converting the tag to a bookmark
- storing the metadata of the tag as changeset
this diff maintains a mapping between the tag-name and the changeset representing the metadata of the tag. This mapping would be useful to answer queries about the tag metadata when queried through Git and also enable going back to Git from Mononoke without losing data.

Differential Revision: D46067809

fbshipit-source-id: e2463160cdf647b50fa4ecfe4674d079016b4adc
2023-05-30 12:20:40 -07:00
Youssef Ibrahim
79fd5fd16a mononoke_api: implement an alternative to ChangesetPathHistoryContext::history using the new commit graph
Summary: Implement an alternative to ChangesetPathHistory::history using the new commit graph. This is almost identical to the skiplist implementation except that an (incorrect) optimization was removed that was trying to minimize the number of is_ancestor queries which should no longer be needed as they are a lot faster with the new commit graph.

Differential Revision: D46109911

fbshipit-source-id: 3e8f0c36a48084116673dda3741de87e0741f1a2
2023-05-30 11:47:19 -07:00
Youssef Ibrahim
81063c4c9d mononoke_api: implement an alternative to ChangesetContext::history using the new commit graph
Summary: Implement an alternative to ChangesetContext::history using the new commit graph by using AncestorsStreamBuilder. Also made the tests not depend on the exact output history order but instead accept any topological order.

Differential Revision: D46109910

fbshipit-source-id: 31f3e219e9addf04b49fc500ad245d541f110887
2023-05-30 11:47:19 -07:00
Youssef Ibrahim
899a3aed12 commit_graph: implement AncestorsStreamBuilder
Summary:
Factors out the logic of creating an ancestors stream to a builder to allow for more customizability (required for ChangesetContext::history) and reduce code duplication.
Additionally this optimizes range_stream to only traverse changesets that are descendants of start_id. Ancestry checks are kept to a minimum (worst case O(merges)) by only checking on parents of changesets that have a skip tree parent with generation lower than the generation of start_id.

Reviewed By: liubov-dmitrieva

Differential Revision: D46276429

fbshipit-source-id: 65c4f2892c92baaab0fef4f5041f06095ec49e05
2023-05-30 11:47:19 -07:00
Egor Tkachenko
7ee654f3e8 Add facet to interact with deletion log db
Summary: Facet and related boilerplate to construct it

Differential Revision: D46153855

fbshipit-source-id: 480d69deb4ff714541970e63df775a500e2cbb33
2023-05-30 02:01:31 -07:00
Genevieve (Genna) Helsel
d3ae451c74 allow using SqliteOverlay on non-Windows
Summary: allow using `SqliteOverlay` on non-Windows, since  OverlayChecker has now been updated to work with it.

Reviewed By: chadaustin

Differential Revision: D44105360

fbshipit-source-id: 5f78e6c9b5323faeee394da4a51d7e84f8d44a2f
2023-05-29 22:38:14 -07:00
Xavier Deguillard
71eebd2356 store: fix a nullptr derefence in LocalStoreCachedBackingStore
Summary:
In the rare case where fetching both the BlobMetadata and the Blob failed, the
LocalStoreCachedBackingStore would still try to dereference the nullptr Blob,
leading to a crash.

Reviewed By: chadaustin

Differential Revision: D46211469

fbshipit-source-id: f98dd215dbda432507f3823439d354d3d662dc6f
2023-05-26 09:16:16 -07:00
Youssef Ibrahim
3febd2a8eb commit_graph: add a newadmin command for finding children of a commit
Summary: We didn't have a way to do this before so let's add it.

Reviewed By: mitrandir77

Differential Revision: D46190481

fbshipit-source-id: 84544f0226ef3a4ef4d8ac9b4bf66551e4671793
2023-05-26 04:38:42 -07:00
Jan Mazur
79a82015aa remove dependency on MononokeApp
Summary: It's not ideal that we pull mononoke_app and even instantiate MononokeApp here. This is an attempt to decouple Mononoke from Metagit.

Reviewed By: mitrandir77

Differential Revision: D45862434

fbshipit-source-id: 6eab3577743810461f22535d89cf9a00dc1cbb65
2023-05-26 04:22:23 -07:00
Youssef Ibrahim
4634db2c84 commit_graph: asyncify closures in _with methods
Summary: Most of the useful ways to use these methods requires providing an async closure so let's asyncify them.

Reviewed By: RajivTS

Differential Revision: D45607981

fbshipit-source-id: ee7b471cc5d60a793a79928f6c15c48c0da1d08e
2023-05-26 02:12:44 -07:00
Zhaolong Zhu
37913dc1a8 fbscmquery: avoid scanning the repo when revision translation is failed
Summary: Currently, the code scans the repo when revision translation is failed, which is very slow.

Reviewed By: muirdm

Differential Revision: D46200075

fbshipit-source-id: 31eaca43582b480a0b3abd7af0b27ec8d6406195
2023-05-25 18:37:50 -07:00
Zhaolong Zhu
5af2319270 copytrace: abstract generate_candidates
Summary:
We get both `added` and `deleted` files in the function, this will be
needed for directory move detection.

Reviewed By: muirdm

Differential Revision: D46105884

fbshipit-source-id: d0081f8afaf27ef4ab105ab7c58b3f5cc694debc
2023-05-25 15:58:54 -07:00
Xavier Deguillard
fdbf7eadfb store: add telemetry for LocalStore operations
Summary:
We've seen a case where a large `hg update` was taking an absurdly long time in
`ObjectStore::getTree` but the telemetry was showing us that most of the time
wasn't spent fetching trees from Mercurial! The suspicion is that most of the
time was spent in the LocalStore but with no evidence to prove it.

Let's thus add some timing telemetry to various LocalStore read requests to
fill this gap.

Reviewed By: mshroyer

Differential Revision: D46154456

fbshipit-source-id: b439ac48889ed3db71db136ff6c1cc91f48c926a
2023-05-25 15:48:11 -07:00
Genevieve (Genna) Helsel
006d26a094 extend FsckTest to test SqliteOverlay
Summary:
Extends `FsckTest` to test `SqliteOverlay`. Two major changes were made to non-test files:
1) `loadInodeInfo` was moved from `OverlayChecker` into `InodeCatalog`
2) `getAllParentInodeNumbers` was added to facilitate `OverlayChecker::readInodes`

Reviewed By: chadaustin

Differential Revision: D45447172

fbshipit-source-id: 9ad291a0c4c34f1e44e1f05c1fdbf2ac7ea7d309
2023-05-25 13:50:56 -07:00
Youssef Ibrahim
84661b9dd0 commit_graph: add a sleep in update-preloaded command to prevent exiting before writing to all inner blobstores
Summary: In the case of a multiplexed blobstore, the put operation can exit after it succeeds in one inner blobstore before finishing in all, and leave the rest running in the background. This sleep tries to prevent exiting early before they all finish.

Reviewed By: mitrandir77

Differential Revision: D46190037

fbshipit-source-id: ac2ae0d1453ebdc923170b9da7ca98df7519bf52
2023-05-25 11:00:34 -07:00
Genevieve (Genna) Helsel
e95b17e5a6 move OverlayChecker into eden/fs/inodes/overlay
Summary: This will no longer be tied to the fscatalog, so it makes more sense to live in a more general location

Reviewed By: chadaustin

Differential Revision: D44980396

fbshipit-source-id: 3cabf00d87df7eb00671c2b82b04c8f12283e394
2023-05-25 10:10:08 -07:00
Youssef Ibrahim
8427780527 commit_graph: implement fetching children of a changeset
Summary: Implements a public method changeset_children in CommitGraph that fetches the changeset ids of the children of a given changeset.

Differential Revision: D46185434

fbshipit-source-id: f0b2e2ee53c7a34fe94ee5ef1f74f6e31429d056
2023-05-25 09:32:10 -07:00
Liubov Dmitrieva
8a3498edfa used cached version of API
Summary: used cached version of API

Reviewed By: YousefSalama

Differential Revision: D46184380

fbshipit-source-id: 5deb8c455ad682afcf1f0cad822d34fdd632b88b
2023-05-25 06:40:27 -07:00
Xavier Deguillard
e73ab91be0 store: add telemetry for where Tree were obtained from
Summary:
Telemetry exist for where Blob and BlobMetadata are coming from, but not for
Tree. Let's bring the Tree telemetry up to par.

Reviewed By: genevievehelsel

Differential Revision: D46154455

fbshipit-source-id: ab3c31d55b6a91009289b3b07853fa574bbaa137
2023-05-24 17:08:42 -07:00
Katie Mancini
5dac894df8 remove debugGetScmBlobMetadata
Summary:
I migrated the last caller of debugGetScmBlobMetadata to debugGetBlobMetadata
in the last diff. Let's delete the old method.

I am not really concerned about waiting for that lower diff to rollout and all
because this is a debugging command that we only sparingly ask users to run
(As far as I know like maybe 3 times).

Reviewed By: chadaustin

Differential Revision: D45972617

fbshipit-source-id: 6d4689a225fee972f8e3a802115852043f0bade8
2023-05-24 16:41:02 -07:00
Katie Mancini
5458cd7045 migrate last debugGetScmBlobMetadata call to debugGetBlobMetadata
Summary:
I created debugGetBlobMetadata a while ago and this is the last caller of
debugGetScmBlobMetadata. Let's migrate it to the new endpoint so we can delete
the old one.

Reviewed By: chadaustin

Differential Revision: D45972618

fbshipit-source-id: cbb0977260f9a1543d3bf0a31bf7b948c2f35143
2023-05-24 16:41:02 -07:00
Katie Mancini
b981977a84 remove debugGetScmBlob
Summary:
I created debugGetBlob a while ago and there are no more callers of
debugGetScmBlob from code search, so let's delete this.

Reviewed By: chadaustin

Differential Revision: D45972619

fbshipit-source-id: 97276ec2182fbe7d9022a06e9a0df34ae4e80235
2023-05-24 16:41:02 -07:00
Rajiv Sharma
ffa2587292 Use fb303 extension in Admin tool
Summary: The admin tool currently doesn't register the `fb303` extension with `MononokeApp` during its creation. This makes the tool incapable of registering for health check and responding to thrift health check requests by TW. In absence of ALIVE response from the job, TW ends up killing it. This diff adds the extension during `MononokeApp` construction. This will not impact admin tool's usage through CLI but the error messages in the integration tests will need to be updated.

Differential Revision: D46147128

fbshipit-source-id: f06b8bcdce938346726b9ff520a3d809d9fda6fc
2023-05-24 14:21:51 -07:00
Youssef Ibrahim
c344d94066 edenapi: gate streaming commit graph endpoint behind a tunable
Summary: Makes it easier to rollback

Reviewed By: mitrandir77

Differential Revision: D46156526

fbshipit-source-id: eae70801069d09ab03b3b683712d9353fb1e5a43
2023-05-24 14:14:19 -07:00
Genevieve (Genna) Helsel
23832acbf3 default to using buffered overlay
Reviewed By: chadaustin

Differential Revision: D45541124

fbshipit-source-id: bc6392cfd6ae8aa592a5e5546bd7d14df394a6dc
2023-05-24 13:11:13 -07:00
Xavier Deguillard
c88363c998 store: remove BlobMetadata computation/caching when getting blob
Summary:
EdenFS contains several layers of caching for BlobMetadata:
 - In the hgcache,
 - In the in-memory BlobMetadata cache,
 - In the LocalStore (configurable),
 - In the FileInode,
 - In the TreeEntry,

All of the above must be filled prior to reading a blob, therefore computing
the sha1+size when reading a blob is likely not needed and superfluous.

Alternatively, we could move the code to be done in the background in the
LocalStoreCachedBackingStore to avoid blocking reading the blob. Reviewers
opinions are welcome!

Reviewed By: chadaustin

Differential Revision: D45625432

fbshipit-source-id: ad7d897c32cbfd590dce5a3a9c8073349e9b70c8
2023-05-24 10:26:51 -07:00
Rajiv Sharma
eec4c1cdd4 Modify bookmark get admin command to handle annotated tags
Summary: The bookmark `get` command simply displays the changeset that is pointed to by the bookmark. This diff modifies the command to also handle git annotated tags converted into bookmarks. If the bookmark is a tag bookmark, then the command also outputs the metadata changeset associated with the bookmark. This will be useful for validating that imported annotated tags retain their metadata through metadata changesets.

Differential Revision: D46022692

fbshipit-source-id: b3980f4799066913268ef7acc1f4956d3feb5b23
2023-05-24 07:11:26 -07:00
Rajiv Sharma
3c830eaeb0 Add factory builder methods for BonsaiTagMapping
Summary: `BonsaiTagMapping` exists as a facet so let's add the appropriate builder methods in `RepoFactory` and `TestRepoFactory`. Follow-up diffs will add this new facet in the `Repo` facet container for `SCS` (for `remote-gitimport`) and in `gitimport`.

Differential Revision: D46020528

fbshipit-source-id: 88e65a498355bf21edc8c8d8aa3755a5507fe991
2023-05-24 07:11:26 -07:00
Rajiv Sharma
d3afd74c9a Utilize ContentMetadataV2 in metadata-diff endpoint
Summary:
The `metadata-diff` endpoint in SCS is used by Phabricator to get information about the difference between files of two commits. Currently, this endpoint works using raw file content. This diff makes the following optimizations:
- Avoids loading file content in memory if the file is `binary` or `non-utf8`
- Avoids parsing `generated` and `partially-generated` tags if the file is known to be neither
- Avoid parsing raw file bytes into UTF-8 string if the file is non-generated

These optimizations will be most helpful for the case of `binary` or `non-utf8` files but should improve performance of the endpoint in general.

Reviewed By: YousefSalama

Differential Revision: D46109336

fbshipit-source-id: b3c915005686f77defceeb53f1587049bc8b6bd8
2023-05-24 03:55:49 -07:00
Zhaolong Zhu
c6c3779843 remotefilelog: remove unnecessary file ancestor process
Summary: Remove unnecessary file ancestor process and their cache.

Reviewed By: muirdm

Differential Revision: D45898747

fbshipit-source-id: a540a937f98a63a93a71f5bb3e5befe0a56de1d8
2023-05-23 19:31:53 -07:00
Chad Austin
e858234e94 add OBJECT_ID attribute to getAttributesFromFilesV2
Summary:
For tools that want to take advantage of the same fast-path logic when
directories don't change across updates, expose a semistable ID they
can use to cache derived data or get a rough understand when a
directory has changed its contents.

Reviewed By: kmancini, xavierd

Differential Revision: D45974142

fbshipit-source-id: 7b2b482876b07e73514a936e198de2dc31ed1597
2023-05-23 19:12:06 -07:00
Chad Austin
3495e3731c split readdir integration tests into a separate file
Summary:
thrift_test is pretty general. For something like getFileAttributes,
getFileAttributesV2, and readdir, it's nice to have them in one file.

Reviewed By: kmancini

Differential Revision: D45974095

fbshipit-source-id: ca5ecd4795f1d278f4de5b83cb8c9af94c111902
2023-05-23 19:12:06 -07:00
Genevieve (Genna) Helsel
1148997dcb migrate edenfsctl fsck to C++
Reviewed By: chadaustin

Differential Revision: D44473843

fbshipit-source-id: 01c46e1cd50b73e6c0d13d00fd42a7da81abc01c
2023-05-23 13:33:07 -07:00
Youssef Ibrahim
97ab9db5df commit_graph: replace usages of LeastCommonAncestorsHint::is_ancestor and ReachabilityIndex::query_reachability (conditional on a tunable) (except in ChangesetPathContext)
Summary: :O

Reviewed By: mitrandir77

Differential Revision: D45607344

fbshipit-source-id: 2a0438cd7cff0e782eab4843f0436b5400d773aa
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
77cb2d63e4 replace slice_repository with CommitGraph::slice_ancestors and delete commit_traversal directory
Summary: saintelmosfire

Reviewed By: mitrandir77

Differential Revision: D45607345

fbshipit-source-id: 638eb537b8f475fc9e6ae85dfbeabf8290105d1e
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
608dc8dd0e commit_graph: implement slice_ancestors
Summary: Implement an alternative to slice_repository using the new commit graph that doesn't depend on the skiplist. Useful when doing any kind of processing that requires ancestors to be processed first (backfilling derived data, mirroring commits, ...)

Reviewed By: mitrandir77

Differential Revision: D45607347

fbshipit-source-id: b2012972472e718522e4f33ff01fc9b253b76fff
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
f4e7296e5e commit_graph_types: move ChangesetFrontier to a separate module
Summary: Makes slightly more sense

Reviewed By: mitrandir77

Differential Revision: D45607346

fbshipit-source-id: 6b505796da96ff24cd7d555290dcf341f93c797f
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
6205656019 commit_graph: split CommitGraph impl
Summary: My fingers are tired from scrolling

Reviewed By: mitrandir77

Differential Revision: D45607349

fbshipit-source-id: fe366797a37fbd1682ca917d6bdd39c88195c8e9
2023-05-23 11:26:11 -07:00
Youssef Ibrahim
938110f792 mononoke_api: use new commit graph common_base conditional on a tunable
Summary: :O

Reviewed By: mitrandir77

Differential Revision: D45607348

fbshipit-source-id: 8a0bbec488961007912d1ef865439a023c388437
2023-05-23 11:26:11 -07:00