1
1
#! /bin/sh
2
2
3
- PG_SHARD_DIR=~ /code/pg_shard
3
+ PG_SHARD_DIR=~ /code/pg_shard_master
4
4
PG_DIR=~ /code/postgresql
5
5
PG_XTM_DIR=$PG_DIR /contrib/pg_xtm
6
6
@@ -42,24 +42,23 @@ cd $PG_DIR
42
42
./install/bin/initdb -D ./install/data2
43
43
./install/bin/initdb -D ./install/data3
44
44
45
-
46
- sed -i ' ' ' s/#port =.*/port = 5433/' ./install/data2/postgresql.conf
47
- sed -i ' ' ' s/#port =.*/port = 5434/' ./install/data3/postgresql.conf
48
-
49
45
sed -i ' ' " s/shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm,pg_shard'/" ./install/data1/postgresql.conf
50
- sed -i ' ' " s/shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm,pg_shard '/" ./install/data2/postgresql.conf
51
- sed -i ' ' " s/shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm,pg_shard '/" ./install/data3/postgresql.conf
46
+ sed -i ' ' " s/shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm'/" ./install/data2/postgresql.conf
47
+ sed -i ' ' " s/shared_preload_libraries =.*/shared_preload_libraries = 'pg_dtm'/" ./install/data3/postgresql.conf
52
48
53
- sed -i ' ' ' s/#fsync =.*/fsync = off/' ./install/data1/postgresql.conf
54
- sed -i ' ' ' s/#fsync =.*/fsync = off/' ./install/data2/postgresql.conf
55
- sed -i ' ' ' s/#fsync =.*/fsync = off/' ./install/data3/postgresql.conf
49
+ echo " port = 5433" >> ./install/data2/postgresql.conf
50
+ echo " port = 5434" >> ./install/data3/postgresql.conf
56
51
52
+ echo ' fsync = off' >> ./install/data1/postgresql.conf
53
+ echo ' fsync = off' >> ./install/data2/postgresql.conf
54
+ echo ' fsync = off' >> ./install/data3/postgresql.conf
57
55
58
56
echo ' pg_shard.use_dtm_transactions=1' >> ./install/data1/postgresql.conf
59
- echo ' pg_shard.use_dtm_transactions=1' >> ./install/data2/postgresql.conf
60
- echo ' pg_shard.use_dtm_transactions=1' >> ./install/data3/postgresql.conf
61
-
57
+ echo ' pg_shard.all_modifications_commutative=1' >> ./install/data1/postgresql.conf
62
58
59
+ echo " log_statement = 'all'" >> ./install/data1/postgresql.conf
60
+ echo " log_statement = 'all'" >> ./install/data2/postgresql.conf
61
+ echo " log_statement = 'all'" >> ./install/data3/postgresql.conf
63
62
64
63
./install/bin/pg_ctl -D ./install/data1 -l ./install/data1/log start
65
64
./install/bin/pg_ctl -D ./install/data2 -l ./install/data2/log start
@@ -85,46 +84,14 @@ echo "127.0.0.1 5434" >> ./install/data3/pg_worker_list.conf
85
84
./install/bin/createdb ` whoami` -p5434
86
85
87
86
88
- ./install/bin/psql -p 5433 << SQL
87
+ ./install/bin/psql -p 5432 << SQL
89
88
CREATE EXTENSION pg_dtm;
90
89
SQL
91
90
92
- ./install/bin/psql -p 5434 << SQL
91
+ ./install/bin/psql -p 5433 << SQL
93
92
CREATE EXTENSION pg_dtm;
94
93
SQL
95
94
96
- ./install/bin/psql << SQL
97
-
95
+ ./install/bin/psql -p 5434 << SQL
98
96
CREATE EXTENSION pg_dtm;
99
- CREATE EXTENSION pg_shard;
100
- CREATE TABLE t(u int, v int);
101
- SELECT master_create_distributed_table(table_name := 't', partition_column := 'u');
102
- SELECT master_create_worker_shards(table_name := 't', shard_count := 8, replication_factor := 1);
103
- insert into t values(1,10000);
104
- insert into t values(2,10000);
105
- insert into t values(3,10000);
106
- insert into t values(4,10000);
107
- insert into t values(5,10000);
108
- insert into t values(6,10000);
109
- insert into t values(7,10000);
110
- insert into t values(8,10000);
111
-
112
97
SQL
113
-
114
-
115
-
116
-
117
- # insert into t (select generate_series(0,10), random()::integer);
118
-
119
- # cd contrib/pg_xtm/dtmd
120
- # make clean
121
- # make
122
- # rm -rf /tmp/clog/*
123
- # ./bin/dtmd
124
-
125
-
126
-
127
-
128
-
129
-
130
-
0 commit comments