forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf65b94f
committed
Avoid pin scan for replay of XLOG_BTREE_VACUUM in all cases
Replay of XLOG_BTREE_VACUUM during Hot Standby was previously thought torequire complex interlocking that matched the requirements on themaster. This required an O(N) operation that became a significantproblem with large indexes, causing replication delays of seconds or insome cases minutes while the XLOG_BTREE_VACUUM was replayed.This commit skips the “pin scan” that was previously required, byobserving in detail when and how it is safe to do so, with fulldocumentation. The pin scan is skipped only in replay; the VACUUM codepath on master is not touched here.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.This is a back-patch of commits687f2cd,3e4b7d8,b602842by Simon Riggs, to branches 9.4 and 9.5. No further backpatch ispossible because this depends on catalog scans being MVCC. I (Álvaro)additionally updated a slight problem in the README, which explains whythis touches the 9.6 and master branches.1 parent380895f commitf65b94f
1 file changed
+3
-2
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
521 | 521 |
| |
522 | 522 |
| |
523 | 523 |
| |
524 |
| - | |
| 524 | + | |
525 | 525 |
| |
526 | 526 |
| |
527 | 527 |
| |
528 |
| - | |
| 528 | + | |
| 529 | + | |
529 | 530 |
| |
530 | 531 |
| |
531 | 532 |
| |
|
0 commit comments
Comments
(0)