1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Rename the conflict types for the origin differ cases.

The conflict types 'update_differ' and 'delete_differ' indicate that a row
to be modified was previously altered by another origin. Rename those to
'update_origin_differs' and 'delete_origin_differs' to clarify their
meaning.

Author: Hou Zhijie
Reviewed-by: Shveta Malik, Peter Smith
Discussion: https://postgr.es/m/CAA4eK1+HEKwG_UYt4Zvwh5o_HoCKCjEGesRjJX38xAH3OxuuYA@mail.gmail.com
This commit is contained in:
Amit Kapila
2024-08-29 09:12:12 +05:30
parent 9d90e2bdaf
commit 640178c92e
6 changed files with 17 additions and 17 deletions

View File

@ -24,10 +24,10 @@
static const char *const ConflictTypeNames[] = {
[CT_INSERT_EXISTS] = "insert_exists",
[CT_UPDATE_DIFFER] = "update_differ",
[CT_UPDATE_ORIGIN_DIFFERS] = "update_origin_differs",
[CT_UPDATE_EXISTS] = "update_exists",
[CT_UPDATE_MISSING] = "update_missing",
[CT_DELETE_DIFFER] = "delete_differ",
[CT_DELETE_ORIGIN_DIFFERS] = "delete_origin_differs",
[CT_DELETE_MISSING] = "delete_missing"
};
@ -167,9 +167,9 @@ errcode_apply_conflict(ConflictType type)
case CT_INSERT_EXISTS:
case CT_UPDATE_EXISTS:
return errcode(ERRCODE_UNIQUE_VIOLATION);
case CT_UPDATE_DIFFER:
case CT_UPDATE_ORIGIN_DIFFERS:
case CT_UPDATE_MISSING:
case CT_DELETE_DIFFER:
case CT_DELETE_ORIGIN_DIFFERS:
case CT_DELETE_MISSING:
return errcode(ERRCODE_T_R_SERIALIZATION_FAILURE);
}
@ -237,7 +237,7 @@ errdetail_apply_conflict(EState *estate, ResultRelInfo *relinfo,
break;
case CT_UPDATE_DIFFER:
case CT_UPDATE_ORIGIN_DIFFERS:
if (localorigin == InvalidRepOriginId)
appendStringInfo(&err_detail, _("Updating the row that was modified locally in transaction %u at %s."),
localxmin, timestamptz_to_str(localts));
@ -256,7 +256,7 @@ errdetail_apply_conflict(EState *estate, ResultRelInfo *relinfo,
appendStringInfo(&err_detail, _("Could not find the row to be updated."));
break;
case CT_DELETE_DIFFER:
case CT_DELETE_ORIGIN_DIFFERS:
if (localorigin == InvalidRepOriginId)
appendStringInfo(&err_detail, _("Deleting the row that was modified locally in transaction %u at %s."),
localxmin, timestamptz_to_str(localts));

View File

@ -2702,7 +2702,7 @@ apply_handle_update_internal(ApplyExecutionData *edata,
newslot = table_slot_create(localrel, &estate->es_tupleTable);
slot_store_data(newslot, relmapentry, newtup);
ReportApplyConflict(estate, relinfo, LOG, CT_UPDATE_DIFFER,
ReportApplyConflict(estate, relinfo, LOG, CT_UPDATE_ORIGIN_DIFFERS,
remoteslot, localslot, newslot,
InvalidOid, localxmin, localorigin, localts);
}
@ -2868,7 +2868,7 @@ apply_handle_delete_internal(ApplyExecutionData *edata,
*/
if (GetTupleTransactionInfo(localslot, &localxmin, &localorigin, &localts) &&
localorigin != replorigin_session_origin)
ReportApplyConflict(estate, relinfo, LOG, CT_DELETE_DIFFER,
ReportApplyConflict(estate, relinfo, LOG, CT_DELETE_ORIGIN_DIFFERS,
remoteslot, localslot, NULL,
InvalidOid, localxmin, localorigin, localts);
@ -3097,7 +3097,7 @@ apply_handle_tuple_routing(ApplyExecutionData *edata,
newslot = table_slot_create(partrel, &estate->es_tupleTable);
slot_store_data(newslot, part_entry, newtup);
ReportApplyConflict(estate, partrelinfo, LOG, CT_UPDATE_DIFFER,
ReportApplyConflict(estate, partrelinfo, LOG, CT_UPDATE_ORIGIN_DIFFERS,
remoteslot_part, localslot, newslot,
InvalidOid, localxmin, localorigin,
localts);