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

Commit 5b026af

Browse files
committed
Merge branch 'PGPROEE10_scheduler' into PGPROEE10
2 parents e836cb6 + b1e5626 commit 5b026af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3881
-352
lines changed

contrib/pgpro_scheduler/Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@ MODULE_big = pgpro_scheduler
22
OBJS = src/pgpro_scheduler.o src/cron_string.o src/sched_manager_poll.o \
33
src/char_array.o src/scheduler_spi_utils.o src/scheduler_manager.o \
44
src/bit_array.o src/scheduler_job.o src/memutils.o \
5-
src/scheduler_executor.o \
5+
src/scheduler_executor.o src/scheduler_mtm.o \
66
$(WIN32RES)
77
EXTENSION = pgpro_scheduler
88
DATA = pgpro_scheduler--2.0.sql pgpro_scheduler--2.0--2.1.sql \
9-
pgpro_scheduler--2.1.sql
9+
pgpro_scheduler--2.1.sql pgpro_scheduler--2.1--2.2.sql \
10+
pgpro_scheduler--2.2.sql
1011
REGRESS = install_pgpro_scheduler cron_string
1112
#REGRESS_OPTS = --user=postgres
1213
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
1314

15+
1416
ifdef USE_PGXS
1517
PG_CONFIG = pg_config
1618
PGXS := $(shell $(PG_CONFIG) --pgxs)
19+
ifdef WITH_MTM
20+
PG_CPPFLAGS = -D_WITH_MTM -I$(WITH_MTM) -I$(libpq_srcdir)
21+
endif
1722
include $(PGXS)
1823
else
1924
subdir = contrib/pgpro_scheduler
2025
top_builddir = ../..
2126
include $(top_builddir)/src/Makefile.global
27+
ifneq ($(MAJORVERSION),10)
28+
PG_CPPFLAGS = -D_WITH_MTM -I$(top_srcdir)/contrib/mmts -I$(libpq_srcdir)
29+
endif
2230
include $(top_srcdir)/contrib/contrib-global.mk
2331
endif
2432

contrib/pgpro_scheduler/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ Install extension as follows:
2828
$ sudo make USE_PGXS=1 install
2929
$ psql <DBNAME> -c "CREATE EXTENSION pgpro_scheduler"
3030

31+
Install extension to use it with multimaster(mmts) extension:
32+
33+
$ cd pgpro_scheduler
34+
$ make USE_PGXS=1 WITH_MTM=<path to mmts extension>
35+
$ sudo make USE_PGXS=1 install
36+
$ psql <DBNAME> -c "CREATE EXTENSION pgpro_scheduler"
37+
3138
## Configuration
3239

3340
The extension defines a number of PostgreSQL variables (GUC). This variables
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
CREATE TABLE mtm_nodes(
2+
node_id int primary key,
3+
node_name text,
4+
status_set timestamp with time zone
5+
);
6+
7+
CREATE TYPE scheduler_stat_rec AS(
8+
pid int,
9+
database text,
10+
type text
11+
);
12+
13+
14+
CREATE FUNCTION version()
15+
RETURNS text
16+
AS 'MODULE_PATHNAME', 'pgpro_scheduler_version'
17+
LANGUAGE C IMMUTABLE;
18+
19+
CREATE FUNCTION enable()
20+
RETURNS boolean
21+
AS 'MODULE_PATHNAME', 'scheduler_enable'
22+
LANGUAGE C IMMUTABLE;
23+
24+
CREATE FUNCTION disable()
25+
RETURNS boolean
26+
AS 'MODULE_PATHNAME', 'scheduler_disable'
27+
LANGUAGE C IMMUTABLE;
28+
29+
CREATE FUNCTION start()
30+
RETURNS boolean
31+
AS 'MODULE_PATHNAME', 'scheduler_start'
32+
LANGUAGE C IMMUTABLE;
33+
34+
CREATE FUNCTION stop()
35+
RETURNS boolean
36+
AS 'MODULE_PATHNAME', 'scheduler_stop'
37+
LANGUAGE C IMMUTABLE;
38+
39+
CREATE FUNCTION status()
40+
RETURNS SETOF scheduler_stat_rec
41+
AS 'MODULE_PATHNAME', 'scheduler_status'
42+
LANGUAGE C STABLE;
43+

0 commit comments

Comments
 (0)