1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-5198 This patch enables RowStorage to dump data on disk

using startNewGeneration if there is 50 Megs left free
This commit is contained in:
Roman Nozdrin
2022-08-23 21:30:55 +00:00
parent 1be82f859b
commit a33597b073

View File

@ -1666,6 +1666,8 @@ void RowAggStorage::dump()
if (!fEnabledDiskAggregation)
return;
constexpr const int freeMemLimit = 50ULL * 1024ULL * 1024ULL;
const int64_t leaveFree = fNumOfInputRGPerThread * fRowGroupOut->getRowSize() * getBucketSize();
uint64_t freeAttempts{0};
int64_t freeMem = 0;
@ -1698,6 +1700,10 @@ void RowAggStorage::dump()
{
startNewGeneration();
}
else if (fAllowGenerations && fMM->getFree() < freeMemLimit)
{
startNewGeneration();
}
else if (!fAllowGenerations && freeMem < 0 && freeAttempts == 1)
{
// safety guard so aggregation couldn't eat all available memory