Skip to content

Commit 19cc584

Browse files
committed
tests
1 parent e0699fc commit 19cc584

File tree

12 files changed

+134
-39
lines changed

12 files changed

+134
-39
lines changed

contrib/pg_dtm/tests/deploy_layouts/cluster.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@
1010
pg_port: 15432
1111
deploy_postgres: true
1212
pg_dtm_enable: true
13+
pg_config_role:
14+
- line: "dtm.buffer_size = 65536"
1315
pg_dtm_host: "{{ groups['dtm'][0] }}"
1416

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
---
2-
- hosts: master-workers
2+
3+
- hosts: dtm
34
roles:
45
- role: postgrespro
56
deploy_dtm: true
67

7-
- hosts: master-workers:workers
8+
- hosts: masters
89
roles:
910
- role: postgrespro
11+
pg_src: ./postgrespro_pgshard
12+
pg_version: xtm_pgshard
1013
pg_port: 15432
1114
deploy_postgres: true
15+
pg_dtm_enable: true
16+
pg_dtm_host: "{{ groups['dtm'][0] }}"
1217
deploy_pg_shard: true
18+
19+
- hosts: workers
20+
roles:
21+
- role: postgrespro
22+
pg_src: ./postgrespro_pgshard
23+
pg_version: xtm_pgshard
24+
pg_port: 15432
25+
deploy_postgres: true
1326
pg_dtm_enable: true
14-
pg_dtm_host: "{{ groups['master-workers'][0] }}"
27+
pg_dtm_host: "{{ groups['dtm'][0] }}"
28+
29+
- hosts: clients
30+
roles:
31+
- role: postgrespro
1532

contrib/pg_dtm/tests/deploy_layouts/roles/postgrespro/tasks/dtm.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22

3-
- name: ensure we have checked out libuv-1.7.5
4-
git: repo=https://github.com/libuv/libuv.git
5-
dest={{libuv.src}}
6-
version={{libuv.version}}
7-
update=no
3+
# - name: ensure we have checked out libuv-1.7.5
4+
# git: repo=https://github.com/libuv/libuv.git
5+
# dest={{libuv.src}}
6+
# version={{libuv.version}}
7+
# update=no
88

9-
- name: build libuv
10-
shell: ./autogen.sh && ./configure --disable-shared --prefix={{libuv.dst}} && make && make install
11-
args:
12-
chdir: "{{libuv.src}}"
13-
creates: "{{libuv.dst}}/lib/libuv.a"
9+
# - name: build libuv
10+
# shell: ./autogen.sh && ./configure --disable-shared --prefix={{libuv.dst}} && make && make install
11+
# args:
12+
# chdir: "{{libuv.src}}"
13+
# creates: "{{libuv.dst}}/lib/libuv.a"
1414

1515
- name: compile dtmd
16-
shell: make "LIBUV_PREFIX={{libuv.dst}}"
16+
shell: "make clean && make"
1717
args:
1818
chdir: "{{pg_src}}/contrib/pg_dtm/dtmd"
1919
creates: "{{pg_src}}/contrib/pg_dtm/dtmd/bin/dtmd"

contrib/pg_dtm/tests/deploy_layouts/roles/postgrespro/tasks/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,3 @@
5656

5757
- include: dtm.yml
5858
when: deploy_dtm
59-
60-
- include: pg_shard.yml
61-
when: deploy_pg_shard
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,50 @@
11
- name: checkout pg_shard
2+
# git: repo=https://github.com/citusdata/pg_shard.git
23
git: repo=git@gitlab.postgrespro.ru:s.kelvich/pg_shard.git
34
dest=./pg_shard
45
version=transaction_manager_integration
56
force=yes
67
update=yes
7-
key_file=.ssh/banktest
8+
key_file=.ssh/ppg-deploy
89
accept_hostkey=yes
910
depth=1
1011
register: pg_shard_source
1112

1213
- name: build pg_shard extension
13-
shell: "PATH={{ppg.dst}}/bin:$PATH make clean && PATH={{ppg.dst}}/bin:$PATH make && PATH={{ppg.dst}}/bin:$PATH make install"
14+
shell: "PATH={{pg_dst}}/bin:$PATH make clean && PATH={{pg_dst}}/bin:$PATH make && PATH={{pg_dst}}/bin:$PATH make install"
1415
args:
1516
chdir: "~/pg_shard"
16-
creates: "{{ppg.dst}}/lib/pg_shard.so"
17+
creates: "{{pg_dst}}/lib/pg_shard.so"
1718

