mirror of https://github.com/citusdata/citus.git
Ensure local copy is triggered in tests
parent
8f8761ed40
commit
0445d72cc7
|
@ -70,7 +70,7 @@ static void ShardCopyDestReceiverStartup(DestReceiver *dest, int operation,
|
|||
TupleDesc inputTupleDescriptor);
|
||||
static void ShardCopyDestReceiverShutdown(DestReceiver *destReceiver);
|
||||
static void ShardCopyDestReceiverDestroy(DestReceiver *destReceiver);
|
||||
static bool CanUseLocalCopy(uint64 destinationNodeId);
|
||||
static bool CanUseLocalCopy(uint32_t destinationNodeId);
|
||||
static StringInfo ConstructShardCopyStatement(List *destinationShardFullyQualifiedName,
|
||||
bool
|
||||
useBinaryFormat);
|
||||
|
@ -81,10 +81,10 @@ static void LocalCopyToShard(ShardCopyDestReceiver *copyDest, CopyOutState
|
|||
static void ConnectToRemoteAndStartCopy(ShardCopyDestReceiver *copyDest);
|
||||
|
||||
static bool
|
||||
CanUseLocalCopy(uint64 destinationNodeId)
|
||||
CanUseLocalCopy(uint32_t destinationNodeId)
|
||||
{
|
||||
/* If destination node is same as source, use local copy */
|
||||
return GetLocalNodeId() == destinationNodeId;
|
||||
return GetLocalNodeId() == (int32) destinationNodeId;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -91,7 +91,6 @@ SELECT COUNT(*) FROM colocated_dist_table;
|
|||
|
||||
-- END: Load data into tables.
|
||||
-- BEGIN : Display current state.
|
||||
-- TODO(niupre): Can we refactor this to be a function?
|
||||
SELECT shard.shardid, logicalrelid, shardminvalue, shardmaxvalue, nodename, nodeport
|
||||
FROM pg_dist_shard AS shard
|
||||
INNER JOIN pg_dist_placement placement ON shard.shardid = placement.shardid
|
||||
|
@ -241,7 +240,6 @@ SELECT citus_move_shard_placement(8981007, 'localhost', :worker_1_port, 'localho
|
|||
|
||||
-- END : Move a shard post split.
|
||||
-- BEGIN : Display current state.
|
||||
-- TODO(niupre): Can we refactor this to be a function?
|
||||
SELECT shard.shardid, logicalrelid, shardminvalue, shardmaxvalue, nodename, nodeport
|
||||
FROM pg_dist_shard AS shard
|
||||
INNER JOIN pg_dist_placement placement ON shard.shardid = placement.shardid
|
||||
|
|
|
@ -1258,3 +1258,40 @@ SELECT bool_and(hasmetadata) AND bool_and(metadatasynced) FROM pg_dist_node WHER
|
|||
t
|
||||
(1 row)
|
||||
|
||||
-- Remove extra nodes added, this causes GetLocalNodeId() to behave incorrectly in other tests.
|
||||
SELECT master_remove_node('localhost', 8887);
|
||||
master_remove_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT master_remove_node('localhost', 9995);
|
||||
master_remove_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT master_remove_node('localhost', 9992);
|
||||
master_remove_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT master_remove_node('localhost', 9998);
|
||||
master_remove_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT master_remove_node('localhost', 9997);
|
||||
master_remove_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT master_remove_node('localhost', 8888);
|
||||
master_remove_node
|
||||
---------------------------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ SELECT COUNT(*) FROM colocated_dist_table;
|
|||
-- END: Load data into tables.
|
||||
|
||||
-- BEGIN : Display current state.
|
||||
-- TODO(niupre): Can we refactor this to be a function?
|
||||
SELECT shard.shardid, logicalrelid, shardminvalue, shardmaxvalue, nodename, nodeport
|
||||
FROM pg_dist_shard AS shard
|
||||
INNER JOIN pg_dist_placement placement ON shard.shardid = placement.shardid
|
||||
|
@ -148,7 +147,6 @@ SELECT citus_move_shard_placement(8981007, 'localhost', :worker_1_port, 'localho
|
|||
-- END : Move a shard post split.
|
||||
|
||||
-- BEGIN : Display current state.
|
||||
-- TODO(niupre): Can we refactor this to be a function?
|
||||
SELECT shard.shardid, logicalrelid, shardminvalue, shardmaxvalue, nodename, nodeport
|
||||
FROM pg_dist_shard AS shard
|
||||
INNER JOIN pg_dist_placement placement ON shard.shardid = placement.shardid
|
||||
|
|
|
@ -511,3 +511,11 @@ SELECT start_metadata_sync_to_all_nodes();
|
|||
|
||||
-- verify that at the end of this file, all primary nodes have metadata synced
|
||||
SELECT bool_and(hasmetadata) AND bool_and(metadatasynced) FROM pg_dist_node WHERE isactive = 't' and noderole = 'primary';
|
||||
|
||||
-- Remove extra nodes added, this causes GetLocalNodeId() to behave incorrectly in other tests.
|
||||
SELECT master_remove_node('localhost', 8887);
|
||||
SELECT master_remove_node('localhost', 9995);
|
||||
SELECT master_remove_node('localhost', 9992);
|
||||
SELECT master_remove_node('localhost', 9998);
|
||||
SELECT master_remove_node('localhost', 9997);
|
||||
SELECT master_remove_node('localhost', 8888);
|
||||
|
|
Loading…
Reference in New Issue