Skip to content

Commit ae9398a

Browse files
committed
changing install_pg_shard_xtm.sh
1 parent 3bc578b commit ae9398a

File tree

1 file changed

+15
-48
lines changed

1 file changed

+15
-48
lines changed

install_pg_shard_xtm.sh

Lines changed: 15 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
PG_SHARD_DIR=~/code/pg_shard
3+
PG_SHARD_DIR=~/code/pg_shard_master
44
PG_DIR=~/code/postgresql
55
PG_XTM_DIR=$PG_DIR/contrib/pg_xtm
66

@@ -42,24 +42,23 @@ cd $PG_DIR
4242
./install/bin/initdb -D ./install/data2
4343
./install/bin/initdb -D ./install/data3
4444

45-
46-
sed -i '' 's/#port =.*/port = 5433/' ./install/data2/postgresql.conf
47-
sed -i '' 's/#port =.*/port = 5434/' ./install/data3/postgresql.conf
48-
4945
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
5248

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
5651

52+
echo 'fsync = off' >> ./install/data1/postgresql.conf
53+
echo 'fsync = off' >> ./install/data2/postgresql.conf
54+
echo 'fsync = off' >> ./install/data3/postgresql.conf
5755

5856
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
6258

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
6362

6463
./install/bin/pg_ctl -D ./install/data1 -l ./install/data1/log start
6564
./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
8584
./install/bin/createdb `whoami` -p5434
8685

8786

88-
./install/bin/psql -p 5433 << SQL
87+
./install/bin/psql -p 5432 << SQL
8988
CREATE EXTENSION pg_dtm;
9089
SQL
9190

92-
./install/bin/psql -p 5434 << SQL
91+
./install/bin/psql -p 5433 << SQL
9392
CREATE EXTENSION pg_dtm;
9493
SQL
9594

96-
./install/bin/psql << SQL
97-
95+
./install/bin/psql -p 5434 << SQL
9896
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-
11297
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

Comments
 (0)