- Notifications
You must be signed in to change notification settings - Fork5
Commitcbe9d6b
committed
Fix up rickety handling of relation-truncation interlocks.
Move rd_targblock, rd_fsm_nblocks, and rd_vm_nblocks from relcache to the smgrrelation entries, so that they will get reset to InvalidBlockNumber wheneveran smgr-level flush happens. Because we now send smgr invalidation messagesimmediately (not at end of transaction) when a relation truncation occurs,this ensures that other backends will reset their values before they nextaccess the relation. We no longer need the unreliable assumption that aVACUUM that's doing a truncation will hold its AccessExclusive lock untilcommit --- in fact, we can intentionally release that lock as soon as we'vecompleted the truncation. This patch therefore reverts (most of) Alvaro'spatch of 2009-11-10, as well as my marginal hacking on it yesterday. We canalso get rid of assorted no-longer-needed relcache flushes, which are far moreexpensive than an smgr flush because they kill a lot more state.In passing this patch fixes smgr_redo's failure to perform visibility-maptruncation, and cleans up some rather dubious assumptions in freespace.c andvisibilitymap.c about when rd_fsm_nblocks and rd_vm_nblocks can be out ofdate.1 parent79647ee commitcbe9d6b
File tree
15 files changed
+207
-216
lines changed- src
- backend
- access
- heap
- transam
- catalog
- commands
- executor
- storage
- freespace
- smgr
- utils/cache
- include
- commands
- storage
- utils
15 files changed
+207
-216
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | | - | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | | - | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
380 | | - | |
| 381 | + | |
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
295 | 301 | | |
296 | 302 | | |
297 | 303 | | |
| |||
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
| 316 | + | |
| 317 | + | |
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
| |||
358 | 366 | | |
359 | 367 | | |
360 | 368 | | |
361 | | - | |
| 369 | + | |
362 | 370 | | |
363 | 371 | | |
364 | 372 | | |
365 | 373 | | |
366 | 374 | | |
| 375 | + | |
367 | 376 | | |
368 | 377 | | |
369 | 378 | | |
370 | 379 | | |
371 | | - | |
372 | | - | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
373 | 385 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
| 386 | + | |
| 387 | + | |
378 | 388 | | |
379 | 389 | | |
380 | 390 | | |
| |||
391 | 401 | | |
392 | 402 | | |
393 | 403 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
397 | 408 | | |
398 | | - | |
| 409 | + | |
| 410 | + | |
399 | 411 | | |
400 | 412 | | |
401 | | - | |
402 | | - | |
| 413 | + | |
| 414 | + | |
403 | 415 | | |
404 | | - | |
| 416 | + | |
405 | 417 | | |
406 | 418 | | |
407 | 419 | | |
408 | | - | |
| 420 | + | |
409 | 421 | | |
410 | 422 | | |
411 | 423 | | |
| |||
446 | 458 | | |
447 | 459 | | |
448 | 460 | | |
449 | | - | |
| 461 | + | |
450 | 462 | | |
451 | 463 | | |
452 | 464 | | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
457 | 475 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
| 476 | + | |
| 477 | + | |
462 | 478 | | |
463 | 479 | | |
464 | 480 | | |
| |||
467 | 483 | | |
468 | 484 | | |
469 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
470 | 489 | | |
471 | 490 | | |
472 | 491 | | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | 492 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | 396 | | |
400 | 397 | | |
401 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
459 | 463 | | |
460 | 464 | | |
461 | 465 | | |
| 466 | + | |
462 | 467 | | |
463 | 468 | | |
464 | 469 | | |
| |||
475 | 480 | | |
476 | 481 | | |
477 | 482 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
| 483 | + | |
| 484 | + | |
482 | 485 | | |
| 486 | + | |
483 | 487 | | |
484 | | - | |
485 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
486 | 492 | | |
487 | 493 | | |
488 | 494 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
562 | | - | |
563 | | - | |
564 | 563 | | |
565 | 564 | | |
566 | 565 | | |
567 | 566 | | |
568 | 567 | | |
569 | 568 | | |
570 | | - | |
571 | | - | |
572 | 569 | | |
573 | 570 | | |
574 | 571 | | |
| |||
819 | 816 | | |
820 | 817 | | |
821 | 818 | | |
822 | | - | |
823 | | - | |
| 819 | + | |
| 820 | + | |
824 | 821 | | |
825 | 822 | | |
826 | 823 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
223 | | - | |
| 224 | + | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
792 | | - | |
793 | 792 | | |
794 | 793 | | |
795 | 794 | | |
| |||
970 | 969 | | |
971 | 970 | | |
972 | 971 | | |
973 | | - | |
974 | 972 | | |
975 | 973 | | |
976 | | - | |
| 974 | + | |
977 | 975 | | |
978 | 976 | | |
979 | 977 | | |
| |||
991 | 989 | | |
992 | 990 | | |
993 | 991 | | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | 992 | | |
999 | 993 | | |
1000 | 994 | | |
| |||
0 commit comments
Comments
(0)