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

Commit1532599

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 parent3e8c92c commit1532599

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
@@ -3982,6 +3982,14 @@ reindex_relation(const ReindexStmt *stmt, Oid relid, int flags,
39823982
errmsg("cannot reindex invalid index \"%s.%s\" on TOAST table, skipping",
39833983
get_namespace_name(indexNamespaceId),
39843984
get_rel_name(indexOid))));
3985+
3986+
/*
3987+
* Remove this invalid toast index from the reindex pending list,
3988+
* as it is skipped here due to the hard failure that would happen
3989+
* in reindex_index(), should we try to process it.
3990+
*/
3991+
if (flags&REINDEX_REL_SUPPRESS_INDEX_USE)
3992+
RemoveReindexPending(indexOid);
39853993
continue;
39863994
}
39873995

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp