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

Commit 3bbd750

Browse files
committed
Temporary removed dropping repslots during cleanup.
Before that, it was impossible to drop the extension if any subscriber was alive. This should be fixed properly later.
1 parent dd151e2 commit 3bbd750

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bin/shardman_start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source "${script_dir}/common.sh"
66
cd "${script_dir}/.."
77
make clean
88

9-
restart_nodes
9+
restart_nodes # make sure nodes run
1010
for port in $master_port "${worker_ports[@]}"; do
1111
psql -p $port -c "drop extension if exists pg_shardman;"
1212
done

pg_shardman--0.0.1.sql

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,14 @@ BEGIN
340340
EXECUTE format('DROP SUBSCRIPTION %I', sub.subname);
341341
END IF;
342342
END LOOP;
343-
FOR rs IN SELECT slot_name FROM pg_replication_slots
344-
WHERE slot_name LIKE 'shardman_%' AND slot_type = 'logical' LOOP
345-
EXECUTE format('SELECT pg_drop_replication_slot(%L)', rs.slot_name);
346-
END LOOP;
343+
-- TODO: we can't just drop replication slots because
344+
-- pg_drop_replication_slot will bail out with ERROR if connection is active.
345+
-- We should therefore iterate over all active subscribers and turn off
346+
-- subscriptions first.
347+
-- FOR rs IN SELECT slot_name FROM pg_replication_slots
348+
-- WHERE slot_name LIKE 'shardman_%' AND slot_type = 'logical' LOOP
349+
-- EXECUTE format('SELECT pg_drop_replication_slot(%L)', rs.slot_name);
350+
-- END LOOP;
347351

348352
PERFORM shardman.reset_node_id();
349353
END;

0 commit comments

Comments
 (0)