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

Commit8ecdc2f

Browse files
committed
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, ratherthan the generic ERRCODE_INTERNAL_ERROR, for the benefit of log monitoringand tools like amcheck. However, use errmsg_internal so that the textstrings still aren't translated; it seems unlikely to be worthtranslators' time to do so.Back-patch to 9.3, like the predecessor commitd70cf81 that introducedthese elog calls originally (replacing Asserts).Peter GeogheganDiscussion:https://postgr.es/m/CAH2-Wzmn4-Pg-UGFwyuyK-wiTih9j32pwg_7T9iwqXpAUZr=Mg@mail.gmail.com
1 parent477ad05 commit8ecdc2f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

‎src/backend/catalog/index.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2862,9 +2862,12 @@ IndexBuildHeapRangeScan(Relation heapRelation,
28622862
offnum=ItemPointerGetOffsetNumber(&heapTuple->t_self);
28632863

28642864
if (!OffsetNumberIsValid(root_offsets[offnum-1]))
2865-
elog(ERROR,"failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
2866-
ItemPointerGetBlockNumber(&heapTuple->t_self),
2867-
offnum,RelationGetRelationName(heapRelation));
2865+
ereport(ERROR,
2866+
(errcode(ERRCODE_DATA_CORRUPTED),
2867+
errmsg_internal("failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
2868+
ItemPointerGetBlockNumber(&heapTuple->t_self),
2869+
offnum,
2870+
RelationGetRelationName(heapRelation))));
28682871

28692872
ItemPointerSetOffsetNumber(&rootTuple.t_self,
28702873
root_offsets[offnum-1]);
@@ -3327,10 +3330,12 @@ validate_index_heapscan(Relation heapRelation,
33273330
{
33283331
root_offnum=root_offsets[root_offnum-1];
33293332
if (!OffsetNumberIsValid(root_offnum))
3330-
elog(ERROR,"failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
3331-
ItemPointerGetBlockNumber(heapcursor),
3332-
ItemPointerGetOffsetNumber(heapcursor),
3333-
RelationGetRelationName(heapRelation));
3333+
ereport(ERROR,
3334+
(errcode(ERRCODE_DATA_CORRUPTED),
3335+
errmsg_internal("failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
3336+
ItemPointerGetBlockNumber(heapcursor),
3337+
ItemPointerGetOffsetNumber(heapcursor),
3338+
RelationGetRelationName(heapRelation))));
33343339
ItemPointerSetOffsetNumber(&rootTuple,root_offnum);
33353340
}
33363341

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp