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

Commit5e1ed84

Browse files
committed
Restore rule for getting global snapshot
1 parent912aa01 commit5e1ed84

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

‎contrib/multimaster/multimaster.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ static TransactionId DtmNextXid;
123123
staticSnapshotDataDtmSnapshot= {HeapTupleSatisfiesMVCC };
124124
staticboolDtmHasGlobalSnapshot;
125125
staticintDtmLocalXidReserve;
126+
staticCommandIdDtmCurcid;
126127
staticSnapshotDtmLastSnapshot;
127128
staticTransactionManagerDtmTM= {
128129
DtmGetTransactionStatus,
@@ -630,11 +631,12 @@ static Snapshot DtmGetSnapshot(Snapshot snapshot)
630631
{
631632
if (TransactionIdIsValid(DtmNextXid)&&snapshot!=&CatalogSnapshotData)
632633
{
633-
if (!DtmHasGlobalSnapshot) {
634+
if (!DtmHasGlobalSnapshot&& (snapshot!=DtmLastSnapshot||DtmCurcid!=GetCurrentCommandId(false))) {
634635
DtmGlobalGetSnapshot(DtmNextXid,&DtmSnapshot,&dtm->minXid);
635636
}
636637
DtmLastSnapshot=snapshot;
637638
DtmMergeWithGlobalSnapshot(snapshot);
639+
DtmCurcid=snapshot->curcid;
638640
if (!IsolationUsesXactSnapshot())
639641
{
640642
/* Use single global snapshot during all transaction for repeatable read isolation level,

‎contrib/pg_dtm/pg_dtm.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static SnapshotData DtmSnapshot = { HeapTupleSatisfiesMVCC };
107107
staticboolDtmHasGlobalSnapshot;
108108
staticboolDtmGlobalXidAssigned;
109109
staticintDtmLocalXidReserve;
110+
staticCommandIdDtmCurcid;
110111
staticSnapshotDtmLastSnapshot;
111112
staticTransactionManagerDtmTM= {
112113
DtmGetTransactionStatus,
@@ -600,7 +601,6 @@ DtmGetNewTransactionId(bool isSubXact)
600601
returnxid;
601602
}
602603

603-
604604
staticSnapshotDtmGetSnapshot(Snapshotsnapshot)
605605
{
606606
if (DtmGlobalXidAssigned)
@@ -612,12 +612,13 @@ static Snapshot DtmGetSnapshot(Snapshot snapshot)
612612
returnPgGetSnapshotData(snapshot);
613613
}
614614
if (TransactionIdIsValid(DtmNextXid)&&snapshot!=&CatalogSnapshotData)
615-
{
616-
if (!DtmHasGlobalSnapshot) {
615+
{
616+
if (!DtmHasGlobalSnapshot&& (snapshot!=DtmLastSnapshot||DtmCurcid!=GetCurrentCommandId(false))) {
617617
DtmGlobalGetSnapshot(DtmNextXid,&DtmSnapshot,&dtm->minXid);
618618
}
619619
DtmLastSnapshot=snapshot;
620620
DtmMergeWithGlobalSnapshot(snapshot);
621+
DtmCurcid=snapshot->curcid;
621622
if (!IsolationUsesXactSnapshot())
622623
{
623624
/* Use single global snapshot during all transaction for repeatable read isolation level,

‎contrib/pg_dtm/tests/dtmbench.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct config
7070
nWriters =10;
7171
nIterations =1000;
7272
nAccounts =1000;
73-
isolationLevel ="read committed";
73+
isolationLevel ="repeatable read";//"read committed";
7474
}
7575
};
7676

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp