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

Commit6b533c6

Browse files
committed
moving tsdtm in core
1 parent4c55e00 commit6b533c6

File tree

10 files changed

+2097
-970
lines changed

10 files changed

+2097
-970
lines changed

‎contrib/pg_tsdtm/pg_tsdtm.c

Lines changed: 936 additions & 951 deletions
Large diffs are not rendered by default.

‎contrib/postgres_fdw/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DATA = postgres_fdw--1.0.sql
1212

1313
REGRESS = postgres_fdw
1414

15-
EXTRA_INSTALL += contrib/pg_tsdtm
15+
#EXTRA_INSTALL += contrib/pg_tsdtm
1616

1717
ifdefUSE_PGXS
1818
PG_CONFIG = pg_config

‎contrib/postgres_fdw/connection.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -450,13 +450,15 @@ begin_remote_xact(ConnCacheEntry *entry)
450450
elog(DEBUG3,"starting remote transaction on connection %p",
451451
entry->conn);
452452

453-
if (UseTsDtmTransactions&&TransactionIdIsValid(gxid))
454-
{
455-
charstmt[64];
456-
snprintf(stmt,sizeof(stmt),"select public.dtm_join_transaction(%d)",gxid);
457-
res=PQexec(entry->conn,stmt);
458-
PQclear(res);
459-
}
453+
// XXXX?
454+
//
455+
// if (UseTsDtmTransactions && TransactionIdIsValid(gxid))
456+
// {
457+
// charstmt[64];
458+
// snprintf(stmt, sizeof(stmt), "select public.dtm_join_transaction(%d)", gxid);
459+
// res = PQexec(entry->conn, stmt);
460+
// PQclear(res);
461+
// }
460462

461463
if (IsolationIsSerializable())
462464
sql="START TRANSACTION ISOLATION LEVEL SERIALIZABLE";
@@ -478,7 +480,7 @@ begin_remote_xact(ConnCacheEntry *entry)
478480
if (!currentGlobalTransactionId)
479481
{
480482
char*resp;
481-
res=PQexec(currentConnection,psprintf("SELECT public.dtm_extend('%d.%d')",
483+
res=PQexec(currentConnection,psprintf("SELECT public.pg_global_snaphot_create('%d.%d')",
482484
MyProcPid,++currentLocalTransactionId));
483485

484486
if (PQresultStatus(res)!=PGRES_TUPLES_OK)
@@ -492,7 +494,7 @@ begin_remote_xact(ConnCacheEntry *entry)
492494
}
493495
PQclear(res);
494496
}
495-
res=PQexec(entry->conn,psprintf("SELECT public.dtm_access(%llu, '%d.%d')",currentGlobalTransactionId,MyProcPid,currentLocalTransactionId));
497+
res=PQexec(entry->conn,psprintf("SELECT public.pg_global_snaphot_join(%llu, '%d.%d')",currentGlobalTransactionId,MyProcPid,currentLocalTransactionId));
496498

497499
if (PQresultStatus(res)!=PGRES_TUPLES_OK)
498500
{
@@ -817,11 +819,11 @@ pgfdw_xact_callback(XactEvent event, void *arg)
817819

818820
if (!RunDtmCommand(psprintf("PREPARE TRANSACTION '%d.%d'",
819821
MyProcPid,currentLocalTransactionId))||
820-
!RunDtmFunction(psprintf("SELECT public.dtm_begin_prepare('%d.%d')",
822+
!RunDtmFunction(psprintf("SELECT public.pg_global_snaphot_begin_prepare('%d.%d')",
821823
MyProcPid,currentLocalTransactionId))||
822-
!RunDtmStatement(psprintf("SELECT public.dtm_prepare('%d.%d',0)",
824+
!RunDtmStatement(psprintf("SELECT public.pg_global_snaphot_prepare('%d.%d',0)",
823825
MyProcPid,currentLocalTransactionId),PGRES_TUPLES_OK,DtmMaxCSN,&maxCSN)||
824-
!RunDtmFunction(psprintf("SELECT public.dtm_end_prepare('%d.%d',%lld)",
826+
!RunDtmFunction(psprintf("SELECT public.pg_global_snaphot_end_prepare('%d.%d',%lld)",
825827
MyProcPid,currentLocalTransactionId,maxCSN))||
826828
!RunDtmCommand(psprintf("COMMIT PREPARED '%d.%d'",
827829
MyProcPid,currentLocalTransactionId)))

‎contrib/postgres_fdw/t/001_bank_check.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
$master->psql('postgres',"CREATE FOREIGN TABLE accounts_fdw_$port() inherits (accounts) server shard_$port options(table_name 'accounts')");
5050
$master->psql('postgres',"CREATE USER MAPPING for stas SERVER shard_$port options (user 'stas')");
5151

52-
diag("done$host$port");
52+
#diag("done $host $port");
5353
}
5454

5555
$shard1->psql('postgres',"insert into accounts select 2*id-1, 0 from generate_series(1, 10010) as id;");
5656
$shard2->psql('postgres',"insert into accounts select 2*id, 0 from generate_series(1, 10010) as id;");
5757

58-
diag($master->connstr() );
58+
#diag( $master->connstr() );
5959
# sleep(3600);
6060

6161
###############################################################################
@@ -81,7 +81,7 @@
8181
$oldtotal =$total;
8282
diag("Isolation error. Total =$total");
8383
}
84-
diag("Total =$total");
84+
#diag("Total = $total");
8585
}
8686

8787
$master->pgbench_await($pgb_handle);

‎src/backend/access/transam/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include $(top_builddir)/src/Makefile.global
1515
OBJS = clog.o commit_ts.o generic_xlog.o multixact.o parallel.o rmgr.o slru.o\
1616
subtrans.o timeline.o transam.o twophase.o twophase_rmgr.o varsup.o\
1717
xact.o xlog.o xlogarchive.o xlogfuncs.o\
18-
xloginsert.o xlogreader.o xlogutils.o xtm.o
18+
xloginsert.o xlogreader.o xlogutils.o xtm.o global_snapshot.o
1919

2020
include$(top_srcdir)/src/backend/common.mk
2121

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp