Skip to content

Commit 635fa25

Browse files
committed
Merge branch 'master' of https://github.com/postgrespro/pg_dtm
2 parents 651f187 + d980ac1 commit 635fa25

File tree

2 files changed

+62
-19
lines changed

2 files changed

+62
-19
lines changed

Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ OBJS = pg_dtm.o libdtm.o sockhub/sockhub.o
44
EXTENSION = pg_dtm
55
DATA = pg_dtm--1.0.sql
66

7-
ifndef USE_PGXS
7+
ifndef PG_CONFIG
88
PG_CONFIG = pg_config
9+
endif
10+
911
PGXS := $(shell $(PG_CONFIG) --pgxs)
1012
include $(PGXS)
11-
else
12-
subdir = contrib/pg_dtm
13-
top_builddir = ../..
14-
include $(top_builddir)/src/Makefile.global
15-
include $(top_srcdir)/contrib/contrib-global.mk
16-
endif

tests/deploy_layouts/cluster.yml

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,64 @@
11
---
2-
- hosts: nodes[1]
3-
roles:
4-
- role: postgrespro
5-
deploy_dtm: true
6-
72
- hosts: nodes
3+
84
roles:
9-
- role: postgrespro
5+
- role: postgres
106
pg_port: 15432
11-
deploy_postgres: true
12-
pg_dtm_enable: true
13-
pg_dtm_enable: false
14-
# pg_config_role:
15-
# - line: "dtm.buffer_size = 65536"
16-
pg_dtm_host: "{{ groups['nodes'][0] }}"
7+
pg_repo: https://github.com/kelvich/postgresql.git
8+
pg_version_tag: xtm_patched
9+
pg_destroy_and_init: true
10+
pg_config_role:
11+
- line: "dtm.buffer_size = 65536"
12+
13+
tasks:
14+
- name: clone dtm sources
15+
git: repo=https://github.com/postgrespro/pg_dtm.git
16+
dest={{pg_prefix}}/pg_dtm
17+
accept_hostkey=yes
18+
update=yes
19+
force=yes
20+
register: dtm_sources
21+
22+
- name: build dtm
23+
shell: "make clean && make -j {{makejobs}} install"
24+
args:
25+
chdir: "{{pg_prefix}}/pg_dtm"
26+
environment:
27+
PG_CONFIG: "{{pg_dst}}/bin/pg_config"
28+
# when: dtm_sources.changed
29+
30+
- name: enable dtm extension on datanodes
31+
lineinfile:
32+
dest: "{{pg_datadir}}/postgresql.conf"
33+
regexp: "^shared_preload_libraries"
34+
line: "shared_preload_libraries = 'pg_dtm'"
35+
state: present
36+
37+
- name: restart postgrespro
38+
command: "{{pg_dst}}/bin/pg_ctl restart -w -D {{pg_datadir}} -l {{pg_datadir}}/pg.log"
39+
environment:
40+
LD_LIBRARY_PATH: "{{pg_dst}}/lib/"
41+
42+
- hosts: nodes[0]
43+
tasks:
44+
- name: build dtmd
45+
shell: "make clean && make -j 4"
46+
args:
47+
chdir: "~/pg_cluster/pg_dtm/dtmd"
48+
environment:
49+
PG_CONFIG: "~/pg_cluster/install/bin/pg_config"
50+
51+
- name: kill dtmd
52+
shell: kill -9 `cat ~/pg_cluster/dtm_data/arbiter.pid` || true
53+
54+
- name: ensure datadir for dtm exists
55+
shell: "rm -rf ~/pg_cluster/dtm_data && mkdir ~/pg_cluster/dtm_data"
56+
57+
- name: start dtm
58+
shell: >
59+
nohup ~/pg_cluster/pg_dtm/dtmd/bin/dtmd
60+
-d ~/pg_cluster/dtm_data -a 0.0.0.0 -p 5431 > ~/pg_cluster/dtm_data/log &
61+
62+
- name: wait until dtm is available
63+
wait_for: port=5431 delay=1
1764

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