Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a1e1d8

Browse files
committed
Use correct horizon when vacuuming catalog relations.
Indc7420c I (Andres) accidentally usedRelationIsAccessibleInLogicalDecoding() as the sole condition to use thenon-shared catalog horizon in GetOldestNonRemovableTransactionId(). That isincorrect, as RelationIsAccessibleInLogicalDecoding() checks whether wal_levelis logical.The correct check, as done e.g. in GlobalVisTestFor(), is to checkIsCatalogRelation() and RelationIsAccessibleInLogicalDecoding().The observed misbehavior of this bug was that there could be an endless loopin lazy_scan_prune(), because the horizons used in heap_page_prune() and theindividual tuple liveliness checks did not match. Likely there are otherpotential consequences as well.A later commit will unify the determination which horizon has to be used, andadd additional assertions to make it easier to catch a bug like this.Reported-By: Justin Pryzby <pryzby@telsasoft.com>Diagnosed-By: Matthias van de Meent <boekewurm+postgres@gmail.com>Author: Matthias van de Meent <boekewurm+postgres@gmail.com>Discussion:https://postgr.es/m/CAEze2Wg32Y9+WJfw=aofkRx1ZRFt_Ev6bNPc4PSaz7PjSFtZgQ@mail.gmail.com
1 parent8d29d45 commit5a1e1d8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/backend/storage/ipc/procarray.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,9 +1971,10 @@ GetOldestNonRemovableTransactionId(Relation rel)
19711971
ComputeXidHorizons(&horizons);
19721972

19731973
/* select horizon appropriate for relation */
1974-
if (rel==NULL||rel->rd_rel->relisshared)
1974+
if (rel==NULL||rel->rd_rel->relisshared||RecoveryInProgress())
19751975
returnhorizons.shared_oldest_nonremovable;
1976-
elseif (RelationIsAccessibleInLogicalDecoding(rel))
1976+
elseif (IsCatalogRelation(rel)||
1977+
RelationIsAccessibleInLogicalDecoding(rel))
19771978
returnhorizons.catalog_oldest_nonremovable;
19781979
elseif (RELATION_IS_LOCAL(rel))
19791980
returnhorizons.temp_oldest_nonremovable;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp