mirror of https://github.com/citusdata/citus.git
Drop partitioned tables saner while re-syncing metadata
parent
873429c465
commit
3157c3760a
|
@ -811,12 +811,10 @@ SyncDistributedObjectsCommandList(WorkerNode *workerNode)
|
|||
*/
|
||||
commandList = list_concat(commandList, PropagateNodeWideObjectsCommandList());
|
||||
|
||||
/*
|
||||
* Detach partitions, break dependencies between sequences and table then
|
||||
* remove shell tables first.
|
||||
*/
|
||||
commandList = list_concat(commandList, DetachPartitionCommandList());
|
||||
commandList = lappend(commandList, BREAK_CITUS_TABLE_SEQUENCE_DEPENDENCY_COMMAND);
|
||||
|
||||
/* first remove partitioned tables to avoid any need for detaching partitions */
|
||||
commandList = lappend(commandList, REMOVE_PARTITIONED_SHELL_TABLES_COMMAND);
|
||||
commandList = lappend(commandList, REMOVE_ALL_SHELL_TABLES_COMMAND);
|
||||
|
||||
/*
|
||||
|
|
|
@ -117,6 +117,8 @@ extern void SyncDeleteColocationGroupToNodes(uint32 colocationId);
|
|||
#define DELETE_ALL_DISTRIBUTED_OBJECTS "DELETE FROM pg_catalog.pg_dist_object"
|
||||
#define DELETE_ALL_PARTITIONS "DELETE FROM pg_dist_partition"
|
||||
#define DELETE_ALL_COLOCATION "DELETE FROM pg_catalog.pg_dist_colocation"
|
||||
#define REMOVE_PARTITIONED_SHELL_TABLES_COMMAND \
|
||||
"SELECT worker_drop_shell_table(logicalrelid::regclass::text) FROM pg_dist_partition JOIN pg_class ON (logicalrelid = oid) WHERE relkind = 'p'"
|
||||
#define REMOVE_ALL_SHELL_TABLES_COMMAND \
|
||||
"SELECT worker_drop_shell_table(logicalrelid::regclass::text) FROM pg_dist_partition"
|
||||
#define REMOVE_ALL_CITUS_TABLES_COMMAND \
|
||||
|
|
Loading…
Reference in New Issue