Fix initializing SPIMemReserved when resource group is enabled.
When resource group is enabled, initialization of
SPIMemReserved should not depend on statement_mem.
#include "utils/memutils.h"
#include "utils/snapmgr.h"
#include "utils/typcache.h"
+#include "utils/resource_manager.h"
#include "utils/resscheduler.h"
#include "cdb/cdbvars.h"
@@ -2550,8 +2551,16 @@ static uint64 SPIMemReserved = 0;
void SPI_InitMemoryReservation(void)
{
Assert(!IsResManagerMemoryPolicyNone());
+
+ if (IsResGroupEnabled())
+ {
+ SPIMemReserved = 0;
+ }
+ else
+ {
SPIMemReserved = (uint64) statement_mem * 1024L;;
}
+}
/**
* Push memory reserved for next SPI call. It is possible for an operator to (after several levels of nesting),
