From 4ebac440f9c07b719419658394b17e06589c3df3 Mon Sep 17 00:00:00 2001 From: Halil Ozan Akgul Date: Mon, 6 Mar 2023 17:16:06 +0300 Subject: [PATCH] Minor fix --- src/backend/distributed/utils/attribute.c | 8 ++++++-- src/include/distributed/utils/attribute.h | 12 +++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/backend/distributed/utils/attribute.c b/src/backend/distributed/utils/attribute.c index 119ebe65e..1c8ef03e0 100644 --- a/src/backend/distributed/utils/attribute.c +++ b/src/backend/distributed/utils/attribute.c @@ -291,8 +291,8 @@ AttributeMetricsIfApplicable() while(tenantIndex != 0 && monitor->tenants[tenantIndex-1].score < tenantStats->score) { LWLockAcquire(&monitor->tenants[tenantIndex-1].lock, LW_EXCLUSIVE); - // we need to reduce previous tenants score too !!!!!!!! - elog(WARNING, "swap = %d, %d", tenantIndex, tenantIndex-1); + + ReduceScoreIfNecessary(monitor, monitor->tenants[tenantIndex-1], queryTime); TenantStats tempTenant = monitor->tenants[tenantIndex]; monitor->tenants[tenantIndex] = monitor->tenants[tenantIndex - 1]; @@ -548,6 +548,10 @@ FindTenantStats(MultiTenantMonitor *monitor) } +/* + * MultiTenantMonitorshmemSize calculates the size of the multi tenant monitor using + * CitusStatsTenantsLimit parameter. + */ static size_t MultiTenantMonitorshmemSize(void) { diff --git a/src/include/distributed/utils/attribute.h b/src/include/distributed/utils/attribute.h index 5200ac63b..77f83bee7 100644 --- a/src/include/distributed/utils/attribute.h +++ b/src/include/distributed/utils/attribute.h @@ -1,6 +1,12 @@ -// -// Created by Nils Dijk on 02/12/2022. -// +/*------------------------------------------------------------------------- + * + * attribute.h + * Routines related to the multi tenant monitor. + * + * Copyright (c) Citus Data, Inc. + * + *------------------------------------------------------------------------- + */ #ifndef CITUS_ATTRIBUTE_H #define CITUS_ATTRIBUTE_H