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

Commit 3014fb9

Browse files
committed
Restore shardman.shardlord GUC in lord template.
1 parent d83c9e3 commit 3014fb9

File tree

2 files changed

+45
-16
lines changed

2 files changed

+45
-16
lines changed

bin/setup.sh.example

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
pgpath=~/postgres/install/vanilla/
22
pathmanpath=~/postgres/pg_pathman
33
install_pathman=false
4-
logfile=$HOME/tmp/tmp/tmp.log
4+
logfile=/tmp/shmn.log
55

6-
lord_datadir=~/postgres/data1
6+
lord_datadir=/tmp/data1
77
lord_port=5432
88

99
# declare -a worker_datadirs=()
@@ -18,23 +18,51 @@ lord_port=5432
1818
# declare -a worker_datadirs=("${HOME}/postgres/data2" "${HOME}/postgres/data3" "${HOME}/postgres/data4")
1919
# declare -a worker_ports=("5433" "5434" "5435")
2020

21-
declare -a worker_datadirs=("${HOME}/postgres/data2" "${HOME}/postgres/data3" "${HOME}/postgres/data4" "${HOME}/postgres/data5")
21+
declare -a worker_datadirs=("/tmp/data2" "/tmp/data3" "/tmp/data4" "/tmp/data5")
2222
declare -a worker_ports=("5433" "5434" "5435" "5436")
2323

2424
function run_demo()
2525
{
2626
:
27-
psql -p 5433 -c "drop table if exists pt cascade;"
28-
psql -p 5433 -c "CREATE TABLE pt(id INT NOT NULL, payload REAL);"
29-
psql -p 5433 -c "INSERT INTO pt SELECT generate_series(1, 10), random();"
30-
psql -c "select shardman.add_node('port=5433');"
31-
psql -c "select shardman.add_node('port=5434');"
32-
psql -c "select shardman.add_node('port=5435');"
33-
psql -c "select shardman.add_node('port=5436');"
34-
sleep 5
35-
psql -c "select shardman.create_hash_partitions(2, 'pt', 'id', 4, true);"
36-
37-
# psql -c "select shardman.create_replica('pt_0', 3);"
38-
# psql -c "select shardman.create_replica('pt_0', 5);"
39-
# psql -c "select shardman.move_part('pt_0', 4, 3);"
27+
28+
for port in "${worker_ports[@]}" $lord_port; do
29+
psql -p $port -c "set synchronous_commit to local; drop role if exists joe; create role joe login password '12345'; grant usage on FOREIGN DATA WRAPPER postgres_fdw to joe;"
30+
done
31+
32+
psql -c "drop table if exists t cascade;"
33+
psql -c "CREATE TABLE t(i int);"
34+
psql -c "drop table if exists t cascade;"
35+
psql -c "CREATE TABLE t(i int);"
36+
37+
38+
psql -c "drop table if exists pt cascade;"
39+
psql -c "CREATE TABLE pt(id INT primary key, payload REAL);"
40+
psql -c "INSERT INTO pt SELECT generate_series(1, 10), random();"
41+
42+
psql -c "select shardman.add_node('port=5433', conn_string => 'user=joe password=12345 dbname=ars port=5433');"
43+
psql -c "select shardman.add_node('port=5434', conn_string => 'user=joe password=12345 dbname=ars port=5434');"
44+
psql -c "select shardman.add_node('port=5435', conn_string => 'user=joe password=12345 dbname=ars port=5435');"
45+
psql -c "select shardman.add_node('port=5436', conn_string => 'user=joe password=12345 dbname=ars port=5436');"
46+
47+
psql -c "select shardman.create_hash_partitions('pt', 'id', 4);"
48+
psql -c "select shardman.set_redundancy('pt', 2);"
49+
50+
# psql -c "select shardman.create_hash_partitions(2, 'pt', 'id', 4, true);"
51+
# psql -c "select shardman.set_replevel('pt', 1);"
52+
53+
# psql -c "drop table if exists pgbench_accounts cascade";
54+
# psql -c "drop table if exists pgbench_tellers cascade";
55+
# psql -c "drop table if exists pgbench_branches cascade";
56+
# psql -c "drop table if exists pgbench_tellers cascade;"
57+
# psql -c "drop table if exists pgbench_accounts cascade;"
58+
# pgbench -s 5 -i
59+
# psql -c "select shardman.create_hash_partitions(2, 'pgbench_accounts', 'aid', 4);"
60+
# psql -c "select shardman.set_replevel('pgbench_accounts', 1);"
61+
# psql -c "select shardman.create_hash_partitions(2, 'pgbench_tellers', 'tid', 10);"
62+
# psql -c "select shardman.set_replevel('pgbench_tellers', 1);"
63+
# psql -c "select shardman.create_hash_partitions(2, 'pgbench_branches', 'bid', 10);"
64+
# psql -c "select shardman.set_replevel('pgbench_branches', 1);"
65+
# for port in "${worker_ports[@]}"; do
66+
# psql -p $port -f /home/ars/postgres/pg_shardman/bin/pgbench_history.sql
67+
# done
4068
}

postgresql.conf.lord

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
shardman.shardlord_connstring = 'port=5432' # shardlord's connstring
2+
shardman.shardlord = on
23
shardman.sync_replication = on

0 commit comments

Comments
 (0)