forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit174877f
committed
Harden TAP tests that intentionally corrupt page checksums.
The previous method for doing that was to write zeroes into apredetermined set of page locations. However, there's a roughly1-in-64K chance that the existing checksum will match by chance,and yesterday several buildfarm animals started to reproduciblysee that, resulting in test failures because no checksum mismatchwas reported.Since the checksum includes the page LSN, test success depends onthe length of the installation's WAL history, which is affected by(at least) the initial catalog contents, the set of locales installedon the system, and the length of the pathname of the test directory.Sooner or later we were going to hit a chance match, and today isthat day.Harden these tests by specifically inverting the checksum field andleaving all else alone, thereby guaranteeing that the checksum isincorrect.In passing, fix places that were using seek() to set up for syswrite(),a combination that the Perl docs very explicitly warn against. We'veprobably escaped problems because no regular buffered I/O is done onthese filehandles; but if it ever breaks, we wouldn't deserve or getmuch sympathy.Although we've only seen problems in HEAD, now that we recognize theenvironmental dependencies it seems like it might be just a matterof time until someone manages to hit this in back-branch testing.Hence, back-patch to v11 where we started doing this kind of test.Discussion:https://postgr.es/m/3192026.1648185780@sss.pgh.pa.us1 parent002c9dd commit174877f
File tree
6 files changed
+52
-42
lines changed- contrib/amcheck/t
- src
- bin
- pg_amcheck/t
- pg_basebackup/t
- pg_checksums/t
- test/perl/PostgreSQL/Test
6 files changed
+52
-42
lines changedLines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 | 10 |
| |
12 | 11 |
| |
13 | 12 |
| |
| |||
193 | 192 |
| |
194 | 193 |
| |
195 | 194 |
| |
196 |
| - | |
197 |
| - | |
| 195 | + | |
| 196 | + | |
198 | 197 |
| |
199 | 198 |
| |
200 | 199 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 | 10 |
| |
12 | 11 |
| |
13 | 12 |
| |
| |||
90 | 89 |
| |
91 | 90 |
| |
92 | 91 |
| |
93 |
| - | |
94 |
| - | |
| 92 | + | |
| 93 | + | |
95 | 94 |
| |
96 | 95 |
| |
97 | 96 |
| |
|
Lines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
11 | 10 |
| |
12 | 11 |
| |
13 | 12 |
| |
| |||
99 | 98 |
| |
100 | 99 |
| |
101 | 100 |
| |
102 |
| - | |
103 |
| - | |
| 101 | + | |
| 102 | + | |
104 | 103 |
| |
105 | 104 |
| |
106 | 105 |
| |
| |||
165 | 164 |
| |
166 | 165 |
| |
167 | 166 |
| |
168 |
| - | |
169 |
| - | |
| 167 | + | |
| 168 | + | |
170 | 169 |
| |
171 | 170 |
| |
172 | 171 |
| |
|
Lines changed: 11 additions & 23 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
9 | 8 |
| |
10 | 9 |
| |
11 | 10 |
| |
| |||
56 | 55 |
| |
57 | 56 |
| |
58 | 57 |
| |
59 |
| - | |
| 58 | + | |
60 | 59 |
| |
61 | 60 |
| |
62 | 61 |
| |
| |||
706 | 705 |
| |
707 | 706 |
| |
708 | 707 |
| |
709 |
| - | |
710 |
| - | |
| 708 | + | |
711 | 709 |
| |
712 | 710 |
| |
713 | 711 |
| |
714 |
| - | |
715 |
| - | |
716 |
| - | |
717 |
| - | |
718 |
| - | |
719 |
| - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
720 | 715 |
| |
721 | 716 |
| |
722 | 717 |
| |
| |||
727 | 722 |
| |
728 | 723 |
| |
729 | 724 |
| |
730 |
| - | |
731 |
| - | |
| 725 | + | |
732 | 726 |
| |
733 | 727 |
| |
734 |
| - | |
735 |
| - | |
736 |
| - | |
| 728 | + | |
737 | 729 |
| |
738 |
| - | |
739 |
| - | |
| 730 | + | |
740 | 731 |
| |
741 | 732 |
| |
742 | 733 |
| |
| |||
747 | 738 |
| |
748 | 739 |
| |
749 | 740 |
| |
750 |
| - | |
751 |
| - | |
752 |
| - | |
753 |
| - | |
754 |
| - | |
755 |
| - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
756 | 744 |
| |
757 | 745 |
| |
758 | 746 |
| |
|
Lines changed: 2 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
13 | 12 |
| |
14 | 13 |
| |
15 | 14 |
| |
| |||
24 | 23 |
| |
25 | 24 |
| |
26 | 25 |
| |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 | 40 |
| |
44 | 41 |
| |
45 | 42 |
| |
| |||
54 | 51 |
| |
55 | 52 |
| |
56 | 53 |
| |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
| 54 | + | |
61 | 55 |
| |
62 | 56 |
| |
63 | 57 |
| |
|
Lines changed: 31 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2856 | 2856 |
| |
2857 | 2857 |
| |
2858 | 2858 |
| |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
2859 | 2890 |
| |
2860 | 2891 |
| |
2861 | 2892 |
| |
|
0 commit comments
Comments
(0)