##// END OF EJS Templates
perf: add command for measuring revlog chunk operations...
perf: add command for measuring revlog chunk operations Upcoming commits will teach revlogs to leverage the new compression engine API so that new compression formats can more easily be leveraged in revlogs. We want to be sure this refactoring doesn't regress performance. So this commit introduces "perfrevchunks" to explicitly test performance of reading, decompressing, and recompressing revlog chunks. Here is output when run on the mozilla-unified repo: $ hg perfrevlogchunks -c ! read ! wall 0.346603 comb 0.350000 user 0.340000 sys 0.010000 (best of 28) ! read w/ reused fd ! wall 0.337707 comb 0.340000 user 0.320000 sys 0.020000 (best of 30) ! read batch ! wall 0.013206 comb 0.020000 user 0.000000 sys 0.020000 (best of 221) ! read batch w/ reused fd ! wall 0.013259 comb 0.030000 user 0.010000 sys 0.020000 (best of 222) ! chunk ! wall 1.909939 comb 1.910000 user 1.900000 sys 0.010000 (best of 6) ! chunk batch ! wall 1.750677 comb 1.760000 user 1.740000 sys 0.020000 (best of 6) ! compress ! wall 5.668004 comb 5.670000 user 5.670000 sys 0.000000 (best of 3) $ hg perfrevlogchunks -m ! read ! wall 0.365834 comb 0.370000 user 0.350000 sys 0.020000 (best of 26) ! read w/ reused fd ! wall 0.350160 comb 0.350000 user 0.320000 sys 0.030000 (best of 28) ! read batch ! wall 0.024777 comb 0.020000 user 0.000000 sys 0.020000 (best of 119) ! read batch w/ reused fd ! wall 0.024895 comb 0.030000 user 0.000000 sys 0.030000 (best of 118) ! chunk ! wall 2.514061 comb 2.520000 user 2.480000 sys 0.040000 (best of 4) ! chunk batch ! wall 2.380788 comb 2.380000 user 2.360000 sys 0.020000 (best of 5) ! compress ! wall 9.815297 comb 9.820000 user 9.820000 sys 0.000000 (best of 3) We already see some interesting data, such as how much slower non-batched chunk reading is and that zlib compression appears to be >2x slower than decompression. I didn't have the data when I wrote this commit message, but I ran this on Mozilla's NFS-based Mercurial server and the time for reading with a reused file descriptor was faster. So I think it is worth testing both with and without file descriptor reuse so we can make informed decisions about recycling file descriptors.

File last commit:

