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

Commite52fdbb

Browse files
committed
Merge branch 'xtm' of gitlab.postgrespro.ru:pgpro-dev/postgrespro into xtm
2 parents6096224 +c85a14c commite52fdbb

16 files changed

+2889
-77
lines changed

‎contrib/multimaster/Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
MODULE_big = multimaster
2-
OBJS = multimaster.oreceiver_raw.o decoder_raw.olibdtm.o bytebuf.o bgwpool.o sockhub/sockhub.o
3-
2+
OBJS = multimaster.o libdtm.o bytebuf.o bgwpool.o sockhub/sockhub.o pglogical_output.o pglogical_proto.o pglogical_receiver.o pglogical_apply.o pglogical_hooks.o pglogical_config.o
3+
#OBJS = multimaster.o pglogical_receiver.o decoder_raw.o libdtm.o bytebuf.o bgwpool.o sockhub/sockhub.o
44
EXTENSION = multimaster
55
DATA = multimaster--1.0.sql
66

7-
PG_CPPFLAGS = -I$(libpq_srcdir)
7+
PG_CPPFLAGS = -I$(libpq_srcdir) -DUSE_PGLOGICAL_OUTPUT
88
SHLIB_LINK =$(libpq)
99

1010
ifdefUSE_PGXS

‎contrib/multimaster/Makefile.old‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MODULE_big = multimaster
2+
OBJS = multimaster.o pglogical_receiver.o decoder_raw.o libdtm.o bytebuf.o bgwpool.o sockhub/sockhub.o
3+
EXTENSION = multimaster
4+
DATA = multimaster--1.0.sql
5+
6+
PG_CPPFLAGS = -I$(libpq_srcdir)
7+
SHLIB_LINK = $(libpq)
8+
9+
ifdef USE_PGXS
10+
PG_CONFIG = pg_config
11+
PGXS := $(shell $(PG_CONFIG) --pgxs)
12+
include $(PGXS)
13+
else
14+
subdir = contrib/multimaster
15+
top_builddir = ../..
16+
include $(top_builddir)/src/Makefile.global
17+
include $(top_srcdir)/contrib/contrib-global.mk
18+
endif
19+

‎contrib/multimaster/multimaster.c‎

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include"access/xlog.h"
2929
#include"storage/proc.h"
3030
#include"storage/procarray.h"
31-
#include"executor/spi.h"
3231
#include"executor/executor.h"
3332
#include"access/twophase.h"
3433
#include"utils/guc.h"
@@ -104,7 +103,6 @@ static void DtmShmemStartup(void);
104103
staticvoidDtmBackgroundWorker(Datumarg);
105104

106105
staticvoidMMMarkTransAsLocal(TransactionIdxid);
107-
staticvoidMMExecutor(intid,void*work,size_tsize);
108106
staticBgwPool*MMPoolConstructor(void);
109107

110108
staticshmem_startup_hook_typeprev_shmem_startup_hook;
@@ -1185,48 +1183,7 @@ MMExecutorFinish(QueryDesc *queryDesc)
11851183
{
11861184
standard_ExecutorFinish(queryDesc);
11871185
}
1188-
}
1189-
1190-
staticvoidMMExecutor(intid,void*work,size_tsize)
1191-
{
1192-
TransactionIdxid=*(TransactionId*)work;
1193-
char*stmts= (char*)work+4;
1194-
boolfinished= false;
1195-
1196-
MMJoinTransaction(xid);
1197-
1198-
SetCurrentStatementStartTimestamp();
1199-
StartTransactionCommand();
1200-
SPI_connect();
1201-
PushActiveSnapshot(GetTransactionSnapshot());
1202-
1203-
PG_TRY();
1204-
{
1205-
intrc=SPI_execute(stmts, false,0);
1206-
SPI_finish();
1207-
PopActiveSnapshot();
1208-
finished= true;
1209-
if (rc!=SPI_OK_INSERT&&rc!=SPI_OK_UPDATE&&rc!=SPI_OK_DELETE) {
1210-
ereport(LOG, (errmsg("Executor %d: failed to apply transaction %u",
1211-
id,xid)));
1212-
AbortCurrentTransaction();
1213-
}else {
1214-
CommitTransactionCommand();
1215-
}
1216-
}
1217-
PG_CATCH();
1218-
{
1219-
FlushErrorState();
1220-
if (!finished) {
1221-
SPI_finish();
1222-
if (ActiveSnapshotSet()) {
1223-
PopActiveSnapshot();
1224-
}
1225-
}
1226-
AbortCurrentTransaction();
1227-
}
1228-
PG_END_TRY();
1229-
}
1186+
}
12301187

12311188
externvoidMMExecute(void*work,intsize)
12321189
{

‎contrib/multimaster/multimaster.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extern void MMJoinTransaction(TransactionId xid);
1313
externboolMMIsLocalTransaction(TransactionIdxid);
1414
externvoidMMReceiverStarted(void);
1515
externvoidMMExecute(void*work,intsize);
16+
externvoidMMExecutor(intid,void*work,size_tsize);
1617

1718
externchar*MMDatabaseName;
1819

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp