You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
fix(rowstorage): SplitMix64 PRNG implementation to replace stdlib MT PRNG that uses /dev/urandom guarded by spinlock (#3050)
This commit is contained in:
@@ -1495,9 +1495,7 @@ RowAggStorage::RowAggStorage(const std::string& tmpDir, RowGroup* rowGroupOut, R
|
||||
, fTmpDir(tmpDir)
|
||||
, fRowGroupOut(rowGroupOut)
|
||||
, fKeysRowGroup(keysRowGroup)
|
||||
, fRD()
|
||||
, fRandGen(fRD())
|
||||
, fRandDistr(0, 100)
|
||||
, fRandom(reinterpret_cast<std::uintptr_t>(this))
|
||||
{
|
||||
char suffix[PATH_MAX];
|
||||
snprintf(suffix, sizeof(suffix), "/p%u-t%p/", getpid(), this);
|
||||
@@ -1683,7 +1681,7 @@ void RowAggStorage::dump()
|
||||
break;
|
||||
}
|
||||
|
||||
int64_t totalMem = fMM->getConfigured();
|
||||
const int64_t totalMem = fMM->getConfigured();
|
||||
// If the generations are allowed and there are less than half of
|
||||
// rowgroups in memory, then we start a new generation
|
||||
if (fAllowGenerations && fStorage->fLRU->size() < fStorage->fRGDatas.size() / 2 &&
|
||||
@@ -1691,7 +1689,7 @@ void RowAggStorage::dump()
|
||||
{
|
||||
startNewGeneration();
|
||||
}
|
||||
else if (fAllowGenerations && freeMem < totalMem / 10 * 3 && fRandDistr(fRandGen) < 30)
|
||||
else if (fAllowGenerations && freeMem < totalMem / 10 * 3 && nextRandDistib() < 30)
|
||||
{
|
||||
startNewGeneration();
|
||||
}
|
||||
|
Reference in New Issue
Block a user