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)
|
foreach(failedPlacementCell, failedPlacementList)
|
||||||
{
|
{
|
||||||
ShardPlacement *failedPlacement = (ShardPlacement *) lfirst(failedPlacementCell);
|
ShardPlacement *failedPlacement = (ShardPlacement *) lfirst(failedPlacementCell);
|
||||||
uint64 shardLength = 0;
|
|
||||||
|
|
||||||
DeleteShardPlacementRow(failedPlacement->shardId, failedPlacement->nodeName,
|
UpdateShardPlacementState(failedPlacement->placementId, FILE_INACTIVE);
|
||||||
failedPlacement->nodePort);
|
|
||||||
InsertShardPlacementRow(failedPlacement->shardId, failedPlacement->placementId,
|
|
||||||
FILE_INACTIVE, shardLength,
|
|
||||||
failedPlacement->nodeName, failedPlacement->nodePort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
shardConnections->connectionList = connectionList;
|
shardConnections->connectionList = connectionList;
|
||||||
|
|
|
@ -605,14 +605,8 @@ ExecuteTaskAndStoreResults(QueryDesc *queryDesc, Task *task,
|
||||||
{
|
{
|
||||||
ShardPlacement *failedPlacement =
|
ShardPlacement *failedPlacement =
|
||||||
(ShardPlacement *) lfirst(failedPlacementCell);
|
(ShardPlacement *) lfirst(failedPlacementCell);
|
||||||
uint64 shardLength = 0;
|
|
||||||
|
|
||||||
DeleteShardPlacementRow(failedPlacement->shardId, failedPlacement->nodeName,
|
UpdateShardPlacementState(failedPlacement->placementId, FILE_INACTIVE);
|
||||||
failedPlacement->nodePort);
|
|
||||||
InsertShardPlacementRow(failedPlacement->shardId,
|
|
||||||
failedPlacement->placementId,
|
|
||||||
FILE_INACTIVE, shardLength,
|
|
||||||
failedPlacement->nodeName, failedPlacement->nodePort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
executorState->es_processed = affectedTupleCount;
|
executorState->es_processed = affectedTupleCount;
|
||||||
|
|
|
@ -295,12 +295,8 @@ master_append_table_to_shard(PG_FUNCTION_ARGS)
|
||||||
uint64 placementId = placement->placementId;
|
uint64 placementId = placement->placementId;
|
||||||
char *workerName = placement->nodeName;
|
char *workerName = placement->nodeName;
|
||||||
uint32 workerPort = placement->nodePort;
|
uint32 workerPort = placement->nodePort;
|
||||||
uint64 oldShardLength = placement->shardLength;
|
|
||||||
|
|
||||||
DeleteShardPlacementRow(shardId, workerName, workerPort);
|
UpdateShardPlacementState(placementId, FILE_INACTIVE);
|
||||||
InsertShardPlacementRow(shardId, placementId,
|
|
||||||
FILE_INACTIVE, oldShardLength,
|
|
||||||
workerName, workerPort);
|
|
||||||
|
|
||||||
ereport(WARNING, (errmsg("could not append table to shard \"%s\" on node "
|
ereport(WARNING, (errmsg("could not append table to shard \"%s\" on node "
|
||||||
"\"%s:%u\"", shardQualifiedName, workerName,
|
"\"%s:%u\"", shardQualifiedName, workerName,
|
||||||
|
|
Loading…
Reference in New Issue