|
20 | 20 | tags:
|
21 | 21 | - pgbench_history
|
22 | 22 |
|
| 23 | + - name: initialize pgbench everywhere to avoid count(*) failure, scale {{ scale }} |
| 24 | + command: > |
| 25 | + pgbench -p {{ pg_port }} -s {{ scale }} -i |
| 26 | + tags: |
| 27 | + - pgbench_init |
| 28 | + |
| 29 | + |
23 | 30 | - hosts: init_node
|
24 | 31 | vars:
|
25 | 32 | scale: 10
|
26 | 33 | nparts: 10
|
27 | 34 | repfactor: 0
|
28 | 35 | rebalance: true
|
| 36 | + tellers_branches: true |
29 | 37 | environment:
|
30 | 38 | PATH: "{{ pg_dst }}/bin:{{ ansible_env.PATH }}"
|
31 | 39 |
|
|
57 | 65 | tags:
|
58 | 66 | - pgbench_init
|
59 | 67 |
|
60 |
| - - name: create_hash_partitions, nparts {{ nparts }} |
| 68 | + - name: create_hash_partitions for pgbench_accounts, nparts {{ nparts }} |
61 | 69 | command: >
|
62 | 70 | psql -p {{ pg_port }} -c "
|
63 | 71 | select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_accounts', 'aid', {{ nparts }}, {{ rebalance }});
|
64 |
| - select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_tellers', 'tid', {{ nparts }}, {{ rebalance }}); |
65 |
| - select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_branches', 'bid', {{ nparts }}, {{ rebalance }}); |
| 72 | + select shardman.set_replevel('pgbench_accounts', {{ repfactor }}); |
66 | 73 | "
|
67 | 74 | tags:
|
68 |
| - - create_hash_partitions |
| 75 | + - create_hash_partitions_accounts |
69 | 76 |
|
70 |
| - - name: set_repfactor, repfactor {{ repfactor }} |
| 77 | + - name: create_hash_partitions for branches & tellers, nparts {{ nparts }} |
71 | 78 | command: >
|
72 | 79 | psql -p {{ pg_port }} -c "
|
73 |
| - select shardman.set_replevel('pgbench_accounts', {{ repfactor }}); |
| 80 | + select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_tellers', 'tid', {{ nparts }}, {{ rebalance }}); |
| 81 | + select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_branches', 'bid', {{ nparts }}, {{ rebalance }}); |
74 | 82 | select shardman.set_replevel('pgbench_tellers', {{ repfactor }});
|
75 | 83 | select shardman.set_replevel('pgbench_branches', {{ repfactor }});
|
76 | 84 | "
|
77 | 85 | tags:
|
78 |
| - - set_repfactor |
79 |
| - when: repfactor != 0 |
80 |
| - |
| 86 | + - create_hash_partitions_tellers_branches |
| 87 | + when: tellers_branches | bool |
81 | 88 |
|
82 | 89 | - hosts: shardlord
|
83 | 90 | environment:
|
|
0 commit comments