mirror of
https://github.com/postgres/postgres.git
synced 2026-06-09 08:42:38 -04:00
Fix some minor issues in repack ereport()s
A few of them were missing errcode(), and a couple could use some wordsmithing. Author: Baji Shaik <baji.pgdev@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de> Discussion: https://postgr.es/m/CA+fm-ROdgh0rEVuXoViBk4TVgjodrN=MTR_RYuOuKLZ9voX4YA@mail.gmail.com
This commit is contained in:
parent
43649b6a53
commit
497e92dce9
2 changed files with 11 additions and 5 deletions
|
|
@ -2581,7 +2581,7 @@ apply_concurrent_changes(BufFile *file, ChangeContext *chgcxt)
|
|||
/* Find the tuple to be deleted */
|
||||
found = find_target_tuple(rel, chgcxt, spilled_tuple, ondisk_tuple);
|
||||
if (!found)
|
||||
elog(ERROR, "failed to find target tuple");
|
||||
elog(ERROR, "could not find target tuple");
|
||||
apply_concurrent_delete(rel, ondisk_tuple);
|
||||
}
|
||||
else if (kind == CHANGE_UPDATE_NEW)
|
||||
|
|
@ -2597,7 +2597,7 @@ apply_concurrent_changes(BufFile *file, ChangeContext *chgcxt)
|
|||
/* Find the tuple to be updated or deleted. */
|
||||
found = find_target_tuple(rel, chgcxt, key, ondisk_tuple);
|
||||
if (!found)
|
||||
elog(ERROR, "failed to find target tuple");
|
||||
elog(ERROR, "could not find target tuple");
|
||||
|
||||
/*
|
||||
* If 'tup' contains TOAST pointers, they point to the old
|
||||
|
|
@ -2674,7 +2674,9 @@ apply_concurrent_update(Relation rel, TupleTableSlot *spilled_tuple,
|
|||
&tmfd, &lockmode, &update_indexes);
|
||||
if (res != TM_Ok)
|
||||
ereport(ERROR,
|
||||
errmsg("failed to apply concurrent UPDATE"));
|
||||
errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
|
||||
errmsg("could not apply concurrent %s on relation \"%s\"",
|
||||
"UPDATE", RelationGetRelationName(rel)));
|
||||
|
||||
if (update_indexes != TU_None)
|
||||
{
|
||||
|
|
@ -2710,7 +2712,9 @@ apply_concurrent_delete(Relation rel, TupleTableSlot *slot)
|
|||
|
||||
if (res != TM_Ok)
|
||||
ereport(ERROR,
|
||||
errmsg("failed to apply concurrent DELETE"));
|
||||
errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
|
||||
errmsg("could not apply concurrent %s on relation \"%s\"",
|
||||
"DELETE", RelationGetRelationName(rel)));
|
||||
|
||||
pgstat_progress_incr_param(PROGRESS_REPACK_HEAP_TUPLES_DELETED, 1);
|
||||
}
|
||||
|
|
@ -3005,7 +3009,7 @@ initialize_change_context(ChangeContext *chgcxt,
|
|||
}
|
||||
}
|
||||
if (chgcxt->cc_ident_index == NULL)
|
||||
elog(ERROR, "failed to find identity index");
|
||||
elog(ERROR, "could not find identity index");
|
||||
|
||||
/* Set up for scanning said identity index */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -432,6 +432,7 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
|
|||
priv->end_of_wal = false;
|
||||
else
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_DATA_CORRUPTED),
|
||||
errmsg("could not read WAL record"));
|
||||
}
|
||||
|
||||
|
|
@ -479,6 +480,7 @@ decode_concurrent_changes(LogicalDecodingContext *ctx,
|
|||
if (res != WAIT_LSN_RESULT_SUCCESS &&
|
||||
res != WAIT_LSN_RESULT_TIMEOUT)
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INTERNAL_ERROR),
|
||||
errmsg("waiting for WAL failed"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue