Skip to content

Commit e73c9b6

Browse files
committed
Global snapshots in postgres_fdw cosmetic improvements.
* s/snaphot/snapshot adapted. * GUC renamed from postgres_fdw.use_tsdtm to postgres_fdw.use_global_snapshots. * Set track_global_snapshots = true in tests everywhere. * Makefile niceties. * 003_bank_shared.pl test is removed. In current shape it is useless, and if we bombard both nodes, deadlock surely appears. In general, global snaphots are not needed for such multimaster-like setup -- either there are no conflicts and we are fine, or there is a conflict, in which case we get a deadlock.
1 parent f9dd1c3 commit e73c9b6

File tree

6 files changed

+15
-166
lines changed

6 files changed

+15
-166
lines changed

contrib/postgres_fdw/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ include $(top_builddir)/src/Makefile.global
2424
include $(top_srcdir)/contrib/contrib-global.mk
2525
endif
2626

27+
# Global makefile will do temp-install for 'check'. Since REGRESS is defined,
28+
# PGXS (included from contrib-global.mk or directly) will care to add
29+
# postgres_fdw to it as EXTRA_INSTALL and build pg_regress. It will also
30+
# actually run pg_regress, so the only thing left is tap tests.
2731
check: tapcheck
2832

29-
tapcheck:
30-
env DESTDIR='$(abs_top_builddir)'/tmp_install $(MAKE) install
33+
tapcheck: temp-install
3134
$(prove_check)

contrib/postgres_fdw/connection.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ begin_remote_xact(ConnCacheEntry *entry)
478478
fdwTransState->global_csn = ExportGlobalSnapshot();
479479

480480
snprintf(import_sql, sizeof(import_sql),
481-
"SELECT pg_global_snaphot_import("UINT64_FORMAT")",
481+
"SELECT pg_global_snapshot_import("UINT64_FORMAT")",
482482
fdwTransState->global_csn);
483483

484484
do_sql_command(entry->conn, import_sql);
@@ -832,11 +832,11 @@ pgfdw_xact_callback(XactEvent event, void *arg)
832832
if (!res)
833833
goto error;
834834

835-
/* Broadcast pg_global_snaphot_prepare() */
835+
/* Broadcast pg_global_snapshot_prepare() */
836836
if (include_local_tx)
837837
my_csn = GlobalSnapshotPrepareCurrent();
838838

839-
sql = psprintf("SELECT pg_global_snaphot_prepare('%s')",
839+
sql = psprintf("SELECT pg_global_snapshot_prepare('%s')",
840840
fdwTransState->gid);
841841
res = BroadcastStmt(sql, PGRES_TUPLES_OK, MaxCsnCB, &max_csn);
842842
if (!res)
@@ -846,10 +846,10 @@ pgfdw_xact_callback(XactEvent event, void *arg)
846846
if (include_local_tx && my_csn > max_csn)
847847
max_csn = my_csn;
848848

849-
/* Broadcast pg_global_snaphot_assign() */
849+
/* Broadcast pg_global_snapshot_assign() */
850850
if (include_local_tx)
851851
GlobalSnapshotAssignCsnCurrent(max_csn);
852-
sql = psprintf("SELECT pg_global_snaphot_assign('%s',"UINT64_FORMAT")",
852+
sql = psprintf("SELECT pg_global_snapshot_assign('%s',"UINT64_FORMAT")",
853853
fdwTransState->gid, max_csn);
854854
res = BroadcastFunc(sql);
855855

contrib/postgres_fdw/postgres_fdw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5802,7 +5802,7 @@ find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel)
58025802
void
58035803
_PG_init(void)
58045804
{
5805-
DefineCustomBoolVariable("postgres_fdw.use_tsdtm",
5805+
DefineCustomBoolVariable("postgres_fdw.use_global_snapshots",
58065806
"Use global snapshots for FDW transactions", NULL,
58075807
&UseGlobalSnapshots, false, PGC_USERSET, 0, NULL,
58085808
NULL, NULL);

contrib/postgres_fdw/t/001_bank_coordinator.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
$master->append_conf('postgresql.conf', qq(
1111
max_prepared_transactions = 30
1212
log_checkpoints = true
13-
postgres_fdw.use_tsdtm = on
13+
postgres_fdw.use_global_snapshots = on
14+
track_global_snapshots = on
1415
));
1516
$master->start;
1617

contrib/postgres_fdw/t/002_bank_participant.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$shard1->init;
1010
$shard1->append_conf('postgresql.conf', qq(
1111
max_prepared_transactions = 30
12-
postgres_fdw.use_tsdtm = on
12+
postgres_fdw.use_global_snapshots = on
1313
global_snapshot_defer_time = 15
1414
track_global_snapshots = on
1515
));
@@ -19,7 +19,7 @@
1919
$shard2->init;
2020
$shard2->append_conf('postgresql.conf', qq(
2121
max_prepared_transactions = 30
22-
postgres_fdw.use_tsdtm = on
22+
postgres_fdw.use_global_snapshots = on
2323
global_snapshot_defer_time = 15
2424
track_global_snapshots = on
2525
));

contrib/postgres_fdw/t/003_bank_shared.pl

Lines changed: 0 additions & 155 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy