mirror of https://github.com/citusdata/citus.git
wip
parent
fdd401956f
commit
ea09b3309b
|
@ -381,6 +381,18 @@ StartNodeUserDatabaseConnection(uint32 flags, const char *hostname, int32 port,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
SetCriticalConnectionFlag(int *prevFlags, MultiConnectionMode connectionFlag)
|
||||
{
|
||||
*prevFlags |= connectionFlag;
|
||||
if ((*prevFlags & WAIT_FOR_CONNECTION) && (*prevFlags & OPTIONAL_CONNECTION))
|
||||
{
|
||||
ereport(ERROR, (errmsg(
|
||||
"connection cannot have both wait for connection and optional connection flag")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* FindAvailableConnection searches the given list of connections for one that
|
||||
* is not claimed exclusively.
|
||||
|
|
|
@ -2393,7 +2393,7 @@ ManageWorkerPool(WorkerPool *workerPool)
|
|||
* remaining are optional. If the executor can get more connections,
|
||||
* it can increase the parallelism.
|
||||
*/
|
||||
connectionFlags |= OPTIONAL_CONNECTION;
|
||||
SetCriticalConnectionFlag(&connectionFlags, OPTIONAL_CONNECTION);
|
||||
}
|
||||
else if (!UseConnectionPerPlacement())
|
||||
{
|
||||
|
@ -2403,7 +2403,7 @@ ManageWorkerPool(WorkerPool *workerPool)
|
|||
* always finish the execution with a single connection, so wait until we get
|
||||
* one connection.
|
||||
*/
|
||||
connectionFlags |= WAIT_FOR_CONNECTION;
|
||||
SetCriticalConnectionFlag(&connectionFlags, WAIT_FOR_CONNECTION);
|
||||
}
|
||||
|
||||
/* open a new connection to the worker */
|
||||
|
|
|
@ -222,6 +222,8 @@ extern void CloseConnection(MultiConnection *connection);
|
|||
extern void ShutdownAllConnections(void);
|
||||
extern void ShutdownConnection(MultiConnection *connection);
|
||||
|
||||
extern void SetCriticalConnectionFlag(int *prevFlags, MultiConnectionMode connectionFlag);
|
||||
|
||||
/* dealing with a connection */
|
||||
extern void FinishConnectionListEstablishment(List *multiConnectionList);
|
||||
extern void FinishConnectionEstablishment(MultiConnection *connection);
|
||||
|
|
Loading…
Reference in New Issue