Skip to content

Commit 238617f

Browse files
committed
datadirs on tmpfs; forced pg kill; accyracy with libpqxx
1 parent 2e74d35 commit 238617f

File tree

2 files changed

+14
-27
lines changed

2 files changed

+14
-27
lines changed

contrib/multimaster/tests/deploy_layouts/cluster.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
pg_port: 15432
88
pg_repo: https://github.com/postgrespro/postgres_cluster.git
99
pg_destroy_and_init: true
10+
pg_datadir: "/mnt/pgtmpfs/data_{{pg_port}}"
1011
pg_config_role:
1112
- line: "multimaster.buffer_size = 65536"
1213

@@ -95,24 +96,27 @@
9596

9697
- name: clone pqxx
9798
git: repo=https://github.com/Ambrosys/pqxx.git
98-
dest=~/pqxx
99+
dest=~/pg_cluster/pqxx
99100
accept_hostkey=yes
100101
update=no
101102
force=yes
102103
register: pqxx
103104

105+
# - name: ensure dirs
106+
# shell: "mkdir -p /home/{{ansible_ssh_user}}/pg_cluster/install/lib/"
107+
104108
- name: build pqxx
105-
shell: "./configure --prefix=/home/{{ansible_ssh_user}}/pg_cluster/install/ --enable-shared && make && make install"
109+
shell: "./configure --prefix=/home/{{ansible_ssh_user}}/pg_cluster/install/ --enable-shared && make -j 6 && make install"
106110
args:
107-
chdir: "~/pqxx"
111+
chdir: "~/pg_cluster/pqxx"
108112
environment:
109113
PATH: "/home/{{ansible_ssh_user}}/pg_cluster/install/bin/:{{ansible_env.PATH}}"
110114
when: pqxx.changed
111115

112116
- name: compile dtmbench
113117
shell: "g++ -g -Wall -O2 -o dtmbench dtmbench.cpp -lpqxx -lpq -pthread -L/home/{{ansible_ssh_user}}/pg_cluster/install/lib/ -I/home/{{ansible_ssh_user}}/pg_cluster/install/include/"
114118

115-
- name: compile dtmbench
119+
- name: install dtmbench
116120
shell: "mv dtmbench ~/pg_cluster/install/bin/dtmbench"
117121

118122

contrib/multimaster/tests/deploy_layouts/roles/postgres/tasks/main.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242

4343
#############################################################################
4444

45+
- name: stop postgres if it was running
46+
shell: "pkill -9 postgres || true"
47+
4548
- name: clone postgres sources
4649
git: repo={{pg_repo}}
4750
dest={{pg_src}}
@@ -65,33 +68,13 @@
6568

6669
#############################################################################
6770

68-
- name: copy pg source
69-
copy: src=./{{item}} dest=~/{{item}} mode=0755
70-
with_items:
71-
- "pg_cluster_install.tgz"
72-
when: pg_copydist is defined
73-
74-
- name: extract postgres
75-
command: "tar xzf pg_cluster_install.tgz"
76-
when: pg_copydist is defined
77-
78-
#############################################################################
79-
80-
- stat: path={{pg_datadir}}/postmaster.pid
81-
register: pg_pidfile
71+
# - stat: path={{pg_datadir}}/postmaster.pid
72+
# register: pg_pidfile
8273

8374
# - name: stop postgres if it was running
84-
# command: "{{pg_dst}}/bin/pg_ctl stop -w -D {{pg_datadir}}"
85-
# environment:
86-
# LD_LIBRARY_PATH: "{{pg_dst}}/lib"
75+
# shell: "kill -9 `head -n 1 {{pg_datadir}}/postmaster.pid` || true"
8776
# when: pg_pidfile.stat.exists
8877

89-
- name: stop postgres if it was running
90-
shell: "kill -9 `head -n 1 {{pg_datadir}}/postmaster.pid` || true"
91-
environment:
92-
LD_LIBRARY_PATH: "{{pg_dst}}/lib"
93-
when: pg_pidfile.stat.exists
94-
9578
- name: remove datadirs on datanodes
9679
command: "rm -rf {{pg_datadir}}"
9780
when: pg_destroy_and_init

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