Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 432ef92

Browse files
knizhnikkelvich
authored andcommitted
PGPRO-680 # implement referee background worker
1 parent b99ad93 commit 432ef92

File tree

10 files changed

+448
-233
lines changed

10 files changed

+448
-233
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
EXTENSION = multimaster
33
DATA = multimaster--1.0.sql
4-
OBJS = multimaster.o arbiter.o bytebuf.o bgwpool.o pglogical_output.o pglogical_proto.o pglogical_receiver.o pglogical_apply.o pglogical_hooks.o pglogical_config.o pglogical_relid_map.o ddd.o bkb.o spill.o
4+
OBJS = multimaster.o arbiter.o bytebuf.o bgwpool.o pglogical_output.o pglogical_proto.o pglogical_receiver.o pglogical_apply.o pglogical_hooks.o pglogical_config.o pglogical_relid_map.o ddd.o bkb.o spill.o referee.o
55
MODULE_big = multimaster
66

77
PG_CPPFLAGS = -I$(libpq_srcdir)

arbitrator/arbitrator.cpp

-164
This file was deleted.

bkb.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ typedef ulong64 nodemask_t;
1414
#define BIT_CHECK(mask, bit) (((mask) & ((nodemask_t)1 << (bit))) != 0)
1515
#define BIT_CLEAR(mask, bit) (mask &= ~((nodemask_t)1 << (bit)))
1616
#define BIT_SET(mask, bit) (mask |= ((nodemask_t)1 << (bit)))
17+
#define ALL_BITS ((nodemask_t)~0)
1718

1819
extern nodemask_t MtmFindMaxClique(nodemask_t* matrix, int n_modes, int* clique_size);
1920

multimaster--1.0.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ AS 'MODULE_PATHNAME','mtm_get_nodes_state'
5151
LANGUAGE C;
5252

5353
CREATE TYPE mtm.cluster_state AS ("id" integer, "status" text, "disabledNodeMask" bigint, "disconnectedNodeMask" bigint, "catchUpNodeMask" bigint, "liveNodes" integer, "allNodes" integer, "nActiveQueries" integer, "nPendingQueries" integer, "queueSize" bigint, "transCount" bigint, "timeShift" bigint, "recoverySlot" integer,
54-
"xidHashSize" bigint, "gidHashSize" bigint, "oldestXid" bigint, "configChanges" integer, "stalledNodeMask" bigint, "stoppedNodeMask" bigint, "lastStatusChange" timestamp);
54+
"xidHashSize" bigint, "gidHashSize" bigint, "oldestXid" bigint, "configChanges" integer, "stalledNodeMask" bigint, "stoppedNodeMask" bigint, "deadNodeMask" bigint, "lastStatusChange" timestamp);
5555

5656
CREATE TYPE mtm.trans_state AS ("status" text, "gid" text, "xid" bigint, "coordinator" integer, "gxid" bigint, "csn" timestamp, "snapshot" timestamp, "local" boolean, "prepared" boolean, "active" boolean, "twophase" boolean, "votingCompleted" boolean, "participants" bigint, "voted" bigint, "configChanges" integer);
5757

@@ -99,8 +99,8 @@ CREATE FUNCTION mtm.check_deadlock(xid bigint) RETURNS boolean
9999
AS 'MODULE_PATHNAME','mtm_check_deadlock'
100100
LANGUAGE C;
101101

102-
CREATE FUNCTION mtm.arbitraror_poll_status(xid bigint) RETURNS bigint
103-
AS 'MODULE_PATHNAME','mtm_arbitrator_poll'
102+
CREATE FUNCTION mtm.referee_poll(xid bigint) RETURNS bigint
103+
AS 'MODULE_PATHNAME','mtm_referee_poll'
104104
LANGUAGE C;
105105

106106
CREATE TABLE IF NOT EXISTS mtm.local_tables(rel_schema text, rel_name text, primary key(rel_schema, rel_name));

0 commit comments

Comments
 (0)