2020-01-20 18:33:28 +03:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
|
#
|
|
|
|
# This software may be used and distributed according to the terms of the
|
|
|
|
# GNU General Public License found in the LICENSE file in the root
|
|
|
|
# directory of this source tree.
|
|
|
|
|
2019-12-19 12:33:28 +03:00
|
|
|
$ . "${TEST_FIXTURES}/library.sh"
|
|
|
|
|
|
|
|
setup configuration
|
2020-01-16 17:11:09 +03:00
|
|
|
$ default_setup_blobimport "blob_files"
|
|
|
|
hg repo
|
|
|
|
o C [draft;rev=2;26805aba1e60]
|
|
|
|
|
|
|
|
|
o B [draft;rev=1;112478962961]
|
|
|
|
|
|
|
|
|
o A [draft;rev=0;426bada5c675]
|
|
|
|
$
|
|
|
|
blobimporting
|
2019-12-19 12:33:28 +03:00
|
|
|
|
|
|
|
validate, expecting all valid
|
2019-12-19 15:27:42 +03:00
|
|
|
$ mononoke_walker --storage-id=blobstore --readonly-storage --cachelib-only-blobstore validate -I deep -q --bookmark master_bookmark 2>&1 | strip_glog
|
2019-12-19 12:33:28 +03:00
|
|
|
Walking roots * (glob)
|
|
|
|
Walking edge types * (glob)
|
|
|
|
Walking node types * (glob)
|
|
|
|
Performing check types [HgLinkNodePopulated]
|
|
|
|
Final count: * (glob)
|
|
|
|
Walked* (glob)
|
2020-04-23 11:22:28 +03:00
|
|
|
Nodes,Pass,Fail:40,3,0; EdgesChecked:9; CheckType:Pass,Fail Total:3,0 HgLinkNodePopulated:3,0
|
2019-12-19 12:33:28 +03:00
|
|
|
|
2020-07-28 15:19:37 +03:00
|
|
|
|
|
|
|
validate, check route is logged on unexpected error (forced with chaos blob)
|
|
|
|
$ mononoke_walker --storage-id=blobstore --blobstore-read-chaos-rate=1 --readonly-storage --cachelib-only-blobstore validate -I deep -q --bookmark master_bookmark --scuba-log-file scuba-error.json 2>&1 | strip_glog
|
|
|
|
Walking roots * (glob)
|
|
|
|
Walking edge types * (glob)
|
|
|
|
Walking node types * (glob)
|
|
|
|
Performing check types [HgLinkNodePopulated]
|
|
|
|
Execution error: * (glob)
|
|
|
|
* (glob)
|
|
|
|
Caused by:
|
|
|
|
0: Blobstore error
|
|
|
|
1: Injected failure in get to ChaosBlobstore for key repo0000.changeset.blake2.c3384961b16276f2db77df9d7c874bbe981cf0525bd6f84a502f919044f2dabd
|
|
|
|
Error: Execution failed
|
|
|
|
|
|
|
|
Check scuba data is logged for error on step and that it contains message and route info
|
|
|
|
$ wc -l < scuba-error.json
|
|
|
|
1
|
|
|
|
$ jq -r '.int * .normal | [ .check_fail, .check_type, .node_key, .node_type, .repo, .src_node_type, .via_node_type, .walk_type, .error_msg ] | @csv' < scuba-error.json
|
|
|
|
1,"step","changeset.blake2.c3384961b16276f2db77df9d7c874bbe981cf0525bd6f84a502f919044f2dabd","BonsaiChangeset","repo","Bookmark",,"validate","Could not step to OutgoingEdge { label: BookmarkToBonsaiChangeset, target: BonsaiChangeset(ChangesetId(Blake2(c3384961b16276f2db77df9d7c874bbe981cf0525bd6f84a502f919044f2dabd))), path: None }, due to Blobstore error
|
|
|
|
* (glob)
|
|
|
|
Caused by:
|
|
|
|
Injected failure in get to ChaosBlobstore for key repo0000.changeset.blake2.c3384961b16276f2db77df9d7c874bbe981cf0525bd6f84a502f919044f2dabd, via Some(ValidateRoute { src_node: Bookmark(BookmarkName { bookmark: ""master_bookmark"" }), via: [] })"
|
|
|
|
|
2019-12-19 12:33:28 +03:00
|
|
|
Remove all filenodes
|
2020-02-27 02:18:28 +03:00
|
|
|
$ sqlite3 "$TESTTMP/monsql/sqlite_dbs" "DELETE FROM filenodes where linknode=x'112478962961147124EDD43549AEDD1A335E44BF'";
|
2019-12-19 12:33:28 +03:00
|
|
|
|
|
|
|
validate, expecting validation fails
|
2020-01-17 14:42:54 +03:00
|
|
|
$ mononoke_walker --storage-id=blobstore --readonly-storage --cachelib-only-blobstore validate -I deep -q --bookmark master_bookmark --scuba-log-file scuba.json 2>&1 | strip_glog
|
2019-12-19 12:33:28 +03:00
|
|
|
Walking roots * (glob)
|
|
|
|
Walking edge types * (glob)
|
|
|
|
Walking node types * (glob)
|
|
|
|
Performing check types [HgLinkNodePopulated]
|
2019-12-19 15:27:42 +03:00
|
|
|
Validation failed: *hg_link_node_populated* (glob)
|
2019-12-19 12:33:28 +03:00
|
|
|
Final count: * (glob)
|
|
|
|
Walked* (glob)
|
2020-04-23 11:22:28 +03:00
|
|
|
Nodes,Pass,Fail:39,2,1; EdgesChecked:7; CheckType:Pass,Fail Total:2,1 HgLinkNodePopulated:2,1
|
2019-12-19 15:27:42 +03:00
|
|
|
|
2020-01-17 14:42:54 +03:00
|
|
|
Check scuba data
|
|
|
|
$ wc -l < scuba.json
|
2020-02-27 02:18:28 +03:00
|
|
|
1
|
2020-07-20 14:56:57 +03:00
|
|
|
$ jq -r '.int * .normal | [ .check_fail, .check_type, .node_key, .node_path, .node_type, .repo, .src_node_key, .src_node_path, .src_node_type, .via_node_key, .via_node_path, .via_node_type, .walk_type ] | @csv' < scuba.json | sort
|
2020-07-22 21:04:30 +03:00
|
|
|
1,"hg_link_node_populated","hgfilenode.sha1.35e7525ce3a48913275d7061dd9a867ffef1e34d","B","HgFileNode","repo","hgmanifest.sha1.*","(none)","HgManifest","hgchangeset.sha1.*",,"HgChangeset","validate" (glob)
|
2020-01-17 14:42:54 +03:00
|
|
|
|
2019-12-19 15:27:42 +03:00
|
|
|
repair by blobimport.
|
|
|
|
$ blobimport repo-hg/.hg repo
|
|
|
|
|
|
|
|
validate, expecting all valid, this time checking marker types as well
|
|
|
|
$ mononoke_walker --storage-id=blobstore --readonly-storage --cachelib-only-blobstore validate -I deep -I marker -q --bookmark master_bookmark 2>&1 | strip_glog
|
|
|
|
Walking roots * (glob)
|
|
|
|
Walking edge types * (glob)
|
|
|
|
Walking node types * (glob)
|
|
|
|
Performing check types [BonsaiChangesetPhaseIsPublic, HgLinkNodePopulated]
|
|
|
|
Final count: * (glob)
|
|
|
|
Walked* (glob)
|
2020-04-23 11:22:28 +03:00
|
|
|
Nodes,Pass,Fail:43,6,0; EdgesChecked:12; CheckType:Pass,Fail Total:6,0 BonsaiChangesetPhaseIsPublic:3,0 HgLinkNodePopulated:3,0
|
2019-12-19 15:27:42 +03:00
|
|
|
|
2019-12-19 15:27:42 +03:00
|
|
|
Remove the phase information, linknodes already point to them
|
2019-12-19 15:27:42 +03:00
|
|
|
$ sqlite3 "$TESTTMP/monsql/sqlite_dbs" "DELETE FROM phases where repo_id >= 0";
|
|
|
|
|
2019-12-19 15:27:42 +03:00
|
|
|
validate, expect no failures on phase info, as the commits are still public, just not marked as so in the phases table
|
2019-12-19 15:27:42 +03:00
|
|
|
$ mononoke_walker --storage-id=blobstore --readonly-storage --cachelib-only-blobstore validate -I deep -I marker -q --bookmark master_bookmark 2>&1 | strip_glog
|
|
|
|
Walking roots * (glob)
|
|
|
|
Walking edge types * (glob)
|
|
|
|
Walking node types * (glob)
|
|
|
|
Performing check types [BonsaiChangesetPhaseIsPublic, HgLinkNodePopulated]
|
|
|
|
Final count: * (glob)
|
|
|
|
Walked* (glob)
|
2020-04-23 11:22:28 +03:00
|
|
|
Nodes,Pass,Fail:43,6,0; EdgesChecked:12; CheckType:Pass,Fail Total:6,0 BonsaiChangesetPhaseIsPublic:3,0 HgLinkNodePopulated:3,0
|
2020-02-27 02:18:28 +03:00
|
|
|
|
|
|
|
Remove all filenodes for the last commit, validation should succeed (i.e. filenodes were not derived yet)
|
|
|
|
$ cd "$TESTTMP"
|
|
|
|
$ sqlite3 "$TESTTMP/monsql/sqlite_dbs" "DELETE FROM filenodes where HEX(linknode) like '26805aba1e600a82e93661149f2313866a221a7b'";
|
|
|
|
$ mononoke_walker --storage-id=blobstore --readonly-storage --cachelib-only-blobstore validate -I deep -q --bookmark master_bookmark 2>&1 | strip_glog
|
|
|
|
Walking roots * (glob)
|
|
|
|
Walking edge types * (glob)
|
|
|
|
Walking node types * (glob)
|
|
|
|
Performing check types [HgLinkNodePopulated]
|
|
|
|
Final count: * (glob)
|
|
|
|
Walked* (glob)
|
2020-04-23 11:22:28 +03:00
|
|
|
Nodes,Pass,Fail:35,2,0; EdgesChecked:6; CheckType:Pass,Fail Total:2,0 HgLinkNodePopulated:2,0
|