Skip to content

Commit

Permalink
[#23257] YSQL: Change conflict error string for RC transactions
Browse files Browse the repository at this point in the history
Summary:
Currently DocDB throws the same error string to YSQL for the following 2
situations:
(1) Transaction conflicts with a higher priority transaction.
(2) Transaction conflicts with a transaction having the same priority.

The error string is "conflicts with higher priority transaction". This
diff separates the two cases and throws "conflicts with same priority
transaction" for case (2).
Jira: DB-12186

Test Plan: Jenkins

Reviewers: patnaik.balivada

Reviewed By: patnaik.balivada

Subscribers: bkolagani, ybase, yql

Differential Revision: https://phorge.dev.yugabyte.com/D36750
  • Loading branch information
pkj415 committed Aug 20, 2024
1 parent 28025f6 commit 9c0de5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/yb/docdb/conflict_resolution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,9 @@ class ConflictResolverContextBase : public ConflictResolverContext {
// 2. a kConflict is raised even if their_priority equals our_priority.
if (our_priority <= their_priority) {
return MakeConflictStatus(
our_transaction_id, transaction.id, "higher priority", GetTabletMetrics());
our_transaction_id, transaction.id,
our_priority == their_priority ? "same priority" : "higher priority",
GetTabletMetrics());
}
}
fetched_metadata_for_transactions_ = true;
Expand Down

0 comments on commit 9c0de5d

Please sign in to comment.