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

Commit8e25be4

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 parent0ddaaa4 commit8e25be4

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
@@ -2573,9 +2573,12 @@ IndexBuildHeapRangeScan(Relation heapRelation,
25732573
offnum=ItemPointerGetOffsetNumber(&heapTuple->t_self);
25742574

25752575
if (!OffsetNumberIsValid(root_offsets[offnum-1]))
2576-
elog(ERROR,"failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
2577-
ItemPointerGetBlockNumber(&heapTuple->t_self),
2578-
offnum,RelationGetRelationName(heapRelation));
2576+
ereport(ERROR,
2577+
(errcode(ERRCODE_DATA_CORRUPTED),
2578+
errmsg_internal("failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
2579+
ItemPointerGetBlockNumber(&heapTuple->t_self),
2580+
offnum,
2581+
RelationGetRelationName(heapRelation))));
25792582

25802583
ItemPointerSetOffsetNumber(&rootTuple.t_self,
25812584
root_offsets[offnum-1]);
@@ -3042,10 +3045,12 @@ validate_index_heapscan(Relation heapRelation,
30423045
{
30433046
root_offnum=root_offsets[root_offnum-1];
30443047
if (!OffsetNumberIsValid(root_offnum))
3045-
elog(ERROR,"failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
3046-
ItemPointerGetBlockNumber(heapcursor),
3047-
ItemPointerGetOffsetNumber(heapcursor),
3048-
RelationGetRelationName(heapRelation));
3048+
ereport(ERROR,
3049+
(errcode(ERRCODE_DATA_CORRUPTED),
3050+
errmsg_internal("failed to find parent tuple for heap-only tuple at (%u,%u) in table \"%s\"",
3051+
ItemPointerGetBlockNumber(heapcursor),
3052+
ItemPointerGetOffsetNumber(heapcursor),
3053+
RelationGetRelationName(heapRelation))));
30493054
ItemPointerSetOffsetNumber(&rootTuple,root_offnum);
30503055
}
30513056

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp