- Notifications
You must be signed in to change notification settings - Fork5k
Commitdee8002
committed
Fix mis-attribution of checksum failure stats to the wrong database
Checksum failure stats could be attributed to the wrong database in two cases:- when a read of a shared relation encountered a checksum error , it would be attributed to the current database, instead of the "database" representing shared relations- when using CREATE DATABASE ... STRATEGY WAL_LOG checksum errors in the source database would be attributed to the current databaseThe checksum stats reporting via PageIsVerifiedExtended(PIV_REPORT_STAT) doesnot have access to the information about what database a page belongs to.This fixes the issue by removing PIV_REPORT_STAT and delegating theresponsibility to report stats to the caller, which now can learn about thenumber of stats via a new optional argument.As this changes the signature of PageIsVerifiedExtended() and all callersshould adapt to the new signature, use the occasion to rename the function toPageIsVerified() and remove the compatibility macro.We could instead have fixed this by adding information about the database tothe args of PageIsVerified(), but there are soon-to-be-applied patches thatneed to separate the stats reporting from the PageIsVerified() callanyway. Those patches also include testing for the failure paths, something weinexplicably have not had.As there is no caller of pgstat_report_checksum_failure() left, remove it.It'd be possible, but awkward to fix this in the back branches. We considereddoing the work not quite worth it, as mis-attributed stats should still elicitconcern. The emitted error messages do allow to attribute the errorscorrectly.Discussion:https://postgr.es/m/5tyic6epvdlmd6eddgelv47syg2b5cpwffjam54axp25xyq2ga@ptwkinxqo3azDiscussion:https://postgr.es/m/mglpvvbhighzuwudjxzu4br65qqcxsnyvio3nl4fbog3qknwhg@e4gt7npsohuz1 parent68f97ae commitdee8002
6 files changed
+48
-34
lines changedLines changed: 14 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
| |||
507 | 508 |
| |
508 | 509 |
| |
509 | 510 |
| |
| 511 | + | |
| 512 | + | |
510 | 513 |
| |
511 | 514 |
| |
512 | 515 |
| |
513 | 516 |
| |
514 | 517 |
| |
515 | 518 |
| |
516 | 519 |
| |
517 |
| - | |
518 |
| - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
519 | 531 |
| |
520 | 532 |
| |
521 | 533 |
| |
|
Lines changed: 13 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
770 | 770 |
| |
771 | 771 |
| |
772 | 772 |
| |
773 |
| - | |
| 773 | + | |
774 | 774 |
| |
775 | 775 |
| |
776 | 776 |
| |
| |||
1569 | 1569 |
| |
1570 | 1570 |
| |
1571 | 1571 |
| |
| 1572 | + | |
| 1573 | + | |
1572 | 1574 |
| |
1573 | 1575 |
| |
1574 | 1576 |
| |
| |||
1582 | 1584 |
| |
1583 | 1585 |
| |
1584 | 1586 |
| |
1585 |
| - | |
1586 |
| - | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
1587 | 1597 |
| |
1588 | 1598 |
| |
1589 | 1599 |
| |
|
Lines changed: 13 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
64 |
| - | |
| 64 | + | |
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
| |||
81 | 81 |
| |
82 | 82 |
| |
83 | 83 |
| |
84 |
| - | |
85 |
| - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
86 | 88 |
| |
87 | 89 |
| |
88 |
| - | |
| 90 | + | |
89 | 91 |
| |
90 | 92 |
| |
91 | 93 |
| |
92 | 94 |
| |
93 | 95 |
| |
94 | 96 |
| |
95 | 97 |
| |
| 98 | + | |
| 99 | + | |
| 100 | + | |
96 | 101 |
| |
97 | 102 |
| |
98 | 103 |
| |
| |||
103 | 108 |
| |
104 | 109 |
| |
105 | 110 |
| |
| 111 | + | |
106 | 112 |
| |
| 113 | + | |
| 114 | + | |
| 115 | + | |
107 | 116 |
| |
108 | 117 |
| |
109 | 118 |
| |
| |||
141 | 150 |
| |
142 | 151 |
| |
143 | 152 |
| |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 | 153 |
| |
148 | 154 |
| |
149 | 155 |
| |
|
Lines changed: 0 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
171 | 162 |
| |
172 | 163 |
| |
173 | 164 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
612 | 612 |
| |
613 | 613 |
| |
614 | 614 |
| |
615 |
| - | |
616 | 615 |
| |
617 | 616 |
| |
618 | 617 |
| |
|
Lines changed: 8 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
465 | 465 |
| |
466 | 466 |
| |
467 | 467 |
| |
468 |
| - | |
| 468 | + | |
469 | 469 |
| |
470 |
| - | |
471 | 470 |
| |
472 | 471 |
| |
473 | 472 |
| |
474 | 473 |
| |
475 | 474 |
| |
476 | 475 |
| |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 | 476 |
| |
482 |
| - | |
483 |
| - | |
484 |
| - | |
485 |
| - | |
486 |
| - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
487 | 482 |
| |
488 | 483 |
| |
489 | 484 |
| |
490 | 485 |
| |
491 | 486 |
| |
492 |
| - | |
| 487 | + | |
| 488 | + | |
493 | 489 |
| |
494 | 490 |
| |
495 | 491 |
| |
|
0 commit comments
Comments
(0)