forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1c7675a
committed
Fix wrong data table horizon computation during backend startup.
When ComputeXidHorizons() was called before MyDatabaseOid is set,e.g. because a dead row in a shared relation is encountered duringInitPostgres(), the horizon for normal tables was computed tooaggressively, ignoring all backends connected to a database.During subsequent pruning in a data table the too aggressive horizoncould end up still being used, possibly leading to still needed tuplesbeing removed. Not good.This is a bug indc7420c, which the test added in94bc27b madevisible, if run with force_parallel_mode set to regress. In that casethe bug is reliably triggered, because "pruning_query" is run in aparallel worker and the start of that parallel worker is likely toencounter a dead row in pg_database.The fix is trivial: Compute a more pessimistic data table horizon ifMyDatabaseId is not yet known.Author: Andres FreundDiscussion:https://postgr.es/m/20201029040030.p4osrmaywhqaesd4@alap3.anarazel.de1 parent8e90ec5 commit1c7675a
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1757 | 1757 |
| |
1758 | 1758 |
| |
1759 | 1759 |
| |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
1760 | 1767 |
| |
1761 | 1768 |
| |
1762 |
| - | |
| 1769 | + | |
1763 | 1770 |
| |
1764 | 1771 |
| |
1765 | 1772 |
| |
|
0 commit comments
Comments
(0)