Effectively do not remove any entries

preventConflictingFlags
Onder Kalaci 2020-04-07 15:34:13 +02:00
parent ffd7dcc88f
commit 310a0cd442
3 changed files with 10 additions and 20 deletions

View File

@ -53,7 +53,6 @@
#include "distributed/multi_explain.h"
#include "distributed/multi_physical_planner.h"
#include "distributed/resource_lock.h"
#include "distributed/shared_connection_stats.h"
#include "distributed/transmit.h"
#include "distributed/version_compat.h"
#include "distributed/worker_transaction.h"
@ -454,7 +453,6 @@ multi_ProcessUtility(PlannedStmt *pstmt,
if (IsDropCitusStmt(parsetree))
{
StopMaintenanceDaemon(MyDatabaseId);
RemoveAllSharedConnectionEntries();
}
pstmt->utilityStmt = parsetree;

View File

@ -177,21 +177,6 @@ StoreAllConnections(Tuplestorestate *tupleStore, TupleDesc tupleDescriptor)
}
/*
* RemoveAllSharedConnectionEntries removes all the entries in SharedConnStatsHash.
*/
void
RemoveAllSharedConnectionEntries(void)
{
/* we're reading all shared connections, prevent any changes */
LockConnectionSharedMemory(LW_EXCLUSIVE);
hash_delete_all(SharedConnStatsHash);
UnLockConnectionSharedMemory();
}
/*
* RemoveInactiveNodesFromSharedConnections goes over the SharedConnStatsHash
* and removes the inactive entries.
@ -205,12 +190,20 @@ RemoveInactiveNodesFromSharedConnections(void)
HASH_SEQ_STATUS status;
SharedConnStatsHashEntry *connectionEntry = NULL;
int entryCount = hash_get_num_entries(SharedConnStatsHash);
if (entryCount + 1 < MaxWorkerNodesTracked)
{
UnLockConnectionSharedMemory();
return;
}
hash_seq_init(&status, SharedConnStatsHash);
while ((connectionEntry = (SharedConnStatsHashEntry *) hash_seq_search(&status)) != 0)
{
SharedConnStatsHashKey connectionKey = connectionEntry->key;
WorkerNode *workerNode = FindWorkerNode(connectionKey.hostname,
connectionKey.port);
WorkerNode *workerNode =
FindWorkerNode(connectionKey.hostname, connectionKey.port);
if (workerNode == NULL || !workerNode->isActive)
{

View File

@ -19,7 +19,6 @@ extern void InitializeSharedConnectionStats(void);
extern void WaitForSharedConnection(void);
extern void WakeupWaiterBackendsForSharedConnection(void);
extern void RemoveInactiveNodesFromSharedConnections(void);
extern void RemoveAllSharedConnectionEntries(void);
extern int GetMaxSharedPoolSize(void);
extern bool TryToIncrementSharedConnectionCounter(const char *hostname, int port);
extern void WaitOrErrorForSharedConnection(const char *hostname, int port);