1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-707 Fix ExeMgr's memory accounting

ExeMgr uses ResourceManager to count memory usage. If a usage exceeded
error occurs the counting wasn't reset and subsequent usage attempts in
the same ExeMgr thread would error.

This patch moves the in-class accounting for GroupConcat and others so
that it happens before the error is detected. The memory usage counter
is then decremented correctly on the class destructor.
This commit is contained in:
Andrew Hutchings
2017-05-10 11:45:31 +01:00
parent 9ef603c14a
commit 4adb50f171
3 changed files with 8 additions and 8 deletions

View File

@ -784,9 +784,9 @@ void WindowFunctionStep::execute()
{
fInRowGroupData.push_back(rgData);
uint64_t memAdd = fRowGroupIn.getSizeWithStrings() + rowCnt * sizeof(RowPosition);
fMemUsage += memAdd;
if (fRm->getMemory(memAdd, fSessionMemLimit) == false)
throw IDBExcept(ERR_WF_DATA_SET_TOO_BIG);
fMemUsage += memAdd;
for (uint64_t j = 0; j < rowCnt; ++j)
{
@ -919,9 +919,9 @@ void WindowFunctionStep::doFunction()
while (((i = nextFunctionIndex()) < fFunctionCount) && !cancelled())
{
uint64_t memAdd = fRows.size() * sizeof(RowPosition);
fMemUsage += memAdd;
if (fRm->getMemory(memAdd, fSessionMemLimit) == false)
throw IDBExcept(ERR_WF_DATA_SET_TOO_BIG);
fMemUsage += memAdd;
fFunctions[i]->setCallback(this, i);
(*fFunctions[i].get())();
}