Commit c87aff0
committed
amcheck: Generalize one of the recently-added update chain checks.
Commit bbc1376 checked that if
a redirected line pointer pointed to a tuple, the tuple should be
marked both HEAP_ONLY_TUPLE and HEAP_UPDATED. But Andres Freund
pointed out that *any* tuple that is marked HEAP_ONLY_TUPLE should
be marked HEAP_UPDATED, not just one that is the target of a
redirected line pointer. Do that instead.
To see why this is better, consider a redirect line pointer A
which points to a heap-only tuple B which points (via CTID)
to another heap-only tuple C. With the old code, we'd complain
if B was not marked HEAP_UPDATED, but with this change, we'll
complain if either B or C is not marked HEAP_UPDATED.
(Note that, with or without this commit, if either B or C were
not marked HEAP_ONLY_TUPLE, we would also complain about that.)
Discussion: http://postgr.es/m/CA%2BTgmobLypZx%3DcOH%2ByY1GZmCruaoucHm77A6y_-Bo%3Dh-_3H28g%40mail.gmail.com1 parent 80d5e3a commit c87aff0
File tree
2 files changed
+14
-17
lines changed- contrib/amcheck
- src/bin/pg_amcheck/t
2 files changed
+14
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | 627 | | |
639 | 628 | | |
640 | 629 | | |
| |||
954 | 943 | | |
955 | 944 | | |
956 | 945 | | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
957 | 955 | | |
958 | 956 | | |
959 | 957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
| 620 | + | |
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
625 | | - | |
626 | 624 | | |
627 | 625 | | |
628 | 626 | | |
| |||
637 | 635 | | |
638 | 636 | | |
639 | 637 | | |
640 | | - | |
641 | | - | |
| 638 | + | |
| 639 | + | |
642 | 640 | | |
643 | | - | |
644 | 641 | | |
645 | 642 | | |
646 | 643 | | |
| |||
688 | 685 | | |
689 | 686 | | |
690 | 687 | | |
| 688 | + | |
| 689 | + | |
691 | 690 | | |
692 | 691 | | |
693 | 692 | | |
| |||
0 commit comments