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

Refactor better extent info bookkeeping structure and handling

Logs for research purposes

Keep progress - may not build

Good interface to collect LBIDs and CPInfo's

Write Engine compiles with new interface

New interface breaks things the least way and allows for new features to be added gradually.

Still ironing design - rewriting parts of WE

Keep progress commit

Write Engine compiles, going to test

I could introduce crashes there. Let's see.

Disable logging for tests

Fixing build problems - keep progress commit

Changed related to new interface

Add back accidentally removed m_txnLBIDMap.find

Remove printf/cout; up-to-date comment for AddLBIDtoList

Add "auto" type annotation

Work on PR comments

Descriptive vector emptines check
This commit is contained in:
Sergey Zefirov
2020-11-18 14:33:27 +03:00
parent 5ef444c46e
commit 2bfe9b6c19
3 changed files with 107 additions and 175 deletions

View File

@@ -32,9 +32,9 @@
// end
#include <boost/lexical_cast.hpp>
#ifdef _MSC_VER
#include <unordered_map>
#include <unordered_set>
#else
#include <tr1/unordered_map>
#include <tr1/unordered_set>
#endif
#include "we_brm.h"
@@ -72,15 +72,19 @@ class Log;
// for truly long running transactions.
struct TxnLBIDRec
{
std::tr1::unordered_map<BRM::LBID_t, uint32_t> m_LBIDMap;
uint32_t m_lastSeqnum;
uint32_t m_squashedLbids;
std::tr1::unordered_set<BRM::LBID_t> m_LBIDSet;
std::vector<BRM::LBID_t> m_LBIDs;
std::vector<execplan::CalpontSystemCatalog::ColDataType> m_ColDataTypes;
TxnLBIDRec() : m_lastSeqnum(0), m_squashedLbids(0) {};
TxnLBIDRec() {};
~TxnLBIDRec() {}
void AddLBID(BRM::LBID_t lbid)
void AddLBID(BRM::LBID_t lbid, const execplan::CalpontSystemCatalog::ColDataType& colDataType)
{
m_LBIDMap[lbid] = ++m_lastSeqnum;
if ( m_LBIDSet.insert(lbid).second)
{
m_LBIDs.push_back(lbid);
m_ColDataTypes.push_back(colDataType);
}
}
};
@@ -738,11 +742,14 @@ private:
// Bug 4312: We use a hash set to hold the set of starting LBIDS for a given
// txn so that we don't waste time marking the same extent as invalid. This
// list should be trimmed if it gets too big.
int AddLBIDtoList(const TxnID txnid,
std::vector<BRM::LBID_t>& lbids,
std::vector<execplan::CalpontSystemCatalog::ColDataType>& colDataTypes,
int AddLBIDtoList(const TxnID txnid,
const ColStruct& colStruct,
const int fbo);
const int fbo,
const BRM::CPInfo& cpInfo // there is dummy value for you to use
);
// mark extents of the transaction as invalid. erase transaction from txn->lbidsrec map if requested.
int markTxnExtentsAsInvalid(const TxnID txnid, bool erase = false);
int RemoveTxnFromLBIDMap(const TxnID txnid);