r28214:408446e4 default
r30451:94ca0e13 default
Show More
test-verify.t
319 lines | 8.6 KiB | text/troff | Tads3Lexer
Nicolas Dumazet
tests: unify test-verify
r11787 prepare repo
$ hg init a
$ cd a
$ echo "some text" > FOO.txt
$ echo "another text" > bar.txt
$ echo "more text" > QUICK.txt
$ hg add
adding FOO.txt
adding QUICK.txt
adding bar.txt
$ hg ci -mtest1
verify
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
3 files, 1 changesets, 3 total revisions
verify with journal
$ touch .hg/store/journal
$ hg verify
abandoned transaction found - run hg recover
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
3 files, 1 changesets, 3 total revisions
$ rm .hg/store/journal
introduce some bugs in repo
$ cd .hg/store/data
$ mv _f_o_o.txt.i X_f_o_o.txt.i
$ mv bar.txt.i xbar.txt.i
$ rm _q_u_i_c_k.txt.i
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
Matt Mackall
verify: clarify misleading fncache message...
r25627 warning: revlog 'data/FOO.txt.i' not in fncache!
Nicolas Dumazet
tests: unify test-verify
r11787 0: empty or missing FOO.txt
Martin von Zweigbergk
verify: use similar language for missing manifest and file revisions...
r28114 FOO.txt@0: manifest refers to unknown revision f62022d3d590
Matt Mackall
verify: clarify misleading fncache message...
r25627 warning: revlog 'data/QUICK.txt.i' not in fncache!
Nicolas Dumazet
tests: unify test-verify
r11787 0: empty or missing QUICK.txt
Martin von Zweigbergk
verify: use similar language for missing manifest and file revisions...
r28114 QUICK.txt@0: manifest refers to unknown revision 88b857db8eba
Matt Mackall
verify: clarify misleading fncache message...
r25627 warning: revlog 'data/bar.txt.i' not in fncache!
Nicolas Dumazet
tests: unify test-verify
r11787 0: empty or missing bar.txt
Martin von Zweigbergk
verify: use similar language for missing manifest and file revisions...
r28114 bar.txt@0: manifest refers to unknown revision 256559129457
Nicolas Dumazet
tests: unify test-verify
r11787 3 files, 1 changesets, 0 total revisions
Matt Mackall
verify: clarify misleading fncache message...
r25627 3 warnings encountered!
Gregory Szorc
verify: print hint to run debugrebuildfncache...
r25653 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
Matt Mackall
verify: clarify misleading fncache message...
r25627 6 integrity errors encountered!
Nicolas Dumazet
tests: unify test-verify
r11787 (first damaged changeset appears to be 0)
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Nicolas Dumazet
tests: unify test-verify
r11787
Mads Kiilerich
tests: cleanup of tests that got lost in their own nested directories...
r16912 $ cd ../../..
Nicolas Dumazet
tests: unify test-verify
r11787 $ cd ..
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 Set up a repo for testing missing revlog entries
$ hg init missing-entries
$ cd missing-entries
$ echo 0 > file
$ hg ci -Aqm0
$ cp -r .hg/store .hg/store-partial
$ echo 1 > file
$ hg ci -Aqm1
$ cp -r .hg/store .hg/store-full
Entire changelog missing
$ rm .hg/store/00changelog.*
$ hg verify -q
0: empty or missing changelog
manifest@0: d0b6632564d4 not in changesets
manifest@1: 941fc4534185 not in changesets
3 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Entire manifest log missing
$ rm .hg/store/00manifest.*
$ hg verify -q
0: empty or missing manifest
1 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Entire filelog missing
$ rm .hg/store/data/file.*
$ hg verify -q
warning: revlog 'data/file.i' not in fncache!
0: empty or missing file
Martin von Zweigbergk
verify: use similar language for missing manifest and file revisions...
r28114 file@0: manifest refers to unknown revision 362fef284ce2
file@1: manifest refers to unknown revision c10f2164107d
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 1 warnings encountered!
hint: run "hg debugrebuildfncache" to recover from corrupt fncache
3 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Entire changelog and manifest log missing
$ rm .hg/store/00changelog.*
$ rm .hg/store/00manifest.*
$ hg verify -q
warning: orphan revlog 'data/file.i'
1 warnings encountered!
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Entire changelog and filelog missing
$ rm .hg/store/00changelog.*
$ rm .hg/store/data/file.*
$ hg verify -q
0: empty or missing changelog
manifest@0: d0b6632564d4 not in changesets
manifest@1: 941fc4534185 not in changesets
warning: revlog 'data/file.i' not in fncache!
?: empty or missing file
Martin von Zweigbergk
verify: use similar language for missing manifest and file revisions...
r28114 file@0: manifest refers to unknown revision 362fef284ce2
file@1: manifest refers to unknown revision c10f2164107d
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 1 warnings encountered!
hint: run "hg debugrebuildfncache" to recover from corrupt fncache
6 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Entire manifest log and filelog missing
$ rm .hg/store/00manifest.*
$ rm .hg/store/data/file.*
$ hg verify -q
0: empty or missing manifest
warning: revlog 'data/file.i' not in fncache!
0: empty or missing file
1 warnings encountered!
hint: run "hg debugrebuildfncache" to recover from corrupt fncache
2 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Changelog missing entry
$ cp -f .hg/store-partial/00changelog.* .hg/store
$ hg verify -q
manifest@?: rev 1 points to nonexistent changeset 1
manifest@?: 941fc4534185 not in changesets
file@?: rev 1 points to nonexistent changeset 1
(expected 0)
1 warnings encountered!
3 integrity errors encountered!
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Manifest log missing entry
$ cp -f .hg/store-partial/00manifest.* .hg/store
$ hg verify -q
Martin von Zweigbergk
verify: include "manifest" prefix in a few more places...
r28113 manifest@1: changeset refers to unknown revision 941fc4534185
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 file@1: c10f2164107d not in manifests
2 integrity errors encountered!
(first damaged changeset appears to be 1)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Filelog missing entry
$ cp -f .hg/store-partial/data/file.* .hg/store/data
$ hg verify -q
Martin von Zweigbergk
verify: use similar language for missing manifest and file revisions...
r28114 file@1: manifest refers to unknown revision c10f2164107d
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 1 integrity errors encountered!
(first damaged changeset appears to be 1)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Changelog and manifest log missing entry
$ cp -f .hg/store-partial/00changelog.* .hg/store
$ cp -f .hg/store-partial/00manifest.* .hg/store
$ hg verify -q
file@?: rev 1 points to nonexistent changeset 1
(expected 0)
file@?: c10f2164107d not in manifests
1 warnings encountered!
2 integrity errors encountered!
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Changelog and filelog missing entry
$ cp -f .hg/store-partial/00changelog.* .hg/store
$ cp -f .hg/store-partial/data/file.* .hg/store/data
$ hg verify -q
manifest@?: rev 1 points to nonexistent changeset 1
manifest@?: 941fc4534185 not in changesets
Martin von Zweigbergk
verify: use similar language for missing manifest and file revisions...
r28114 file@?: manifest refers to unknown revision c10f2164107d
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 3 integrity errors encountered!
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Manifest and filelog missing entry
$ cp -f .hg/store-partial/00manifest.* .hg/store
$ cp -f .hg/store-partial/data/file.* .hg/store/data
$ hg verify -q
Martin von Zweigbergk
verify: include "manifest" prefix in a few more places...
r28113 manifest@1: changeset refers to unknown revision 941fc4534185
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 1 integrity errors encountered!
(first damaged changeset appears to be 1)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Corrupt changelog base node to cause failure to read revision
$ printf abcd | dd conv=notrunc of=.hg/store/00changelog.i bs=1 seek=16 \
> 2> /dev/null
$ hg verify -q
0: unpacking changeset 08b1860757c2: * (glob)
manifest@?: rev 0 points to unexpected changeset 0
manifest@?: d0b6632564d4 not in changesets
file@?: rev 0 points to unexpected changeset 0
(expected 1)
1 warnings encountered!
4 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Corrupt manifest log base node to cause failure to read revision
$ printf abcd | dd conv=notrunc of=.hg/store/00manifest.i bs=1 seek=16 \
> 2> /dev/null
$ hg verify -q
Martin von Zweigbergk
verify: include "manifest" prefix in a few more places...
r28113 manifest@0: reading delta d0b6632564d4: * (glob)
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110 file@0: 362fef284ce2 not in manifests
2 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
Corrupt filelog base node to cause failure to read revision
$ printf abcd | dd conv=notrunc of=.hg/store/data/file.i bs=1 seek=16 \
> 2> /dev/null
$ hg verify -q
file@0: unpacking 362fef284ce2: * (glob)
1 integrity errors encountered!
(first damaged changeset appears to be 0)
[1]
Tony Tung
treemanifest: use "cp xyz/." instead of "cp xyz/*"...
r28214 $ cp -r .hg/store-full/. .hg/store
Martin von Zweigbergk
tests: add tests for missing revlogs and revlog entries...
r28110
$ cd ..
Patrick Mezard
verify: do not choke on valid changelog without manifest...
r17385 test changelog without a manifest
Nicolas Dumazet
tests: unify test-verify
r11787
$ hg init b
$ cd b
Patrick Mezard
verify: do not choke on valid changelog without manifest...
r17385 $ hg branch foo
marked working directory as branch foo
(branches are permanent and global, did you want a bookmark?)
$ hg ci -m branchfoo
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
0 files, 1 changesets, 0 total revisions
test revlog corruption
Nicolas Dumazet
tests: unify test-verify
r11787
$ touch a
$ hg add a
$ hg ci -m a
$ echo 'corrupted' > b
$ dd if=.hg/store/data/a.i of=start bs=1 count=20 2>/dev/null
$ cat start b > .hg/store/data/a.i
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
Patrick Mezard
verify: do not choke on valid changelog without manifest...
r17385 a@1: broken revlog! (index data/a.i is corrupted)
Nicolas Dumazet
tests: unify test-verify
r11787 warning: orphan revlog 'data/a.i'
Patrick Mezard
verify: do not choke on valid changelog without manifest...
r17385 1 files, 2 changesets, 0 total revisions
Nicolas Dumazet
tests: unify test-verify
r11787 1 warnings encountered!
1 integrity errors encountered!
Patrick Mezard
verify: do not choke on valid changelog without manifest...
r17385 (first damaged changeset appears to be 1)
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Nicolas Dumazet
tests: unify test-verify
r11787
Thomas Arendsen Hein
merge with stable
r12172 $ cd ..
test revlog format 0
Matt Mackall
tests: drop explicit $TESTDIR from executables...
r25472 $ revlog-formatv0.py
Thomas Arendsen Hein
merge with stable
r12172 $ cd formatv0
$ hg verify
repository uses revlog format 0
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
1 files, 1 changesets, 1 total revisions
Mads Kiilerich
tests: cleanup of tests that got lost in their own nested directories...
r16912 $ cd ..