1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-11 10:01:57 +03:00

Add error codes to some corruption log messages

In some cases we have elog(ERROR) while corruption is certain and we
can give a clear error code ERRCODE_DATA_CORRUPTED or
ERRCODE_INDEX_CORRUPTED.

Author: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://www.postgresql.org/message-id/flat/25F6C686-6442-4A6B-BAF8-A6F7B84B16DE@yandex-team.ru
This commit is contained in:
Peter Eisentraut
2019-08-01 11:05:08 +02:00
parent b2a3d706b8
commit fd6ec93bf8
5 changed files with 70 additions and 44 deletions

View File

@ -423,7 +423,9 @@ tuple_lock_retry:
/* otherwise xmin should not be dirty... */
if (TransactionIdIsValid(SnapshotDirty.xmin))
elog(ERROR, "t_xmin is uncommitted in tuple to be updated");
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
errmsg_internal("t_xmin is uncommitted in tuple to be updated")));
/*
* If tuple is being updated by other transaction then we