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

Commite1bacb7

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 notthe way to go too.
1 parent221220a commite1bacb7

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

‎contrib/postgres_fdw/connection.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,15 @@ begin_remote_xact(ConnCacheEntry *entry)
501501
elog(DEBUG3,"starting remote transaction on connection %p",
502502
entry->conn);
503503

504+
if (UseGlobalSnapshots&& (!IsolationUsesXactSnapshot()||
505+
IsolationIsSerializable()))
506+
elog(ERROR,"Global snapshots support only REPEATABLE READ");
507+
504508
sprintf(sql,"START TRANSACTION %s; set application_name='pgfdw:%lld:%d';",
505509
IsolationIsSerializable() ?"ISOLATION LEVEL SERIALIZABLE" :
506510
UseRepeatableRead ?"ISOLATION LEVEL REPEATABLE READ" :"",
507511
(long long)GetSystemIdentifier(),MyProcPid);
512+
508513
entry->changing_xact_state= true;
509514
do_sql_command(entry,sql);
510515
entry->xact_depth=1;

‎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)

[8]ページ先頭

©2009-2025 Movatter.jp