reindexing an invalid index should not use ERRCODE_INDEX_CORRUPTED
От | Andres Freund |
---|---|
Тема | reindexing an invalid index should not use ERRCODE_INDEX_CORRUPTED |
Дата | |
Msg-id | 20231118230958.4fm3fhk4ypshxopa@awork3.anarazel.de обсуждение исходный текст |
Ответы |
Re: reindexing an invalid index should not use ERRCODE_INDEX_CORRUPTED
|
Список | pgsql-hackers |
Hi, We currently provide no way to learn about a postgres instance having corruption than searching the logs for corruption events than matching by sqlstate, for ERRCODE_DATA_CORRUPTED and ERRCODE_INDEX_CORRUPTED. Unfortunately, there is a case of such an sqlstate that's not at all indicating corruption, namely REINDEX CONCURRENTLY when the index is invalid: if (!indexRelation->rd_index->indisvalid) ereport(WARNING, (errcode(ERRCODE_INDEX_CORRUPTED), errmsg("cannot reindex invalid index \"%s.%s\" concurrently, skipping", get_namespace_name(get_rel_namespace(cellOid)), get_rel_name(cellOid)))); The only thing required to get to this is an interrupted CREATE INDEX CONCURRENTLY, which I don't think can be fairly characterized as "corruption". ISTM something like ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE would be more appropriate? Greetings, Andres Freund
В списке pgsql-hackers по дате отправления: