mirror of https://github.com/citusdata/citus.git
Change value of static variable
parent
91c9394ec4
commit
0b11a324a4
|
@ -1,10 +1,8 @@
|
|||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* pgoutput.c
|
||||
* shardsplit_decoder.c
|
||||
* Logical Replication output plugin
|
||||
*
|
||||
* Copyright (c) 2012-2017, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* src/backend/distributed/shardsplit/shardsplit_decoder.c
|
||||
*
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "utils/memutils.h"
|
||||
|
||||
const char *SharedMemoryNameForHandleManagement =
|
||||
"SHARED_MEMORY_FOR_SPLIT_SHARD_HANDLE_MANAGEMENT";
|
||||
"Shard memory handle for shard split";
|
||||
|
||||
static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
|
||||
|
||||
|
|
|
@ -10,4 +10,4 @@ DROP FUNCTION pg_catalog.worker_repartition_cleanup(bigint);
|
|||
#include "../../columnar/sql/columnar--11.0-2--11.1-1.sql"
|
||||
#include "udfs/citus_split_shard_by_split_points/11.0-2.sql"
|
||||
#include "udfs/worker_split_copy/11.0-2.sql"
|
||||
#include "udfs/split_shard_replication_setup/11.0-2.sql"
|
||||
#include "udfs/worker_split_shard_replication_setup/11.0-2.sql"
|
||||
|
|
|
@ -69,8 +69,13 @@ SELECT worker_split_shard_replication_setup(ARRAY[
|
|||
ROW(4, 6, '0', '2147483647', :worker_2_node)::citus.split_shard_info,
|
||||
ROW(7, 8, '-2147483648', '-1', :worker_2_node)::citus.split_shard_info,
|
||||
ROW(7, 9, '0', '2147483647', :worker_2_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
WARNING: As a part of split shard workflow,unexpectedly found a valid shared memory handle while storing a new one.
|
||||
worker_split_shard_replication_setup
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT relowner AS table_owner_one FROM pg_class WHERE relname='table_first' \gset
|
||||
SELECT relowner AS table_owner_two FROM pg_class WHERE relname='table_second' \gset
|
||||
SELECT slot_name AS slot_for_first_owner FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_%s', :worker_2_node, :table_owner_one), 'citus') \gset
|
||||
|
|
|
@ -47,7 +47,12 @@ CREATE PUBLICATION pub1 FOR TABLE table_to_split_1, table_to_split_2, table_to_s
|
|||
SELECT worker_split_shard_replication_setup(ARRAY[
|
||||
ROW(1, 2, '-2147483648', '-1', :worker_2_node)::citus.split_shard_info,
|
||||
ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
worker_split_shard_replication_setup
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT slot_name FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset
|
||||
-- Create subscription at worker2 with copy_data to 'false' and derived replication slot name
|
||||
\c - - - :worker_2_port
|
||||
|
|
|
@ -13,7 +13,12 @@ CREATE PUBLICATION pub1 for table table_to_split_1, table_to_split_2, table_to_s
|
|||
SELECT worker_split_shard_replication_setup(ARRAY[
|
||||
ROW(1, 2, '-2147483648', '-1', :worker_1_node)::citus.split_shard_info,
|
||||
ROW(1, 3, '0', '2147483647', :worker_1_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
worker_split_shard_replication_setup
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT slot_name AS local_slot FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset
|
||||
-- Create subscription at worker1 with copy_data to 'false' a
|
||||
BEGIN;
|
||||
|
|
|
@ -11,8 +11,13 @@ CREATE PUBLICATION pub1 FOR TABLE table_to_split_1, table_to_split_2, table_to_s
|
|||
SELECT worker_split_shard_replication_setup(ARRAY[
|
||||
ROW(1, 2, '-2147483648', '-1', :worker_1_node)::citus.split_shard_info,
|
||||
ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
WARNING: As a part of split shard workflow,unexpectedly found a valid shared memory handle while storing a new one.
|
||||
worker_split_shard_replication_setup
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT slot_name AS slot_for_worker1 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset
|
||||
SELECT slot_name AS slot_for_worker2 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset
|
||||
-- Create subscription at worker1 with copy_data to 'false' and 'slot_for_worker1'
|
||||
|
|
|
@ -71,7 +71,7 @@ SELECT worker_split_shard_replication_setup(ARRAY[
|
|||
ROW(4, 6, '0', '2147483647', :worker_2_node)::citus.split_shard_info,
|
||||
ROW(7, 8, '-2147483648', '-1', :worker_2_node)::citus.split_shard_info,
|
||||
ROW(7, 9, '0', '2147483647', :worker_2_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
|
||||
SELECT relowner AS table_owner_one FROM pg_class WHERE relname='table_first' \gset
|
||||
SELECT relowner AS table_owner_two FROM pg_class WHERE relname='table_second' \gset
|
||||
|
|
|
@ -49,7 +49,7 @@ CREATE PUBLICATION pub1 FOR TABLE table_to_split_1, table_to_split_2, table_to_s
|
|||
SELECT worker_split_shard_replication_setup(ARRAY[
|
||||
ROW(1, 2, '-2147483648', '-1', :worker_2_node)::citus.split_shard_info,
|
||||
ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
|
||||
SELECT slot_name FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ CREATE PUBLICATION pub1 for table table_to_split_1, table_to_split_2, table_to_s
|
|||
SELECT worker_split_shard_replication_setup(ARRAY[
|
||||
ROW(1, 2, '-2147483648', '-1', :worker_1_node)::citus.split_shard_info,
|
||||
ROW(1, 3, '0', '2147483647', :worker_1_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
|
||||
SELECT slot_name AS local_slot FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ CREATE PUBLICATION pub1 FOR TABLE table_to_split_1, table_to_split_2, table_to_s
|
|||
SELECT worker_split_shard_replication_setup(ARRAY[
|
||||
ROW(1, 2, '-2147483648', '-1', :worker_1_node)::citus.split_shard_info,
|
||||
ROW(1, 3, '0', '2147483647', :worker_2_node)::citus.split_shard_info
|
||||
]) AS shared_memory_id \gset
|
||||
]);
|
||||
|
||||
SELECT slot_name AS slot_for_worker1 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_1_node), 'citus') \gset
|
||||
SELECT slot_name AS slot_for_worker2 FROM pg_create_logical_replication_slot(FORMAT('citus_split_%s_10', :worker_2_node), 'citus') \gset
|
||||
|
|
Loading…
Reference in New Issue