mirror of https://github.com/citusdata/citus.git
Fix crash with no distributed tables for rebalance plan
parent
a31429aae5
commit
857040e1bb
|
@ -1753,6 +1753,11 @@ RebalancePlacementUpdates(List *workerNodeList, List *shardPlacementListList,
|
|||
List *shardPlacementList = NIL;
|
||||
List *placementUpdateList = NIL;
|
||||
|
||||
if (list_length(shardPlacementListList) == 0)
|
||||
{
|
||||
return NIL;
|
||||
}
|
||||
|
||||
foreach_ptr(shardPlacementList, shardPlacementListList)
|
||||
{
|
||||
state = InitRebalanceState(workerNodeList, shardPlacementList,
|
||||
|
|
|
@ -35,6 +35,12 @@ SELECT * FROM master_add_node('localhost', :worker_1_port);
|
|||
1
|
||||
(1 row)
|
||||
|
||||
-- make sure that when there are no distributed tables, we don't crash.
|
||||
SELECT 1 FROM get_rebalance_table_shards_plan();
|
||||
?column?
|
||||
---------------------------------------------------------------------
|
||||
(0 rows)
|
||||
|
||||
-- get the active nodes
|
||||
SELECT master_get_active_worker_nodes();
|
||||
master_get_active_worker_nodes
|
||||
|
|
|
@ -15,6 +15,9 @@ SELECT master_get_active_worker_nodes();
|
|||
-- try to add a node that is already in the cluster
|
||||
SELECT * FROM master_add_node('localhost', :worker_1_port);
|
||||
|
||||
-- make sure that when there are no distributed tables, we don't crash.
|
||||
SELECT 1 FROM get_rebalance_table_shards_plan();
|
||||
|
||||
-- get the active nodes
|
||||
SELECT master_get_active_worker_nodes();
|
||||
|
||||
|
|
Loading…
Reference in New Issue