1819
- name: enable pg_shard extension in postgresql.conf with dtm
1920
lineinfile:
20-
dest: "{{ppg.datadir}}/postgresql.conf"
21+
dest: "{{pg_datadir}}/postgresql.conf"
2122
regexp: "{{item.regexp}}"
2223
line: "{{item.line}}"
2324
state: present
2425
with_items:
2526
- line: "shared_preload_libraries = 'pg_dtm, pg_shard'"
2627
regexp: "^shared_preload_libraries "
27-
when: ppg.usedtm
28+
- line: "pg_shard.all_modifications_commutative = 1"
29+
regexp: "^pg_shard.all_modifications_commutative "
30+
- line: "pg_shard.use_dtm_transactions = 1"
31+
regexp: "^pg_shard.use_dtm_transactions "
32+
when: pg_dtm_enable
2833

2934
- name: enable pg_shard extension in postgresql.conf without dtm
3035
lineinfile:
31-
dest: "{{ppg.datadir}}/postgresql.conf"
36+
dest: "{{pg_datadir}}/postgresql.conf"
3237
regexp: "{{item.regexp}}"
3338
line: "{{item.line}}"
3439
state: present
3540
with_items:
3641
- line: "shared_preload_libraries = 'pg_shard'"
3742
regexp: "^shared_preload_libraries "
38-
when: not ppg.usedtm
39-
43+
- line: "pg_shard.all_modifications_commutative = 1"
44+
regexp: "^pg_shard.all_modifications_commutative "
45+
when: not pg_dtm_enable
4046

47+
- name: create pg_worker_list.conf
48+
shell: echo "{{item}} 15432" >> {{pg_datadir}}/pg_worker_list.conf
49+
with_items: groups['workers']
4150

contrib/pg_dtm/tests/deploy_layouts/roles/postgrespro/tasks/postgres.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
state: present
3333
with_items: "{{pg_config}}"
3434

35+
- name: configure2 postgres on datanodes
36+
lineinfile:
37+
dest: "{{pg_datadir}}/postgresql.conf"
38+
line: "{{item.line}}"
39+
state: present
40+
with_items: "{{pg_config_role}}"
41+
3542
- name: enable dtm extension on datanodes
3643
lineinfile:
3744
dest: "{{pg_datadir}}/postgresql.conf"
@@ -56,7 +63,6 @@
5663
- name: start postgrespro
5764
command: "{{pg_dst}}/bin/pg_ctl start -w -D {{pg_datadir}} -l {{pg_datadir}}/pg.log"
5865

59-
60-
61-
66+
- name: create pg_dtm extension
67+
command: "{{pg_dst}}/bin/psql -p {{pg_port}} postgres -c 'create extension pg_dtm;'"
6268

contrib/pg_dtm/tests/deploy_layouts/roles/postgrespro/vars/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pg_config:
1818
- line: "listen_addresses = '*'"
1919
- line: "max_connections = 512"
2020
- line: "port = {{pg_port}}"
21+
pg_config_role:
22+
- line: "#pg_config_role"
2123
pg_src: ./postgrespro
2224
pg_dst: /tmp/postgrespro-build
2325
pg_datadir: ./postgrespro-data

contrib/pg_dtm/tests/farms/mephi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ blade8 ansible_ssh_host=85.143.113.31 ansible_ssh_port=4208
1212
[dtm]
1313
blade8 ansible_ssh_host=85.143.113.31 ansible_ssh_port=4208
1414

15-
15+
[master]
16+
blade7 ansible_ssh_host=85.143.113.31 ansible_ssh_port=4207

contrib/pg_dtm/tests/farms/sai

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
[clients]
2-
158.250.29.4 ansible_ssh_user=s.kelvich
32
158.250.29.5 ansible_ssh_user=s.kelvich
43

54
[workers]
6-
158.250.29.6 ansible_ssh_user=s.kelvich
5+
158.250.29.4 ansible_ssh_user=s.kelvich
76
158.250.29.8 ansible_ssh_user=s.kelvich
87
158.250.29.9 ansible_ssh_user=s.kelvich
8+
9+
[masters]
910
158.250.29.10 ansible_ssh_user=s.kelvich
1011

1112
[dtm]
12-
158.250.29.10 ansible_ssh_user=s.kelvich
13+
158.250.29.6 ansible_ssh_user=s.kelvich
14+
15+

contrib/pg_dtm/tests/transfers

6.31 MB
Binary file not shown.

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