Fix bug where router executor sends query to failed connections

pull/1178/head
Brian Cloutier 2017-01-26 17:00:42 +03:00 committed by Brian Cloutier
parent 1173f3f225
commit 6843ad8e91
2 changed files with 12 additions and 3 deletions

View File

@ -733,6 +733,18 @@ ExecuteSingleModifyTask(QueryDesc *queryDesc, Task *task,
bool failOnError = false;
int64 currentAffectedTupleCount = 0;
if (connection->remoteTransaction.transactionFailed)
{
/*
* If GetModifyConnections failed to send BEGIN this connection will have
* been marked as failed, and should not have any more commands sent to
* it! Skip it for now, at the bottom of this method we call
* MarkFailedShardPlacements() to ensure future statements will not use this
* placement.
*/
continue;
}
queryOK = SendQueryInSingleRowMode(connection, queryString, paramListInfo);
if (!queryOK)
{

View File

@ -2073,9 +2073,6 @@ INSERT INTO failure_test VALUES (1, 1);
WARNING: connection error: localhost:57638
DETAIL: no connection to the server
WARNING: connection error: localhost:57638
DETAIL: no connection to the server
SELECT shardid, shardstate, nodename, nodeport FROM pg_dist_shard_placement
WHERE shardid IN (
SELECT shardid FROM pg_dist_shard