forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitecac0e2
committed
Do all-visible handling in lazy_vacuum_page() outside its critical section.
Sincefdf9e21 lazy_vacuum_page() rechecks the all-visible statusof pages in the second pass over the heap. It does so inside acritical section, but both visibilitymap_test() andheap_page_is_all_visible() perform operations that should not happeninside one. The former potentially performs IO and both potentially domemory allocations.To fix, simply move all the all-visible handling outside the criticalsection. Doing so means that the PD_ALL_VISIBLE on the page won't beincluded in the full page image of the HEAP2_CLEAN record anymore. Butthat's fine, the flag will be set by the HEAP2_VISIBLE logged later.Backpatch to 9.3 where the problem was introduced. The bug only cameto light due to the assertion added in4a170ee and isn't likely tocause problems in production scenarios. The worst outcome is aavoidable PANIC restart.This also gets rid of the difference in the order of operationsbetween master and standby mentioned in2a8e1ac.Per reports from David Leverton and Keith Fiske in bug #10533.1 parent3bdcf6a commitecac0e2
1 file changed
+17
-9
lines changedLines changed: 17 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1213 | 1213 |
| |
1214 | 1214 |
| |
1215 | 1215 |
| |
1216 |
| - | |
1217 |
| - | |
1218 |
| - | |
1219 |
| - | |
1220 |
| - | |
1221 |
| - | |
1222 |
| - | |
1223 | 1216 |
| |
1224 | 1217 |
| |
1225 | 1218 |
| |
| |||
1237 | 1230 |
| |
1238 | 1231 |
| |
1239 | 1232 |
| |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1240 | 1250 |
| |
1241 | 1251 |
| |
1242 | 1252 |
| |
| |||
1249 | 1259 |
| |
1250 | 1260 |
| |
1251 | 1261 |
| |
1252 |
| - | |
1253 |
| - | |
1254 | 1262 |
| |
1255 | 1263 |
| |
1256 | 1264 |
| |
|
0 commit comments
Comments
(0)