summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Grittner2010-12-05 20:55:46 +0000
committerKevin Grittner2010-12-05 20:55:46 +0000
commit5fbc0280ea6a31635111133c11f0b76985dd646b (patch)
tree537f1de0383b5b54322a9f189e8ede9f737085ba
parent0e1e86830b49dab51ff80619a580527260f4e186 (diff)
Prevent early rollback of two-transaction write skew.idle
-rw-r--r--src/backend/storage/lmgr/predicate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index 96f6c23a0f..5fec4b60f0 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -2689,7 +2689,7 @@ OnConflict_CheckForSerializationFailure(const SERIALIZABLEXACT *reader,
offsetof(RWConflictData, outLink));
while (conflict)
{
- if (reader == conflict->sxactIn
+ if ((reader == conflict->sxactIn && SxactIsCommitted(reader))
|| (SxactIsCommitted(conflict->sxactIn)
&& !SxactIsCommitted(reader)
&& (!SxactIsReadOnly(reader)
@@ -2783,9 +2783,10 @@ PreCommit_CheckForSerializationFailure(void)
offsetof(RWConflictData, inLink));
while (farConflict)
{
- if (!SxactIsCommitted(farConflict->sxactOut)
- && !SxactIsReadOnly(farConflict->sxactOut)
- && !SxactIsRolledBack(farConflict->sxactOut))
+ if (farConflict->sxactOut == MySerializableXact
+ || (!SxactIsCommitted(farConflict->sxactOut)
+ && !SxactIsReadOnly(farConflict->sxactOut)
+ && !SxactIsRolledBack(farConflict->sxactOut)))
{
nearConflict->sxactOut->flags |= SXACT_FLAG_INTERRUPT;
CancelVirtualTransaction(nearConflict->sxactOut->tag.vxid, 0);