1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Merge branch 'develop-1.1' into 1.1-merge-up-2018-10-05

This commit is contained in:
Andrew Hutchings
2018-10-05 18:40:07 +01:00
22 changed files with 625 additions and 246 deletions

View File

@ -120,7 +120,10 @@ void FileBufferMgr::flushCache()
// the block pool should not be freed in the above block to allow us
// to continue doing concurrent unprotected-but-"safe" memcpys
// from that memory
if (fReportFrequency)
{
fLog << "Clearing entire cache" << endl;
}
fFBPool.clear();
// fFBPool.reserve(fMaxNumBlocks);
}
@ -154,7 +157,15 @@ void FileBufferMgr::flushMany(const LbidAtVer* laVptr, uint32_t cnt)
BRM::LBID_t lbid;
BRM::VER_t ver;
filebuffer_uset_iter_t iter;
if (fReportFrequency)
{
fLog << "flushMany " << cnt << " items: ";
for (uint32_t j = 0; j < cnt; j++)
{
fLog << "lbid: " << laVptr[j].LBID << " ver: " << laVptr[j].Ver << ", ";
}
fLog << endl;
}
for (uint32_t j = 0; j < cnt; j++)
{
lbid = static_cast<BRM::LBID_t>(laVptr->LBID);
@ -163,6 +174,10 @@ void FileBufferMgr::flushMany(const LbidAtVer* laVptr, uint32_t cnt)
if (iter != fbSet.end())
{
if (fReportFrequency)
{
fLog << "flushMany hit, lbid: " << lbid << " index: " << iter->poolIdx << endl;
}
//remove it from fbList
uint32_t idx = iter->poolIdx;
fbList.erase(fFBPool[idx].listLoc());
@ -186,6 +201,16 @@ void FileBufferMgr::flushManyAllversion(const LBID_t* laVptr, uint32_t cnt)
mutex::scoped_lock lk(fWLock);
if (fReportFrequency)
{
fLog << "flushManyAllversion " << cnt << " items: ";
for (uint32_t i = 0; i < cnt; i++)
{
fLog << laVptr[i] << ", ";
}
fLog << endl;
}
if (fCacheSize == 0 || cnt == 0)
return;
@ -194,8 +219,10 @@ void FileBufferMgr::flushManyAllversion(const LBID_t* laVptr, uint32_t cnt)
for (it = fbSet.begin(); it != fbSet.end();)
{
if (uniquer.find(it->lbid) != uniquer.end())
{
if (fReportFrequency)
{
fLog << "flushManyAllversion hit: " << it->lbid << " index: " << it->poolIdx << endl;
}
const uint32_t idx = it->poolIdx;
fbList.erase(fFBPool[idx].listLoc());
fEmptyPoolSlots.push_back(idx);
@ -222,6 +249,16 @@ void FileBufferMgr::flushOIDs(const uint32_t* oids, uint32_t count)
pair<byLBID_t::iterator, byLBID_t::iterator> itList;
filebuffer_uset_t::iterator it;
if (fReportFrequency)
{
fLog << "flushOIDs " << count << " items: ";
for (uint32_t i = 0; i < count; i++)
{
fLog << oids[i] << ", ";
}
fLog << endl;
}
// If there are more than this # of extents to drop, the whole cache will be cleared
const uint32_t clearThreshold = 50000;
@ -286,6 +323,22 @@ void FileBufferMgr::flushPartition(const vector<OID_t>& oids, const set<BRM::Log
mutex::scoped_lock lk(fWLock);
if (fReportFrequency)
{
std::set<BRM::LogicalPartition>::iterator sit;
fLog << "flushPartition oids: ";
for (uint32_t i = 0; i < count; i++)
{
fLog << oids[i] << ", ";
}
fLog << "flushPartition partitions: ";
for (sit = partitions.begin(); sit != partitions.end(); ++sit)
{
fLog << (*sit).toString() << ", ";
}
fLog << endl;
}
if (fCacheSize == 0 || oids.size() == 0 || partitions.size() == 0)
return;
@ -554,7 +607,7 @@ int FileBufferMgr::insert(const BRM::LBID_t lbid, const BRM::VER_t ver, const ui
{
struct timespec tm;
clock_gettime(CLOCK_MONOTONIC, &tm);
fLog
fLog << "insert: "
<< left << fixed << ((double)(tm.tv_sec + (1.e-9 * tm.tv_nsec))) << " "
<< right << setw(12) << fBlksLoaded << " "
<< right << setw(12) << fBlksNotUsed << endl;
@ -743,9 +796,13 @@ int FileBufferMgr::bulkInsert(const vector<CacheInsert_t>& ops)
mutex::scoped_lock lk(fWLock);
for (i = 0; i < ops.size(); i++)
if (fReportFrequency)
{
const CacheInsert_t& op = ops[i];
fLog << "bulkInsert: ";
}
for (i = 0; i < ops.size(); i++) {
const CacheInsert_t &op = ops[i];
if (gPMProfOn && gPMStatsPtr)
#ifdef _MSC_VER
@ -770,7 +827,10 @@ int FileBufferMgr::bulkInsert(const vector<CacheInsert_t>& ops)
continue;
}
//cout << "FBM: inserting <" << op.lbid << ", " << op.ver << endl;
if (fReportFrequency)
{
fLog << op.lbid << " " << op.ver << ", ";
}
fCacheSize++;
fBlksLoaded++;
FBData_t fbdata = {op.lbid, op.ver, 0};
@ -790,7 +850,10 @@ int FileBufferMgr::bulkInsert(const vector<CacheInsert_t>& ops)
#endif
ret++;
}
if (fReportFrequency)
{
fLog << endl;
}
idbassert(fCacheSize <= maxCacheSize());
return ret;