From ba32f827a9b9b71126578dd6c32c01a93202e3f8 Mon Sep 17 00:00:00 2001 From: Halil Ozan Akgul Date: Fri, 10 Mar 2023 11:14:05 +0300 Subject: [PATCH] fix --- src/backend/distributed/utils/attribute.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/backend/distributed/utils/attribute.c b/src/backend/distributed/utils/attribute.c index 72d4d5058..40d76fade 100644 --- a/src/backend/distributed/utils/attribute.c +++ b/src/backend/distributed/utils/attribute.c @@ -311,7 +311,7 @@ AttributeMetricsIfApplicable() * After updating the score we might need to change the rank of the tenant in the monitor */ while (tenantIndex != 0 && - monitor->tenants[tenantIndex - 1].score < tenantStats->score) + monitor->tenants[tenantIndex - 1].score < monitor->tenants[tenantIndex]->score) { LWLockAcquire(&monitor->tenants[tenantIndex - 1].lock, LW_EXCLUSIVE); @@ -325,9 +325,8 @@ AttributeMetricsIfApplicable() LWLockRelease(&monitor->tenants[tenantIndex].lock); tenantIndex--; - - tenantStats = &monitor->tenants[tenantIndex]; } + tenantStats = &monitor->tenants[tenantIndex]; if (attributeCommandType == CMD_SELECT) {