File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -305,12 +305,17 @@ BEGIN
305
305
-- Drop sub for old channel src -> next
306
306
PERFORM shardman .eliminate_sub (src_next_lname);
307
307
PERFORM update shardman .partitions set prv= OLD .prv where owner= me and part_name= OLD .part_name ;
308
- END IF;
308
+ -- This replica is promoted to primary node, so drop trigger disabling writes to the table
309
+ PERFORM readonly_replica_off(part_name);
310
+ -- and replace FDW with local partition
311
+ PERFORM shardman .replace_usual_part_with_foreign (new_primary);
312
+ END IF;
309
313
310
314
-- If primary was moved
311
315
IF OLD .prv IS NULL THEN
312
316
-- And update fdw almost everywhere
313
317
PERFORM shardman .update_fdw_server (new_primary);
318
+ PERFORM shardman .replace_foreign_part_with_usual (NEW);
314
319
END IF;
315
320
316
321
RETURN NULL ;
You can’t perform that action at this time.
0 commit comments