forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9364134
committed
Ensure ANALYZE phase is not skipped because of canceled truncate.
Patchb19e425 attempted topreserve existing behavior regarding statistics generation in thecase that a truncation attempt was canceled due to lock conflicts.It failed to do this accurately in two regards: (1) autovacuum hadpreviously generated statistics if the truncate attempt failed toinitially get the lock rather than having started the attempt, and(2) the VACUUM ANALYZE command had always generated statistics.Both of these changes were unintended, and are reverted by thispatch. On review, there seems to be consensus that the previousfailure to generate statistics when the truncate was terminatedwas more an unfortunate consequence of how that effort waspreviously terminated than a feature we want to keep; so thispatch generates statistics even when an autovacuum truncationattempt terminates early. Another unintended change which is kepton the basis that it is an improvement is that when a VACUUMcommand is truncating, it will the new heuristic for avoidingblocking other processes, rather than keeping anAccessExclusiveLock on the table for however long the truncationtakes.Per multiple reports, with some renaming per patch by Jeff Janes.Backpatch to 9.0, where problem was created.1 parent359c8e4 commit9364134
1 file changed
+22
-36
lines changedLines changed: 22 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
77 |
| - | |
78 |
| - | |
79 |
| - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| |||
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
257 |
| - | |
258 |
| - | |
259 |
| - | |
260 |
| - | |
261 |
| - | |
262 |
| - | |
263 |
| - | |
264 |
| - | |
265 |
| - | |
266 |
| - | |
267 |
| - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
268 | 261 |
| |
269 | 262 |
| |
270 | 263 |
| |
| |||
1138 | 1131 |
| |
1139 | 1132 |
| |
1140 | 1133 |
| |
1141 |
| - | |
1142 |
| - | |
| 1134 | + | |
| 1135 | + | |
1143 | 1136 |
| |
1144 | 1137 |
| |
1145 | 1138 |
| |
1146 |
| - | |
1147 |
| - | |
1148 |
| - | |
1149 |
| - | |
| 1139 | + | |
1150 | 1140 |
| |
1151 | 1141 |
| |
1152 |
| - | |
1153 |
| - | |
1154 |
| - | |
1155 |
| - | |
1156 |
| - | |
1157 |
| - | |
| 1142 | + | |
| 1143 | + | |
1158 | 1144 |
| |
1159 | 1145 |
| |
1160 | 1146 |
| |
1161 | 1147 |
| |
1162 |
| - | |
| 1148 | + | |
1163 | 1149 |
| |
1164 | 1150 |
| |
1165 | 1151 |
| |
| |||
1239 | 1225 |
| |
1240 | 1226 |
| |
1241 | 1227 |
| |
1242 |
| - | |
1243 |
| - | |
1244 | 1228 |
| |
1245 | 1229 |
| |
1246 | 1230 |
| |
| |||
1258 | 1242 |
| |
1259 | 1243 |
| |
1260 | 1244 |
| |
1261 |
| - | |
1262 |
| - | |
1263 |
| - | |
1264 |
| - | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
1265 | 1249 |
| |
1266 | 1250 |
| |
1267 | 1251 |
| |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
1268 | 1255 |
| |
1269 | 1256 |
| |
1270 | 1257 |
| |
1271 | 1258 |
| |
1272 |
| - | |
| 1259 | + | |
1273 | 1260 |
| |
1274 | 1261 |
| |
1275 | 1262 |
| |
1276 | 1263 |
| |
1277 |
| - | |
1278 |
| - | |
| 1264 | + | |
1279 | 1265 |
| |
1280 | 1266 |
| |
1281 | 1267 |
| |
|
0 commit comments
Comments
(0)