Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc863091

Browse files
committed
SSI comment fixes and enhancements. Notably, document that the conflict-out
flag actually means that the transaction has a conflict out to a transactionthat committed before the flagged transaction.Kevin Grittner
1 parent52caa35 commitc863091

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

‎src/backend/storage/lmgr/predicate.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@
245245
#defineSxactIsReadOnly(sxact) (((sxact)->flags & SXACT_FLAG_READ_ONLY) != 0)
246246
#defineSxactHasSummaryConflictIn(sxact) (((sxact)->flags & SXACT_FLAG_SUMMARY_CONFLICT_IN) != 0)
247247
#defineSxactHasSummaryConflictOut(sxact) (((sxact)->flags & SXACT_FLAG_SUMMARY_CONFLICT_OUT) != 0)
248+
/*
249+
* The following macro actually means that the specified transaction has a
250+
* conflict out *to a transaction which committed ahead of it*. It's hard
251+
* to get that into a name of a reasonable length.
252+
*/
248253
#defineSxactHasConflictOut(sxact) (((sxact)->flags & SXACT_FLAG_CONFLICT_OUT) != 0)
249254
#defineSxactIsDeferrableWaiting(sxact) (((sxact)->flags & SXACT_FLAG_DEFERRABLE_WAITING) != 0)
250255
#defineSxactIsROSafe(sxact) (((sxact)->flags & SXACT_FLAG_RO_SAFE) != 0)
@@ -2708,7 +2713,7 @@ SetNewSxactGlobalXmin(void)
27082713
* up in some relatively timely fashion.
27092714
*
27102715
* If this transaction is committing and is holding any predicate locks,
2711-
* it must be added to a list of completed serializabletransaction still
2716+
* it must be added to a list of completed serializabletransactions still
27122717
* holding locks.
27132718
*/
27142719
void
@@ -2753,12 +2758,13 @@ ReleasePredicateLocks(const bool isCommit)
27532758
LWLockAcquire(SerializableXactHashLock,LW_EXCLUSIVE);
27542759

27552760
/*
2756-
* We don't hold a lock here, assuming that TransactionId is atomic!
2761+
* We don't hold XidGenLock lock here, assuming that TransactionId is
2762+
* atomic!
27572763
*
27582764
* If this value is changing, we don't care that much whether we get the
27592765
* old or new value -- it is just used to determine how far
2760-
* GlobalSerizableXmin must advance before this transaction can becleaned
2761-
*fullycleaned up. The worst that could happen is we wait forome more
2766+
* GlobalSerizableXmin must advance before this transaction can befully
2767+
* cleaned up. The worst that could happen is we wait forone more
27622768
* transaction to complete before freeing some RAM; correctness of visible
27632769
* behavior is not affected.
27642770
*/
@@ -3860,8 +3866,8 @@ OnConflict_CheckForSerializationFailure(const SERIALIZABLEXACT *reader,
38603866
* Because T2 must've committed first, there is no anomaly if:
38613867
* - the reader committed before T2
38623868
* - the writer committed before T2
3863-
* - the reader is a READ ONLY transaction and the reader wasnot
3864-
* concurrentwith T2 (= reader acquired its snapshotafter T2 committed)
3869+
* - the reader is a READ ONLY transaction and the reader wasconcurrent
3870+
*with T2 (= reader acquired its snapshotbefore T2 committed)
38653871
*/
38663872
if (!failure)
38673873
{

‎src/include/storage/predicate_internals.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ typedef struct SERIALIZABLEXACT
9292

9393
#defineSXACT_FLAG_ROLLED_BACK0x00000001
9494
#defineSXACT_FLAG_COMMITTED0x00000002
95+
/*
96+
* The following flag actually means that the flagged transaction has a
97+
* conflict out *to a transaction which committed ahead of it*. It's hard
98+
* to get that into a name of a reasonable length.
99+
*/
95100
#defineSXACT_FLAG_CONFLICT_OUT0x00000004
96101
#defineSXACT_FLAG_READ_ONLY0x00000008
97102
#defineSXACT_FLAG_DID_WRITE0x00000010

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp