Commit 0905fe8
committed
Avoid emitting a bogus WAL record when recycling an all-zero btree page.
Commit fafa374 caused _bt_getbuf() to possibly emit a WAL record for
a page that it was about to recycle. However, it failed to distinguish
all-zero pages from dead pages, which is important because only the
latter have valid btpo.xact values, or indeed any special space at all.
Recycling an all-zero page with XLogStandbyInfoActive() enabled therefore
led to an Assert failure, or to emission of a WAL record containing a
bogus cutoff XID, which might lead to unnecessary query cancellations
on hot standby servers.
Per reports from Antonin Houska and 自己. Amit Kapila was first to
propose this fix, and Robert Haas, myself, and Kyotaro Horiguchi
reviewed it at various times.
This is an old bug, so back-patch to all supported branches.
Discussion: https://postgr.es/m/2628.1474272158@localhost
Discussion: https://postgr.es/m/48875502.f4a0.1635f0c27b0.Coremail.zoulx1982@163.com1 parent a22445f commit 0905fe8
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
785 | | - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
786 | 790 | | |
787 | | - | |
| 791 | + | |
| 792 | + | |
788 | 793 | | |
789 | 794 | | |
790 | 795 | | |
| |||
897 | 902 | | |
898 | 903 | | |
899 | 904 | | |
900 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
901 | 909 | | |
902 | 910 | | |
903 | 911 | | |
| |||
0 commit comments