Commit 2a8e1ac
committed
Set the all-visible flag on heap page before writing WAL record, not after.
If we set the all-visible flag after writing WAL record, and XLogInsert
takes a full-page image of the page, the image would not include the flag.
We will then proceed to set the VM bit, which would then be set without the
corresponding all-visible flag on the heap page.
Found by comparing page images on master and standby, after writing/replaying
each WAL record. (There is still a discrepancy: the all-visible flag won't
be set after replaying the HEAP_CLEAN record, even though it is set in the
master. However, it will be set when replaying the HEAP2_VISIBLE record and
setting the VM bit, so the all-visible flag and VM bit are always consistent
on the standby, even though they are momentarily out-of-sync with master)
Backpatch to 9.3 where this code was introduced.1 parent 5f86cbd commit 2a8e1ac
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1213 | 1213 | | |
1214 | 1214 | | |
1215 | 1215 | | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
1216 | 1223 | | |
1217 | 1224 | | |
1218 | 1225 | | |
| |||
1231 | 1238 | | |
1232 | 1239 | | |
1233 | 1240 | | |
1234 | | - | |
1235 | | - | |
| 1241 | + | |
| 1242 | + | |
1236 | 1243 | | |
1237 | | - | |
1238 | | - | |
| 1244 | + | |
| 1245 | + | |
1239 | 1246 | | |
1240 | 1247 | | |
1241 | | - | |
1242 | 1248 | | |
1243 | 1249 | | |
1244 | 1250 | | |
| |||
0 commit comments