mirror of https://github.com/citusdata/citus.git
Move detach partition command list
parent
848d13f6eb
commit
3c1361dd4d
|
@ -110,7 +110,7 @@ static void InsertNodeRow(int nodeid, char *nodename, int32 nodeport, NodeMetada
|
||||||
*nodeMetadata);
|
*nodeMetadata);
|
||||||
static void DeleteNodeRow(char *nodename, int32 nodeport);
|
static void DeleteNodeRow(char *nodename, int32 nodeport);
|
||||||
static void SetUpObjectMetadata(WorkerNode *workerNode);
|
static void SetUpObjectMetadata(WorkerNode *workerNode);
|
||||||
static void ClearDistributedObjectsAndIntegrationsFromNode(WorkerNode *workerNode);
|
static void ClearDistributedObjectsFromNode(WorkerNode *workerNode);
|
||||||
static void ClearDistributedTablesFromNode(WorkerNode *workerNode);
|
static void ClearDistributedTablesFromNode(WorkerNode *workerNode);
|
||||||
static void SetUpDistributedTableWithDependencies(WorkerNode *workerNode);
|
static void SetUpDistributedTableWithDependencies(WorkerNode *workerNode);
|
||||||
static void SetUpMultipleDistributedTableIntegrations(WorkerNode *workerNode);
|
static void SetUpMultipleDistributedTableIntegrations(WorkerNode *workerNode);
|
||||||
|
@ -822,6 +822,11 @@ ClearDistributedTablesFromNode(WorkerNode *workerNode)
|
||||||
{
|
{
|
||||||
List *clearDistributedTablesCommandList = NIL;
|
List *clearDistributedTablesCommandList = NIL;
|
||||||
|
|
||||||
|
List *detachPartitionCommandList = DetachPartitionCommandList();
|
||||||
|
|
||||||
|
clearDistributedTablesCommandList = list_concat(clearDistributedTablesCommandList,
|
||||||
|
detachPartitionCommandList);
|
||||||
|
|
||||||
clearDistributedTablesCommandList = lappend(clearDistributedTablesCommandList,
|
clearDistributedTablesCommandList = lappend(clearDistributedTablesCommandList,
|
||||||
REMOVE_ALL_CLUSTERED_TABLES_ONLY_COMMAND);
|
REMOVE_ALL_CLUSTERED_TABLES_ONLY_COMMAND);
|
||||||
|
|
||||||
|
@ -839,16 +844,12 @@ ClearDistributedTablesFromNode(WorkerNode *workerNode)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ClearDistributedObjectsAndIntegrationsFromNode clears all the distributed objects, metadata and partition hierarchy from the given node.
|
* ClearDistributedObjectsFromNode clears all the distributed objects, metadata and partition hierarchy from the given node.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ClearDistributedObjectsAndIntegrationsFromNode(WorkerNode *workerNode)
|
ClearDistributedObjectsFromNode(WorkerNode *workerNode)
|
||||||
{
|
{
|
||||||
List *clearDistTableInfoCommandList = NIL;
|
List *clearDistTableInfoCommandList = NIL;
|
||||||
List *detachPartitionCommandList = DetachPartitionCommandList();
|
|
||||||
|
|
||||||
clearDistTableInfoCommandList = list_concat(clearDistTableInfoCommandList,
|
|
||||||
detachPartitionCommandList);
|
|
||||||
|
|
||||||
clearDistTableInfoCommandList = lappend(clearDistTableInfoCommandList,
|
clearDistTableInfoCommandList = lappend(clearDistTableInfoCommandList,
|
||||||
REMOVE_ALL_CLUSTERED_TABLES_METADATA_ONLY_COMMAND);
|
REMOVE_ALL_CLUSTERED_TABLES_METADATA_ONLY_COMMAND);
|
||||||
|
@ -1209,7 +1210,7 @@ ActivateNode(char *nodeName, int nodePort)
|
||||||
|
|
||||||
if (!NodeIsCoordinator(workerNode) && NodeIsPrimary(workerNode))
|
if (!NodeIsCoordinator(workerNode) && NodeIsPrimary(workerNode))
|
||||||
{
|
{
|
||||||
ClearDistributedObjectsAndIntegrationsFromNode(workerNode);
|
ClearDistributedObjectsFromNode(workerNode);
|
||||||
SetUpMultipleDistributedTableIntegrations(workerNode);
|
SetUpMultipleDistributedTableIntegrations(workerNode);
|
||||||
SetUpObjectMetadata(workerNode);
|
SetUpObjectMetadata(workerNode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ SELECT tablename, indexname FROM pg_indexes WHERE schemaname = 'fix_idx_names' A
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- this should work properly
|
-- this should work properly
|
||||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
-- we have no clashes
|
-- we have no clashes
|
||||||
|
|
|
@ -1992,7 +1992,7 @@ SELECT tablename, indexname FROM pg_indexes
|
||||||
WHERE schemaname = 'partitioning_schema' AND tablename ilike '%part_table_with_%' ORDER BY 1, 2;
|
WHERE schemaname = 'partitioning_schema' AND tablename ilike '%part_table_with_%' ORDER BY 1, 2;
|
||||||
|
|
||||||
-- should work properly - no names clashes
|
-- should work properly - no names clashes
|
||||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
-- check that indexes are named properly
|
-- check that indexes are named properly
|
||||||
|
|
|
@ -388,7 +388,7 @@ CREATE TABLE seq_test_12(col0 text, col1 smallint DEFAULT nextval('seq_12'),
|
||||||
col2 int DEFAULT nextval('seq_13'),
|
col2 int DEFAULT nextval('seq_13'),
|
||||||
col3 bigint DEFAULT nextval('seq_14'));
|
col3 bigint DEFAULT nextval('seq_14'));
|
||||||
SELECT create_distributed_table('seq_test_12', 'col0');
|
SELECT create_distributed_table('seq_test_12', 'col0');
|
||||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||||
INSERT INTO seq_test_12 VALUES ('hello0') RETURNING *;
|
INSERT INTO seq_test_12 VALUES ('hello0') RETURNING *;
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
|
@ -443,7 +443,7 @@ SELECT nextval('seq_14');
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SET citus.shard_replication_factor TO 1;
|
SET citus.shard_replication_factor TO 1;
|
||||||
SET search_path = sequence_default, public;
|
SET search_path = sequence_default, public;
|
||||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
SELECT citus_activate_node('localhost', :worker_1_port);
|
||||||
SELECT undistribute_table('seq_test_12');
|
SELECT undistribute_table('seq_test_12');
|
||||||
SELECT create_distributed_table('seq_test_12', 'col0');
|
SELECT create_distributed_table('seq_test_12', 'col0');
|
||||||
INSERT INTO seq_test_12 VALUES ('hello2') RETURNING *;
|
INSERT INTO seq_test_12 VALUES ('hello2') RETURNING *;
|
||||||
|
|
Loading…
Reference in New Issue