forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit687f2cd
committed
Avoid pin scan for replay of XLOG_BTREE_VACUUM
Replay of XLOG_BTREE_VACUUM during Hot Standby was previously thought to requirecomplex interlocking that matched the requirements on the master. This requiredan O(N) operation that became a significant problem with large indexes, causingreplication delays of seconds or in some cases minutes while theXLOG_BTREE_VACUUM was replayed.This commit skips the “pin scan” that was previously required, by observing indetail when and how it is safe to do so, with full documentation. The pin scanis skipped only in replay; the VACUUM code path on master is not touched here.The current commit still performs the pin scan for toast indexes, though thiscan also be avoided if we recheck scans on toast indexes. Later patch willaddress this.No tests included. Manual tests using an additional patch to view WAL recordsand their timing have shown the change in WAL records and their handling hassuccessfully reduced replication delay.1 parent4631721 commit687f2cd
5 files changed
+67
-6
lines changedLines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
520 | 520 |
| |
521 | 521 |
| |
522 | 522 |
| |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
523 | 547 |
| |
524 | 548 |
| |
525 | 549 |
| |
|
Lines changed: 22 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
| |||
823 | 824 |
| |
824 | 825 |
| |
825 | 826 |
| |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
826 | 832 |
| |
827 | 833 |
| |
828 | 834 |
| |
| |||
833 | 839 |
| |
834 | 840 |
| |
835 | 841 |
| |
| 842 | + | |
836 | 843 |
| |
837 | 844 |
| |
838 | 845 |
| |
| |||
1031 | 1038 |
| |
1032 | 1039 |
| |
1033 | 1040 |
| |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
1034 | 1055 |
| |
1035 | 1056 |
| |
1036 | 1057 |
| |
| |||
1043 | 1064 |
| |
1044 | 1065 |
| |
1045 | 1066 |
| |
1046 |
| - | |
| 1067 | + | |
1047 | 1068 |
| |
1048 | 1069 |
| |
1049 | 1070 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
391 | 391 |
| |
392 | 392 |
| |
393 | 393 |
| |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
394 | 407 |
| |
395 | 408 |
| |
396 | 409 |
| |
| |||
412 | 425 |
| |
413 | 426 |
| |
414 | 427 |
| |
415 |
| - | |
| 428 | + | |
416 | 429 |
| |
417 | 430 |
| |
418 | 431 |
| |
| |||
433 | 446 |
| |
434 | 447 |
| |
435 | 448 |
| |
436 |
| - | |
| 449 | + | |
| 450 | + | |
437 | 451 |
| |
438 | 452 |
| |
439 | 453 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
331 | 331 |
| |
332 | 332 |
| |
333 | 333 |
| |
334 |
| - | |
335 |
| - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
336 | 338 |
| |
337 | 339 |
| |
338 | 340 |
| |
|
0 commit comments
Comments
(0)