forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8523492
committed
Remove tupgone special case from vacuumlazy.c.
Retry the call to heap_prune_page() in rare cases where there isdisagreement between the heap_prune_page() call and the call toHeapTupleSatisfiesVacuum() that immediately follows. Disagreement ispossible when a concurrently-aborted transaction makes a tuple DEADduring the tiny window between each step. This was the only case wherea tuple considered DEAD by VACUUM still had storage following pruning.VACUUM's definition of dead tuples is now uniformly simple andunambiguous: dead tuples from each page are always LP_DEAD line pointersthat were encountered just after we performed pruning (and just beforewe considered freezing remaining items with tuple storage).Eliminating the tupgone=true special case enables INDEX_CLEANUP=offstyle skipping of index vacuuming that takes place based on flexible,dynamic criteria. The INDEX_CLEANUP=off case had to know about skippingindexes up-front before now, due to a subtle interaction with thespecial case (see commitdd69597) -- this was a special case untoitself. Now there are no special cases. And so now it won't matterwhen or how we decide to skip index vacuuming: it won't affect howpruning behaves, and it won't be affected by any of the implementationdetails of pruning or freezing.Also remove XLOG_HEAP2_CLEANUP_INFO records. These are no longernecessary because we now rely entirely on heap pruning taking care ofrecovery conflicts. There is no longer any need to generate recoveryconflicts for DEAD tuples that pruning just missed. This also meansthat heap vacuuming now uses exactly the same strategy for recoveryconflicts as index vacuuming always has: REDO routines never need toprocess a latestRemovedXid from the WAL record, since earlier REDO ofthe WAL record from pruning is sufficient in all cases. The genericXLOG_HEAP2_CLEAN record type is now split into two new record types toreflect this new division (these are called XLOG_HEAP2_PRUNE andXLOG_HEAP2_VACUUM).Also stop acquiring a super-exclusive lock for heap pages when they'revacuumed during VACUUM's second heap pass. A regular exclusive lock isenough. This is correct because heap page vacuuming is now strictly amatter of setting the LP_DEAD line pointers to LP_UNUSED. No otherbackend can have a pointer to a tuple located in a pinned buffer thatcan be invalidated by a concurrent heap page vacuum operation.Heap vacuuming can now be thought of as conceptually similar to indexvacuuming and conceptually dissimilar to heap pruning. Heap pruning nowhas sole responsibility for anything involving the logical contents ofthe database (e.g., managing transaction status information, recoveryconflicts, considering what to do with HOT chains). Index vacuuming andheap vacuuming are now only concerned with recycling garbage items fromphysical data structures that back the logical database.Bump XLOG_PAGE_MAGIC due to pruning and heap page vacuum WAL recordchanges.Credit for the idea of retrying pruning a page to avoid the tupgone casegoes to Andres Freund.Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Andres Freund <andres@anarazel.de>Reviewed-By: Masahiko Sawada <sawada.mshk@gmail.com>Discussion:https://postgr.es/m/CAH2-WznneCXTzuFmcwx_EyRQgfsfJAAsu+CsqRFmFXCAar=nJw@mail.gmail.com1 parent789d81d commit8523492
File tree
12 files changed
+285
-336
lines changed- src
- backend
- access
- gist
- hash
- heap
- nbtree
- rmgrdesc
- replication/logical
- include/access
- tools/pgindent
12 files changed
+285
-336
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
184 | 184 |
| |
185 | 185 |
| |
186 | 186 |
| |
187 |
| - | |
188 |
| - | |
189 |
| - | |
190 |
| - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
992 | 992 |
| |
993 | 993 |
| |
994 | 994 |
| |
995 |
| - | |
996 |
| - | |
997 |
| - | |
998 |
| - | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
999 | 999 |
| |
1000 | 1000 |
| |
1001 | 1001 |
| |
|
Lines changed: 87 additions & 118 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7538 | 7538 |
| |
7539 | 7539 |
| |
7540 | 7540 |
| |
7541 |
| - | |
| 7541 | + | |
7542 | 7542 |
| |
7543 | 7543 |
| |
7544 | 7544 |
| |
| |||
7957 | 7957 |
| |
7958 | 7958 |
| |
7959 | 7959 |
| |
7960 |
| - | |
7961 |
| - | |
7962 |
| - | |
7963 |
| - | |
7964 |
| - | |
7965 |
| - | |
7966 |
| - | |
7967 |
| - | |
7968 |
| - | |
7969 |
| - | |
7970 |
| - | |
7971 |
| - | |
7972 |
| - | |
7973 |
| - | |
7974 |
| - | |
7975 |
| - | |
7976 |
| - | |
7977 |
| - | |
7978 |
| - | |
7979 |
| - | |
7980 |
| - | |
7981 |
| - | |
7982 |
| - | |
7983 |
| - | |
7984 |
| - | |
7985 |
| - | |
7986 |
| - | |
7987 |
| - | |
7988 |
| - | |
7989 |
| - | |
7990 |
| - | |
7991 |
| - | |
7992 |
| - | |
7993 |
| - | |
7994 |
| - | |
7995 |
| - | |
7996 |
| - | |
7997 |
| - | |
7998 |
| - | |
7999 |
| - | |
8000 |
| - | |
8001 |
| - | |
8002 |
| - | |
8003 |
| - | |
8004 |
| - | |
8005 |
| - | |
8006 |
| - | |
8007 |
| - | |
8008 |
| - | |
8009 |
| - | |
8010 |
| - | |
8011 |
| - | |
8012 |
| - | |
8013 |
| - | |
8014 |
| - | |
8015 |
| - | |
8016 |
| - | |
8017 |
| - | |
8018 |
| - | |
8019 |
| - | |
8020 |
| - | |
8021 |
| - | |
8022 |
| - | |
8023 |
| - | |
8024 |
| - | |
8025 |
| - | |
8026 |
| - | |
8027 |
| - | |
8028 |
| - | |
8029 |
| - | |
8030 |
| - | |
8031 |
| - | |
8032 |
| - | |
8033 |
| - | |
8034 |
| - | |
8035 |
| - | |
8036 |
| - | |
8037 |
| - | |
8038 |
| - | |
8039 |
| - | |
8040 |
| - | |
8041 |
| - | |
8042 | 7960 |
| |
8043 | 7961 |
| |
8044 | 7962 |
| |
| |||
8510 | 8428 |
| |
8511 | 8429 |
| |
8512 | 8430 |
| |
8513 |
| - | |
8514 |
| - | |
8515 |
| - | |
8516 |
| - | |
8517 |
| - | |
8518 |
| - | |
8519 |
| - | |
8520 |
| - | |
8521 |
| - | |
8522 |
| - | |
8523 |
| - | |
8524 |
| - | |
8525 |
| - | |
8526 |
| - | |
8527 |
| - | |
8528 |
| - | |
8529 |
| - | |
8530 |
| - | |
8531 |
| - | |
8532 |
| - | |
8533 |
| - | |
8534 |
| - | |
| 8431 | + | |
| 8432 | + | |
| 8433 | + | |
8535 | 8434 |
| |
8536 | 8435 |
| |
8537 |
| - | |
| 8436 | + | |
8538 | 8437 |
| |
8539 | 8438 |
| |
8540 |
| - | |
| 8439 | + | |
8541 | 8440 |
| |
8542 | 8441 |
| |
8543 | 8442 |
| |
| |||
8548 | 8447 |
| |
8549 | 8448 |
| |
8550 | 8449 |
| |
8551 |
| - | |
8552 |
| - | |
8553 |
| - | |
8554 |
| - | |
8555 | 8450 |
| |
8556 |
| - | |
| 8451 | + | |
8557 | 8452 |
| |
8558 | 8453 |
| |
8559 | 8454 |
| |
| |||
8606 | 8501 |
| |
8607 | 8502 |
| |
8608 | 8503 |
| |
8609 |
| - | |
| 8504 | + | |
8610 | 8505 |
| |
8611 | 8506 |
| |
8612 | 8507 |
| |
| |||
8618 | 8513 |
| |
8619 | 8514 |
| |
8620 | 8515 |
| |
| 8516 | + | |
| 8517 | + | |
| 8518 | + | |
| 8519 | + | |
| 8520 | + | |
| 8521 | + | |
| 8522 | + | |
| 8523 | + | |
| 8524 | + | |
| 8525 | + | |
| 8526 | + | |
| 8527 | + | |
| 8528 | + | |
| 8529 | + | |
| 8530 | + | |
| 8531 | + | |
| 8532 | + | |
| 8533 | + | |
| 8534 | + | |
| 8535 | + | |
| 8536 | + | |
| 8537 | + | |
| 8538 | + | |
| 8539 | + | |
| 8540 | + | |
| 8541 | + | |
| 8542 | + | |
| 8543 | + | |
| 8544 | + | |
| 8545 | + | |
| 8546 | + | |
| 8547 | + | |
| 8548 | + | |
| 8549 | + | |
| 8550 | + | |
| 8551 | + | |
| 8552 | + | |
| 8553 | + | |
| 8554 | + | |
| 8555 | + | |
| 8556 | + | |
| 8557 | + | |
| 8558 | + | |
| 8559 | + | |
| 8560 | + | |
| 8561 | + | |
| 8562 | + | |
| 8563 | + | |
| 8564 | + | |
| 8565 | + | |
| 8566 | + | |
| 8567 | + | |
| 8568 | + | |
| 8569 | + | |
| 8570 | + | |
| 8571 | + | |
| 8572 | + | |
| 8573 | + | |
| 8574 | + | |
| 8575 | + | |
| 8576 | + | |
| 8577 | + | |
| 8578 | + | |
| 8579 | + | |
| 8580 | + | |
| 8581 | + | |
| 8582 | + | |
| 8583 | + | |
| 8584 | + | |
| 8585 | + | |
| 8586 | + | |
| 8587 | + | |
| 8588 | + | |
| 8589 | + | |
8621 | 8590 |
| |
8622 | 8591 |
| |
8623 | 8592 |
| |
| |||
9722 | 9691 |
| |
9723 | 9692 |
| |
9724 | 9693 |
| |
9725 |
| - | |
9726 |
| - | |
| 9694 | + | |
| 9695 | + | |
| 9696 | + | |
| 9697 | + | |
| 9698 | + | |
9727 | 9699 |
| |
9728 | 9700 |
| |
9729 | 9701 |
| |
9730 | 9702 |
| |
9731 |
| - | |
9732 |
| - | |
9733 |
| - | |
9734 | 9703 |
| |
9735 | 9704 |
| |
9736 | 9705 |
| |
|
0 commit comments
Comments
(0)