forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit95aa823
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 XLogInserttakes 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 thecorresponding all-visible flag on the heap page.Found by comparing page images on master and standby, after writing/replayingeach WAL record. (There is still a discrepancy: the all-visible flag won'tbe set after replaying the HEAP_CLEAN record, even though it is set in themaster. However, it will be set when replaying the HEAP2_VISIBLE record andsetting the VM bit, so the all-visible flag and VM bit are always consistenton the standby, even though they are momentarily out-of-sync with master)Backpatch to 9.3 where this code was introduced.1 parentaa0a519 commit95aa823
1 file changed
+11
-5
lines changedLines changed: 11 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1206 | 1206 |
| |
1207 | 1207 |
| |
1208 | 1208 |
| |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
1209 | 1216 |
| |
1210 | 1217 |
| |
1211 | 1218 |
| |
| |||
1224 | 1231 |
| |
1225 | 1232 |
| |
1226 | 1233 |
| |
1227 |
| - | |
1228 |
| - | |
| 1234 | + | |
| 1235 | + | |
1229 | 1236 |
| |
1230 |
| - | |
1231 |
| - | |
| 1237 | + | |
| 1238 | + | |
1232 | 1239 |
| |
1233 | 1240 |
| |
1234 |
| - | |
1235 | 1241 |
| |
1236 | 1242 |
| |
1237 | 1243 |
| |
|
0 commit comments
Comments
(0)