Skip to content

Commit

Permalink
Return serialization failure error code on validation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ctring committed Jan 22, 2024
1 parent e5e0358 commit a3b8e6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pgxn/remotexact/validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void validate_index_scan(RWSetRelation *rw_rel)

if (page_lsn > read_csn) {
ereport(ERROR,
(errcode(ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN),
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("[remotexact] read out-of-date index (relid: %u, blockno: %u, csn: %X/%X, readcsn: %X/%X)",
relid,
rw_rel->pages[i].blkno,
Expand Down Expand Up @@ -189,7 +189,7 @@ validate_table_scan(RWSetRelation *rw_rel)
if (TransactionIdIsValid(checked_xid) &&
tuple_csn > read_csn)
ereport(ERROR,
(errcode(ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN),
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("[remotexact] read out-of-date table (relid: %u, blockno: %u, offset: %u, csn: %X/%X, readcsn: %X/%X)",
relid,
ItemPointerGetBlockNumber(&htup->t_self),
Expand Down Expand Up @@ -258,7 +258,7 @@ validate_tuple_scan(RWSetRelation *rw_rel)

if (!valid) {
ereport(ERROR,
(errcode(ERRCODE_T_R_STATEMENT_COMPLETION_UNKNOWN),
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
errmsg("[remotexact] read out-of-date tuple (relid: %u, blockno: %u, offset: %u, csn: %X/%X, readcsn: %X/%X)",
relid,
ItemPointerGetBlockNumber(&rw_rel->tuples[i].tid),
Expand Down

0 comments on commit a3b8e6b

Please sign in to comment.