summaryrefslogtreecommitdiff
path: root/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ndb/src/kernel/blocks/dbtup/DbtupGen.cpp')
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupGen.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index f5c3e2b4128..936ebac7c3e 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -44,16 +44,10 @@ void Dbtup::initData()
cnoOfLcpRec = ZNO_OF_LCP_REC;
cnoOfConcurrentOpenOp = ZNO_OF_CONCURRENT_OPEN_OP;
cnoOfConcurrentWriteOp = ZNO_OF_CONCURRENT_WRITE_OP;
- cnoOfFragoprec = 2 * NO_OF_FRAG_PER_NODE;
- cnoOfFragrec = ZNO_OF_FRAGREC;
- cnoOfOprec = ZNO_OF_OPREC;
- cnoOfPage = ZNO_OF_PAGE;
+ cnoOfFragoprec = 2 * MAX_FRAG_PER_NODE;
cnoOfPageRangeRec = ZNO_OF_PAGE_RANGE_REC;
cnoOfParallellUndoFiles = ZNO_OF_PARALLELL_UNDO_FILES;
cnoOfRestartInfoRec = ZNO_OF_RESTART_INFO_REC;
- cnoOfTablerec = ZNO_OF_TABLEREC;
- cnoOfTabDescrRec = ZNO_OF_TAB_DESCR_REC;
- cnoOfUndoPage = ZNO_OF_UNDO_PAGE;
c_maxTriggersPerTable = ZDEFAULT_MAX_NO_TRIGGERS_PER_TABLE;
c_noOfBuildIndexRec = 32;
@@ -83,9 +77,26 @@ Dbtup::Dbtup(const class Configuration & conf)
c_storedProcPool(),
c_buildIndexList(c_buildIndexPool)
{
-
+ Uint32 log_page_size= 0;
BLOCK_CONSTRUCTOR(Dbtup);
+ const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
+ ndbrequire(p != 0);
+
+ ndb_mgm_get_int_parameter(p, CFG_DB_UNDO_DATA_BUFFER,
+ &log_page_size);
+
+ /**
+ * Always set page size in half MBytes
+ */
+ cnoOfUndoPage= (log_page_size / sizeof(UndoPage));
+ Uint32 mega_byte_part= cnoOfUndoPage & 15;
+ if (mega_byte_part != 0) {
+ jam();
+ cnoOfUndoPage+= (16 - mega_byte_part);
+ }
+ ndbout << "TUP: No of Undo Pages = " << cnoOfUndoPage << endl;
+
addRecSignal(GSN_DEBUG_SIG, &Dbtup::execDEBUG_SIG);
addRecSignal(GSN_CONTINUEB, &Dbtup::execCONTINUEB);
@@ -1049,7 +1060,7 @@ void Dbtup::initializeTablerec()
void
Dbtup::initTab(Tablerec* const regTabPtr)
{
- for (Uint32 i = 0; i < (2 * NO_OF_FRAG_PER_NODE); i++) {
+ for (Uint32 i = 0; i < (2 * MAX_FRAG_PER_NODE); i++) {
regTabPtr->fragid[i] = RNIL;
regTabPtr->fragrec[i] = RNIL;
}//for
@@ -1160,7 +1171,7 @@ void Dbtup::execTUPSEIZEREQ(Signal* signal)
return;
}//Dbtup::execTUPSEIZEREQ()
-#define printFragment(t){ for(Uint32 i = 0; i < (2 * NO_OF_FRAG_PER_NODE);i++){\
+#define printFragment(t){ for(Uint32 i = 0; i < (2 * MAX_FRAG_PER_NODE);i++){\
ndbout_c("table = %d fragid[%d] = %d fragrec[%d] = %d", \
t.i, t.p->fragid[i], i, t.p->fragrec[i]); }}