Create a variable SLOW_START_DISABLED (#3593)

When ExecutorSlowStartInterval is set to 0, it has a special meaning
that we do not want to use slow start. Therefore, in the code we have
checks such as ExecutorSlowStartInterval > 0 to understand if it is
enabled or not. However, this is kind of subtle, and it creates an extra
mapping in our mind. Therefore, I thought that using a variable for the
special value removes the mapping and makes it easier to understand.
pull/3596/head
SaitTalhaNisanci 2020-03-09 14:54:01 +03:00 committed by GitHub
parent 2595b4864b
commit 4509d9a72b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -165,6 +165,8 @@
#include "utils/memutils.h"
#include "utils/timestamp.h"
#define SLOW_START_DISABLED 0
/*
* DistributedExecution represents the execution of a distributed query
@ -2257,7 +2259,7 @@ ManageWorkerPool(WorkerPool *workerPool)
*/
newConnectionCount = Min(newConnectionsForReadyTasks, maxNewConnectionCount);
if (newConnectionCount > 0 && ExecutorSlowStartInterval > 0)
if (newConnectionCount > 0 && ExecutorSlowStartInterval != SLOW_START_DISABLED)
{
if (MillisecondsPassedSince(workerPool->lastConnectionOpenTime) >=
ExecutorSlowStartInterval)