Skip to content

Commit dff2f63

Browse files
committed
Enforce REPEATABLE READ since currently we export snap only once in xact
There is also no distribute predicate locking support, so SERIALIZABLE is not the way to go too.
1 parent d545692 commit dff2f63

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

contrib/postgres_fdw/connection.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,10 @@ begin_remote_xact(ConnCacheEntry *entry)
460460
elog(DEBUG3, "starting remote transaction on connection %p",
461461
entry->conn);
462462

463+
if (UseGlobalSnapshots && (!IsolationUsesXactSnapshot() ||
464+
IsolationIsSerializable()))
465+
elog(ERROR, "Global snapshots support only REPEATABLE READ");
466+
463467
if (IsolationIsSerializable())
464468
sql = "START TRANSACTION ISOLATION LEVEL SERIALIZABLE";
465469
else

contrib/postgres_fdw/t/001_bank_coordinator.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
log_checkpoints = true
1313
postgres_fdw.use_global_snapshots = on
1414
track_global_snapshots = on
15+
default_transaction_isolation = 'REPEATABLE READ'
1516
));
1617
$master->start;
1718

contrib/postgres_fdw/t/002_bank_participant.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
postgres_fdw.use_global_snapshots = on
1313
global_snapshot_defer_time = 15
1414
track_global_snapshots = on
15+
default_transaction_isolation = 'REPEATABLE READ'
1516
));
1617
$shard1->start;
1718

@@ -22,6 +23,7 @@
2223
postgres_fdw.use_global_snapshots = on
2324
global_snapshot_defer_time = 15
2425
track_global_snapshots = on
26+
default_transaction_isolation = 'REPEATABLE READ'
2527
));
2628
$shard2->start;
2729

0 commit comments

Comments
 (0)