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

Commit 6c4f81b

Browse files
committed
move_part fix: making replica read-only
1 parent a10b29d commit 6c4f81b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

bin/common.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ function run_demo()
6767
psql -p 5433 -c "INSERT INTO pt SELECT generate_series(1, 10), random();"
6868
psql -c "select shardman.add_node('port=5433');"
6969
psql -c "select shardman.add_node('port=5434');"
70-
# psql -c "select shardman.add_node('port=5435');"
71-
# psql -c "select shardman.add_node('port=5436');"
70+
psql -c "select shardman.add_node('port=5435');"
71+
psql -c "select shardman.add_node('port=5436');"
7272

7373
psql -p 5433 -c "drop table if exists pt_0;" # drop replica
7474
psql -c "select shardman.create_hash_partitions(2, 'pt', 'id', 2);"
7575

76-
# psql -c "select shardman.create_replica('pt_0', 3);"
77-
# psql -c "select shardman.create_replica('pt_0', 5);"
78-
# psql -c "select shardman.move_part('pt_0', 4, 3);"
76+
psql -c "select shardman.create_replica('pt_0', 3);"
77+
psql -c "select shardman.create_replica('pt_0', 5);"
78+
psql -c "select shardman.move_part('pt_0', 4, 3);"
7979
}

postgresql.conf.master.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
shardman.master = on
33
shardman.master_dbname = ars
44
shardman.master_connstring = 'port=5432'
5-
shardman.cmd_retry_naptime = 3000
6-
shardman.poll_interval = 3000
5+
shardman.cmd_retry_naptime = 500
6+
shardman.poll_interval = 500

shard.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ BEGIN
157157
'CREATE SUBSCRIPTION %I connection %L
158158
PUBLICATION %I with (create_slot = false, slot_name = %L, copy_data = false, synchronous_commit = on);',
159159
prev_lname, prev_connstr, prev_lname, prev_lname);
160+
-- If we have prev, we are replica
161+
PERFORM shardman.readonly_replica_on(p_name::regclass);
160162
END IF;
161163
END $$ LANGUAGE plpgsql STRICT;
162164

0 commit comments

Comments
 (0)