mirror of https://github.com/citusdata/citus.git
Use UpdateShardPlacementState where appropriate
parent
982ad66753
commit
33b7723530
|
@ -1026,13 +1026,8 @@ OpenCopyTransactions(CopyStmt *copyStatement, ShardConnections *shardConnections
|
|||
foreach(failedPlacementCell, failedPlacementList)
|
||||
{
|
||||
ShardPlacement *failedPlacement = (ShardPlacement *) lfirst(failedPlacementCell);
|
||||
uint64 shardLength = 0;
|
||||
|
||||
DeleteShardPlacementRow(failedPlacement->shardId, failedPlacement->nodeName,
|
||||
failedPlacement->nodePort);
|
||||
InsertShardPlacementRow(failedPlacement->shardId, failedPlacement->placementId,
|
||||
FILE_INACTIVE, shardLength,
|
||||
failedPlacement->nodeName, failedPlacement->nodePort);
|
||||
UpdateShardPlacementState(failedPlacement->placementId, FILE_INACTIVE);
|
||||
}
|
||||
|
||||
shardConnections->connectionList = connectionList;
|
||||
|
|
|
@ -605,14 +605,8 @@ ExecuteTaskAndStoreResults(QueryDesc *queryDesc, Task *task,
|
|||
{
|
||||
ShardPlacement *failedPlacement =
|
||||
(ShardPlacement *) lfirst(failedPlacementCell);
|
||||
uint64 shardLength = 0;
|
||||
|
||||
DeleteShardPlacementRow(failedPlacement->shardId, failedPlacement->nodeName,
|
||||
failedPlacement->nodePort);
|
||||
InsertShardPlacementRow(failedPlacement->shardId,
|
||||
failedPlacement->placementId,
|
||||
FILE_INACTIVE, shardLength,
|
||||
failedPlacement->nodeName, failedPlacement->nodePort);
|
||||
UpdateShardPlacementState(failedPlacement->placementId, FILE_INACTIVE);
|
||||
}
|
||||
|
||||
executorState->es_processed = affectedTupleCount;
|
||||
|
|
|
@ -295,12 +295,8 @@ master_append_table_to_shard(PG_FUNCTION_ARGS)
|
|||
uint64 placementId = placement->placementId;
|
||||
char *workerName = placement->nodeName;
|
||||
uint32 workerPort = placement->nodePort;
|
||||
uint64 oldShardLength = placement->shardLength;
|
||||
|
||||
DeleteShardPlacementRow(shardId, workerName, workerPort);
|
||||
InsertShardPlacementRow(shardId, placementId,
|
||||
FILE_INACTIVE, oldShardLength,
|
||||
workerName, workerPort);
|
||||
UpdateShardPlacementState(placementId, FILE_INACTIVE);
|
||||
|
||||
ereport(WARNING, (errmsg("could not append table to shard \"%s\" on node "
|
||||
"\"%s:%u\"", shardQualifiedName, workerName,
|
||||
|
|
Loading…
Reference in New Issue