mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
Use ereport not elog for some corrupt-HOT-chain reports.
These errors have been seen in the field in corrupted-data situations. It seems worthwhile to report them with ERRCODE_DATA_CORRUPTED, rather than the generic ERRCODE_INTERNAL_ERROR, for the benefit of log monitoring and tools like amcheck. However, use errmsg_internal so that the text strings still aren't translated; it seems unlikely to be worth translators' time to do so. Back-patch to 9.3, like the predecessor commit d70cf811f that introduced these elog calls originally (replacing Asserts). Peter Geoghegan Discussion: https://postgr.es/m/CAH2-Wzmn4-Pg-UGFwyuyK-wiTih9j32pwg_7T9iwqXpAUZr=Mg@mail.gmail.com
This commit is contained in:
parent
491bbc36ea
commit
fb1d72f409
@ -2574,9 +2574,12 @@ IndexBuildHeapRangeScan(Relation heapRelation,
|
|||||||
offnum = ItemPointerGetOffsetNumber(&heapTuple->t_self);
|
offnum = ItemPointerGetOffsetNumber(&heapTuple->t_self);
|
||||||
|
|
||||||
if (!OffsetNumberIsValid(root_offsets[offnum - 1]))
|
if (!OffsetNumberIsValid(root_offsets[offnum - 1]))
|
||||||
elog(ERROR, "failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
|
ereport(ERROR,
|
||||||
ItemPointerGetBlockNumber(&heapTuple->t_self),
|
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||||
offnum, RelationGetRelationName(heapRelation));
|
errmsg_internal("failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
|
||||||
|
ItemPointerGetBlockNumber(&heapTuple->t_self),
|
||||||
|
offnum,
|
||||||
|
RelationGetRelationName(heapRelation))));
|
||||||
|
|
||||||
ItemPointerSetOffsetNumber(&rootTuple.t_self,
|
ItemPointerSetOffsetNumber(&rootTuple.t_self,
|
||||||
root_offsets[offnum - 1]);
|
root_offsets[offnum - 1]);
|
||||||
@ -2995,10 +2998,12 @@ validate_index_heapscan(Relation heapRelation,
|
|||||||
{
|
{
|
||||||
root_offnum = root_offsets[root_offnum - 1];
|
root_offnum = root_offsets[root_offnum - 1];
|
||||||
if (!OffsetNumberIsValid(root_offnum))
|
if (!OffsetNumberIsValid(root_offnum))
|
||||||
elog(ERROR, "failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
|
ereport(ERROR,
|
||||||
ItemPointerGetBlockNumber(heapcursor),
|
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||||
ItemPointerGetOffsetNumber(heapcursor),
|
errmsg_internal("failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
|
||||||
RelationGetRelationName(heapRelation));
|
ItemPointerGetBlockNumber(heapcursor),
|
||||||
|
ItemPointerGetOffsetNumber(heapcursor),
|
||||||
|
RelationGetRelationName(heapRelation))));
|
||||||
ItemPointerSetOffsetNumber(&rootTuple, root_offnum);
|
ItemPointerSetOffsetNumber(&rootTuple, root_offnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user