Don't mark placements inactive in COPY after successful connection

pull/1168/head
Marco Slot 2017-01-24 12:48:52 +01:00 committed by Murat Tuncer
parent d0c76407b8
commit b1626887d5
2 changed files with 5 additions and 14 deletions

View File

@ -888,14 +888,11 @@ OpenCopyConnections(CopyStmt *copyStatement, ShardConnections *shardConnections,
}
/*
* If errors are supposed to cause immediate aborts (i.e. we don't
* Errors are supposed to cause immediate aborts (i.e. we don't
* want to/can't invalidate placements), mark the connection as
* critical so later errors cause failures.
*/
if (stopOnFailure)
{
MarkRemoteTransactionCritical(connection);
}
MarkRemoteTransactionCritical(connection);
ClaimConnectionExclusively(connection);
RemoteTransactionBeginIfNecessary(connection);
copyCommand = ConstructCopyStatement(copyStatement, shardConnections->shardId,
@ -904,13 +901,7 @@ OpenCopyConnections(CopyStmt *copyStatement, ShardConnections *shardConnections,
if (PQresultStatus(result) != PGRES_COPY_IN)
{
ReportConnectionError(connection, WARNING);
MarkRemoteTransactionFailed(connection, true);
PQclear(result);
failedPlacementCount++;
continue;
ReportResultError(connection, result, ERROR);
}
PQclear(result);

View File

@ -337,9 +337,9 @@ DELETE FROM researchers WHERE lab_id = 6;
\copy researchers FROM STDIN delimiter ','
COMMIT;
WARNING: illegal value
WARNING: failed to commit transaction on localhost:57638
WARNING: failed to commit critical transaction on localhost:57638, metadata is likely out of sync
WARNING: illegal value
WARNING: failed to commit transaction on localhost:57637
WARNING: failed to commit critical transaction on localhost:57637, metadata is likely out of sync
WARNING: could not commit transaction for shard 1200001 on any active node
ERROR: could not commit transaction on any active node
\unset VERBOSITY