Apply feedback

pull/6259/head
Onder Kalaci 2022-09-01 09:34:38 +03:00
parent 71b9c70906
commit 6dcc960665
1 changed files with 14 additions and 3 deletions

View File

@ -577,7 +577,19 @@ EnsureTxStateAndGetHealthyConnections(dlist_head *connections,
{
/*
* If a connection is executing a critical transaction or accessed any
* placements, we should not continue the execution.
* placements, we should not skip this connection (or return as
* healthy connection).
*
* Critical transaction means that the caller -- or the initiator
* of the transaction -- cannot afford to handle any failures
* within the transaction, so better fail right now.
*
* If a placement is accessed inside a transaction and the
* transaction has failed, we cannot proceed. Otherwise,
* another connection in the same transaction might try
* to access the same placement over a different connection.
* That could cause self-deadlocks or break read-your-own-writes
* consistency.
*/
ReportConnectionError(connection, ERROR);
}
@ -692,8 +704,7 @@ ProcessWaitEventsForSocketClose(WaitEvent *events, int eventCount, bool *socketC
{
*socketClosed = false;
int eventIndex = 0;
for (; eventIndex < eventCount; eventIndex++)
for (int eventIndex = 0; eventIndex < eventCount; eventIndex++)
{
WaitEvent *event = &events[eventIndex];