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

Commit09620ea

Browse files
committed
Fix incorrect memory access in VACUUM FULL with invalid toast indexes
An invalid toast index is skipped in reindex_relation(). These would beremnants of a failed REINDEX CONCURRENTLY and they should never beenrebuilt as there can only be one valid toast index at a time.REINDEX_REL_SUPPRESS_INDEX_USE, used by CLUSTER and VACUUM FULL, needsto maintain a list of the indexes being processed. The list of indexesis retrieved from the relation cache, and includes invalid indexes. Thecode has missed that invalid toast indexes are ignored inreindex_relation() as this leads to a hard failure in reindex_index(),and they were left in the reindex pending list, making the listinconsistent when rechecked. The incorrect memory access was happeningwhen scanning pg_class for the refresh of pg_database.datfrozenxid, whendoing a scan of pg_class.This issue exists since REINDEX CONCURRENTLY exists, where invalid toastindexes can exist, so backpatch all the way down.Reported-by: Alexander LakhinAuthor: Tender WangDiscussion:https://postgr.es/m/18630-9aed99c38830657d@postgresql.orgBackpatch-through: 12
1 parentf762d99 commit09620ea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎src/backend/catalog/index.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4010,6 +4010,14 @@ reindex_relation(const ReindexStmt *stmt, Oid relid, int flags,
40104010
errmsg("cannot reindex invalid index \"%s.%s\" on TOAST table, skipping",
40114011
get_namespace_name(indexNamespaceId),
40124012
get_rel_name(indexOid))));
4013+
4014+
/*
4015+
* Remove this invalid toast index from the reindex pending list,
4016+
* as it is skipped here due to the hard failure that would happen
4017+
* in reindex_index(), should we try to process it.
4018+
*/
4019+
if (flags&REINDEX_REL_SUPPRESS_INDEX_USE)
4020+
RemoveReindexPending(indexOid);
40134021
continue;
40144022
}
40154023

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp