mononoke: add step to UnodeFile parents

Summary: Step into history via UnodeFile parents to check they are valid

Reviewed By: markbt

Differential Revision: D24838456

fbshipit-source-id: 3b19973f9f7da6e502595b4ffa33a031e1df03ab
This commit is contained in:
Alex Hornby 2020-11-13 05:21:34 -08:00 committed by Facebook GitHub Bot
parent 48a94f1795
commit e417b1e361
4 changed files with 9 additions and 2 deletions

View File

@ -113,7 +113,7 @@ count-objects, shallow walk across bonsai and unodes
count-objects, deep walk across bonsai and unodes
$ mononoke_walker --storage-id=blobstore --readonly-storage scrub -q --bookmark master_bookmark -I deep -i bonsai -i derived_unodes -X BonsaiChangesetToBonsaiParent 2>&1 | strip_glog
Walking roots * (glob)
Walking edge types [BonsaiChangesetToBonsaiUnodeMapping, BonsaiUnodeMappingToRootUnodeManifest, BookmarkToBonsaiChangeset, UnodeFileToLinkedBonsaiChangeset, UnodeManifestToLinkedBonsaiChangeset, UnodeManifestToUnodeFileChild, UnodeManifestToUnodeManifestChild, UnodeManifestToUnodeManifestParent]
Walking edge types [BonsaiChangesetToBonsaiUnodeMapping, BonsaiUnodeMappingToRootUnodeManifest, BookmarkToBonsaiChangeset, UnodeFileToLinkedBonsaiChangeset, UnodeFileToUnodeFileParent, UnodeManifestToLinkedBonsaiChangeset, UnodeManifestToUnodeFileChild, UnodeManifestToUnodeManifestChild, UnodeManifestToUnodeManifestParent]
Walking node types [BonsaiChangeset, BonsaiUnodeMapping, Bookmark, UnodeFile, UnodeManifest]
Final count: (13, 13)
Bytes/s,* (glob)

View File

@ -290,7 +290,7 @@ create_graph!(
(
UnodeFile,
PathKey<FileUnodeId>,
[FileContent, LinkedBonsaiChangeset(BonsaiChangeset)]
[FileContent, LinkedBonsaiChangeset(BonsaiChangeset), UnodeFileParent(UnodeFile)]
),
(
UnodeManifest,

View File

@ -175,6 +175,7 @@ const DEEP_INCLUDE_EDGE_TYPES: &[EdgeType] = &[
EdgeType::FsnodeToFileContent,
EdgeType::UnodeFileToFileContent,
EdgeType::UnodeFileToLinkedBonsaiChangeset,
EdgeType::UnodeFileToUnodeFileParent,
EdgeType::UnodeManifestToLinkedBonsaiChangeset,
EdgeType::UnodeManifestToUnodeManifestParent,
EdgeType::UnodeManifestToUnodeFileChild,

View File

@ -903,6 +903,12 @@ async fn unode_file_step<V: VisitOne>(
Node::BonsaiChangeset(*unode_file.linknode())
});
for p in unode_file.parents() {
checker.add_edge(&mut edges, EdgeType::UnodeFileToUnodeFileParent, || {
Node::UnodeFile(PathKey::new(*p, path.clone()))
});
}
checker.add_edge_with_path(
&mut edges,
EdgeType::UnodeFileToFileContent,