- Notifications
You must be signed in to change notification settings - Fork5
Commite981653
committed
Update FSM on WAL replay. This is a bit limited; the FSM is only updated
on non-full-page-image WAL records, and quite arbitrarily, only if there'sless than 20% free space on the page after the insert/update (not on HOTupdates, though). The 20% cutoff should avoid most of the overhead, whenreplaying a bulk insertion, for example, while ensuring that pages thatare full are marked as full in the FSM.This is mostly to avoid the nasty worst case scenario, where you replayfrom a PITR archive, and the FSM information in the base backup is reallyout of date. If there was a lot of pages that the outdated FSM claims tohave free space, but don't actually have any, the first unlucky inserterafter the recovery would traverse through all those pages, just to findout that they're full. We didn't have this problem with the old FSMimplementation, because we simply threw the FSM information away on anon-clean shutdown.1 parent9b46abb commite981653
File tree
3 files changed
+92
-9
lines changed- src
- backend
- access/heap
- storage/freespace
- include/storage
3 files changed
+92
-9
lines changedLines changed: 58 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| 57 | + | |
57 | 58 |
| |
58 | 59 |
| |
59 | 60 |
| |
| |||
4022 | 4023 |
| |
4023 | 4024 |
| |
4024 | 4025 |
| |
| 4026 | + | |
4025 | 4027 |
| |
4026 | 4028 |
| |
4027 | 4029 |
| |
| |||
4053 | 4055 |
| |
4054 | 4056 |
| |
4055 | 4057 |
| |
| 4058 | + | |
| 4059 | + | |
4056 | 4060 |
| |
4057 | 4061 |
| |
4058 | 4062 |
| |
| |||
4062 | 4066 |
| |
4063 | 4067 |
| |
4064 | 4068 |
| |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
4065 | 4078 |
| |
4066 | 4079 |
| |
4067 | 4080 |
| |
| |||
4205 | 4218 |
| |
4206 | 4219 |
| |
4207 | 4220 |
| |
| 4221 | + | |
| 4222 | + | |
4208 | 4223 |
| |
4209 | 4224 |
| |
4210 | 4225 |
| |
4211 | 4226 |
| |
| 4227 | + | |
| 4228 | + | |
4212 | 4229 |
| |
4213 | 4230 |
| |
4214 |
| - | |
4215 |
| - | |
4216 |
| - | |
| 4231 | + | |
4217 | 4232 |
| |
4218 | 4233 |
| |
4219 | 4234 |
| |
4220 | 4235 |
| |
4221 | 4236 |
| |
4222 | 4237 |
| |
4223 | 4238 |
| |
4224 |
| - | |
4225 |
| - | |
4226 |
| - | |
| 4239 | + | |
4227 | 4240 |
| |
4228 | 4241 |
| |
4229 | 4242 |
| |
| |||
4261 | 4274 |
| |
4262 | 4275 |
| |
4263 | 4276 |
| |
| 4277 | + | |
| 4278 | + | |
| 4279 | + | |
4264 | 4280 |
| |
4265 | 4281 |
| |
4266 | 4282 |
| |
4267 | 4283 |
| |
| 4284 | + | |
| 4285 | + | |
| 4286 | + | |
| 4287 | + | |
| 4288 | + | |
| 4289 | + | |
| 4290 | + | |
| 4291 | + | |
| 4292 | + | |
| 4293 | + | |
| 4294 | + | |
| 4295 | + | |
4268 | 4296 |
| |
4269 | 4297 |
| |
4270 | 4298 |
| |
| |||
4289 | 4317 |
| |
4290 | 4318 |
| |
4291 | 4319 |
| |
| 4320 | + | |
4292 | 4321 |
| |
4293 | 4322 |
| |
4294 | 4323 |
| |
| |||
4446 | 4475 |
| |
4447 | 4476 |
| |
4448 | 4477 |
| |
| 4478 | + | |
| 4479 | + | |
| 4480 | + | |
4449 | 4481 |
| |
4450 | 4482 |
| |
4451 | 4483 |
| |
4452 | 4484 |
| |
| 4485 | + | |
| 4486 | + | |
| 4487 | + | |
| 4488 | + | |
| 4489 | + | |
| 4490 | + | |
| 4491 | + | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
| 4496 | + | |
| 4497 | + | |
| 4498 | + | |
| 4499 | + | |
| 4500 | + | |
| 4501 | + | |
| 4502 | + | |
| 4503 | + | |
4453 | 4504 |
| |
4454 | 4505 |
| |
4455 | 4506 |
| |
|
Lines changed: 31 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
202 | 202 |
| |
203 | 203 |
| |
204 | 204 |
| |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
205 | 235 |
| |
206 | 236 |
| |
207 | 237 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| 30 | + | |
| 31 | + | |
30 | 32 |
| |
31 | 33 |
| |
32 | 34 |
| |
|
0 commit comments
Comments
(0)