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

Commitb1a82ba

Browse files
committed
pgindent
1 parent8e9d64c commitb1a82ba

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

‎contrib/pg_tsdtm/pg_tsdtm.c‎

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,24 @@ typedef struct DtmTransStatus
5151
TransactionIdxid;
5252
XidStatusstatus;
5353
intnSubxids;
54-
cid_tcid;/* CSN */
55-
structDtmTransStatus*next;/* pointer to next element in finished transaction list */
54+
cid_tcid;/* CSN */
55+
structDtmTransStatus*next;/* pointer to next element in finished
56+
* transaction list */
5657
}DtmTransStatus;
5758

5859
/* State of DTM node */
5960
typedefstruct
6061
{
61-
cid_tcid;/* last assigned CSN; used to provide unique ascending CSNs */
62-
TransactionIdoldest_xid;/* XID of oldest transaction visible by any active transaction (local or global) */
63-
longtime_shift;/* correction to system time */
64-
volatileslock_tlock;/* spinlock to protect access to hash table */
65-
DtmTransStatus*trans_list_head;/* L1 list of finished transactions present in xid2status hash table.
66-
This list is used to perform cleanup of too old transactions */
62+
cid_tcid;/* last assigned CSN; used to provide unique
63+
* ascending CSNs */
64+
TransactionIdoldest_xid;/* XID of oldest transaction visible by any
65+
* active transaction (local or global) */
66+
longtime_shift;/* correction to system time */
67+
volatileslock_tlock;/* spinlock to protect access to hash table */
68+
DtmTransStatus*trans_list_head;/* L1 list of finished transactions
69+
* present in xid2status hash table.
70+
* This list is used to perform
71+
* cleanup of too old transactions */
6772
DtmTransStatus**trans_list_tail;
6873
}DtmNodeState;
6974

@@ -181,6 +186,7 @@ static cid_t
181186
dtm_sync(cid_tglobal_cid)
182187
{
183188
cid_tlocal_cid;
189+
184190
while ((local_cid=dtm_get_cid())<global_cid)
185191
{
186192
local->time_shift+=global_cid-local_cid;
@@ -559,7 +565,7 @@ DtmXidInMVCCSnapshot(TransactionId xid, Snapshot snapshot)
559565
DTM_TRACE((stderr,"%d: wait for in-doubt transaction %u in snapshot %lu\n",getpid(),xid,dtm_tx.snapshot));
560566
SpinLockRelease(&local->lock);
561567

562-
dtm_sleep(delay);
568+
dtm_sleep(delay);
563569

564570
if (delay*2 <=MAX_WAIT_TIMEOUT)
565571
delay *=2;
@@ -776,8 +782,8 @@ DtmLocalEndPrepare(GlobalTransactionId gtid, cid_t cid)
776782
SpinLockRelease(&local->lock);
777783

778784
/*
779-
* Record commit in pg_committed_xact table to be make it possible to perform recovery in case of crash
780-
* of some of cluster nodes
785+
* Record commit in pg_committed_xact table to be make it possible to
786+
*perform recovery in caseofcrash ofsome of cluster nodes
781787
*/
782788
if (DtmRecordCommits)
783789
{
@@ -795,7 +801,7 @@ DtmLocalEndPrepare(GlobalTransactionId gtid, cid_t cid)
795801
}
796802
}
797803

798-
/*
804+
/*
799805
* Mark tranasction as prepared
800806
*/
801807
void
@@ -819,7 +825,7 @@ DtmLocalCommitPrepared(DtmCurrentTrans * x, GlobalTransactionId gtid)
819825
SpinLockRelease(&local->lock);
820826
}
821827

822-
/*
828+
/*
823829
* Set transaction status to committed
824830
*/
825831
void
@@ -863,7 +869,7 @@ DtmLocalCommit(DtmCurrentTrans * x)
863869
SpinLockRelease(&local->lock);
864870
}
865871

866-
/*
872+
/*
867873
* Mark tranasction as prepared
868874
*/
869875
void
@@ -887,7 +893,7 @@ DtmLocalAbortPrepared(DtmCurrentTrans * x, GlobalTransactionId gtid)
887893
SpinLockRelease(&local->lock);
888894
}
889895

890-
/*
896+
/*
891897
* Set transaction status to aborted
892898
*/
893899
void

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp