Commit e8cd384d authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge perch.ndb.mysql.com:/home/jonas/src/51-work

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
parents 5d37bbee d424ffbd
...@@ -963,7 +963,7 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = { ...@@ -963,7 +963,7 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
ROW(NDBStopCompleted, LogLevel::llStartUp, 1, Logger::LL_INFO ), ROW(NDBStopCompleted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(NDBStopForced, LogLevel::llStartUp, 1, Logger::LL_ALERT ), ROW(NDBStopForced, LogLevel::llStartUp, 1, Logger::LL_ALERT ),
ROW(NDBStopAborted, LogLevel::llStartUp, 1, Logger::LL_INFO ), ROW(NDBStopAborted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(StartREDOLog, LogLevel::llStartUp, 10, Logger::LL_INFO ), ROW(StartREDOLog, LogLevel::llStartUp, 4, Logger::LL_INFO ),
ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ), ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ),
ROW(UNDORecordsExecuted, LogLevel::llStartUp, 15, Logger::LL_INFO ), ROW(UNDORecordsExecuted, LogLevel::llStartUp, 15, Logger::LL_INFO ),
ROW(StartReport, LogLevel::llStartUp, 4, Logger::LL_INFO ), ROW(StartReport, LogLevel::llStartUp, 4, Logger::LL_INFO ),
......
...@@ -12251,6 +12251,10 @@ void Dblqh::execFSCLOSECONF(Signal* signal) ...@@ -12251,6 +12251,10 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
// Set the prev file to check if we shall close it. // Set the prev file to check if we shall close it.
logFilePtr.i = logFilePtr.p->prevLogFile; logFilePtr.i = logFilePtr.p->prevLogFile;
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord); ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
logPartPtr.i = logFilePtr.p->logPartRec;
ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
exitFromInvalidate(signal); exitFromInvalidate(signal);
return; return;
case LogFileRecord::CLOSING_INIT: case LogFileRecord::CLOSING_INIT:
......
...@@ -1840,6 +1840,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal) ...@@ -1840,6 +1840,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
ndbrequire(m_file_hash.find(file_ptr, file_key)); ndbrequire(m_file_hash.find(file_ptr, file_key));
struct req val = lookup_extent(req.key.m_page_no, file_ptr.p); struct req val = lookup_extent(req.key.m_page_no, file_ptr.p);
Uint32 page_no_in_extent = calc_page_no_in_extent(req.key.m_page_no, &val);
Page_cache_client::Request preq; Page_cache_client::Request preq;
preq.m_page.m_page_no = val.m_extent_page_no; preq.m_page.m_page_no = val.m_extent_page_no;
...@@ -1865,7 +1866,6 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal) ...@@ -1865,7 +1866,6 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
ndbrequire(header->m_table == req.request.table_id); ndbrequire(header->m_table == req.request.table_id);
Uint32 page_no_in_extent = calc_page_no_in_extent(req.key.m_page_no, &val);
Uint32 word = header->get_free_word_offset(page_no_in_extent); Uint32 word = header->get_free_word_offset(page_no_in_extent);
Uint32 shift = SZ * (page_no_in_extent & 7); Uint32 shift = SZ * (page_no_in_extent & 7);
...@@ -1925,8 +1925,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal) ...@@ -1925,8 +1925,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
found: found:
header->update_free_bits(page_no, src_bits | UNCOMMITTED_MASK); header->update_free_bits(page_no, src_bits | UNCOMMITTED_MASK);
rep->bits= (src_bits & UNCOMMITTED_MASK) >> UNCOMMITTED_SHIFT; rep->bits= (src_bits & UNCOMMITTED_MASK) >> UNCOMMITTED_SHIFT;
rep->key.m_page_no= rep->key.m_page_no = req.key.m_page_no + page_no - page_no_in_extent;
val.m_extent_pages + val.m_extent_no * val.m_extent_size + page_no;
rep->reply.errorCode= 0; rep->reply.errorCode= 0;
return; return;
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
RWPool::RWPool() RWPool::RWPool()
{ {
bzero(this, sizeof(* this)); bzero(this, sizeof(* this));
m_current_pos = GLOBAL_PAGE_SIZE_WORDS; m_current_pos = RWPage::RWPAGE_WORDS;
m_current_first_free = REC_NIL; m_current_first_free = REC_NIL;
m_first_free_page = RNIL; m_first_free_page = RNIL;
} }
...@@ -57,7 +57,7 @@ seize_free: ...@@ -57,7 +57,7 @@ seize_free:
m_current_first_free = pageP->m_data[pos+m_record_info.m_offset_next_pool]; m_current_first_free = pageP->m_data[pos+m_record_info.m_offset_next_pool];
return true; return true;
} }
else if (pos + size < GLOBAL_PAGE_SIZE_WORDS) else if (pos + size < RWPage::RWPAGE_WORDS)
{ {
seize_first: seize_first:
ptr.i = (m_current_page_no << POOL_RECORD_BITS) + pos; ptr.i = (m_current_page_no << POOL_RECORD_BITS) + pos;
...@@ -81,11 +81,14 @@ seize_first: ...@@ -81,11 +81,14 @@ seize_first:
{ {
pageP = m_current_page = m_memroot + m_first_free_page; pageP = m_current_page = m_memroot + m_first_free_page;
m_current_page_no = m_first_free_page; m_current_page_no = m_first_free_page;
m_current_pos = GLOBAL_PAGE_SIZE_WORDS; m_current_pos = RWPage::RWPAGE_WORDS;
m_current_first_free = m_current_page->m_first_free; m_current_first_free = m_current_page->m_first_free;
m_first_free_page = m_current_page->m_next_page; m_first_free_page = m_current_page->m_next_page;
m_current_ref_count = m_current_page->m_ref_count; m_current_ref_count = m_current_page->m_ref_count;
if (m_first_free_page != RNIL)
{
(m_memroot + m_first_free_page)->m_prev_page = RNIL; (m_memroot + m_first_free_page)->m_prev_page = RNIL;
}
goto seize_free; goto seize_free;
} }
...@@ -105,7 +108,7 @@ seize_first: ...@@ -105,7 +108,7 @@ seize_first:
m_current_page = 0; m_current_page = 0;
m_current_page_no = RNIL; m_current_page_no = RNIL;
m_current_pos = GLOBAL_PAGE_SIZE_WORDS; m_current_pos = RWPage::RWPAGE_WORDS;
m_current_first_free = REC_NIL; m_current_first_free = REC_NIL;
return false; return false;
...@@ -154,6 +157,7 @@ RWPool::release(Ptr<void> ptr) ...@@ -154,6 +157,7 @@ RWPool::release(Ptr<void> ptr)
} }
page->m_next_page = ffp; page->m_next_page = ffp;
page->m_prev_page = RNIL; page->m_prev_page = RNIL;
m_first_free_page = ptr_page;
return; return;
} }
else if(ref_cnt == 1) else if(ref_cnt == 1)
......
...@@ -20,12 +20,14 @@ ...@@ -20,12 +20,14 @@
struct RWPage struct RWPage
{ {
STATIC_CONST( RWPAGE_WORDS = GLOBAL_PAGE_SIZE_WORDS - 4 );
Uint32 m_type_id; Uint32 m_type_id;
Uint16 m_first_free; Uint16 m_first_free;
Uint16 m_ref_count; Uint16 m_ref_count;
Uint32 m_next_page; Uint32 m_next_page;
Uint32 m_prev_page; Uint32 m_prev_page;
Uint32 m_data[GLOBAL_PAGE_SIZE_WORDS - 4]; Uint32 m_data[RWPAGE_WORDS];
}; };
/** /**
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
WOPool::WOPool() WOPool::WOPool()
{ {
bzero(this, sizeof(* this)); bzero(this, sizeof(* this));
m_current_pos = GLOBAL_PAGE_SIZE_WORDS; m_current_pos = WOPage::WOPAGE_WORDS;
} }
void void
......
...@@ -20,9 +20,11 @@ ...@@ -20,9 +20,11 @@
struct WOPage struct WOPage
{ {
STATIC_CONST( WOPAGE_WORDS = GLOBAL_PAGE_SIZE_WORDS - 2 );
Uint32 m_type_id; Uint32 m_type_id;
Uint32 m_ref_count; Uint32 m_ref_count;
Uint32 m_data[GLOBAL_PAGE_SIZE_WORDS - 2]; Uint32 m_data[WOPAGE_WORDS];
}; };
/** /**
...@@ -61,7 +63,7 @@ WOPool::seize(Ptr<void>& ptr) ...@@ -61,7 +63,7 @@ WOPool::seize(Ptr<void>& ptr)
Uint32 pos = m_current_pos; Uint32 pos = m_current_pos;
Uint32 size = m_record_info.m_size; Uint32 size = m_record_info.m_size;
WOPage *pageP = m_current_page; WOPage *pageP = m_current_page;
if (likely(pos + size < GLOBAL_PAGE_SIZE_WORDS)) if (likely(pos + size < WOPage::WOPAGE_WORDS))
{ {
ptr.i = (m_current_page_no << POOL_RECORD_BITS) + pos; ptr.i = (m_current_page_no << POOL_RECORD_BITS) + pos;
ptr.p = (pageP->m_data + pos); ptr.p = (pageP->m_data + pos);
......
...@@ -1353,6 +1353,68 @@ runBug26481(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1353,6 +1353,68 @@ runBug26481(NDBT_Context* ctx, NDBT_Step* step)
return NDBT_OK; return NDBT_OK;
} }
int
runBug26450(NDBT_Context* ctx, NDBT_Step* step)
{
Uint32 i;
int result = NDBT_OK;
int loops = ctx->getNumLoops();
int records = ctx->getNumRecords();
NdbRestarter res;
Ndb* pNdb = GETNDB(step);
int node = res.getRandomNotMasterNodeId(rand());
Vector<int> nodes;
for (unsigned i = 0; i<res.getNumDbNodes(); i++)
{
if (res.getDbNodeId(i) != node)
nodes.push_back(res.getDbNodeId(i));
}
if (res.restartAll())
return NDBT_FAILED;
if (res.waitClusterStarted())
return NDBT_FAILED;
ndbout_c("node: %d", node);
if (res.restartOneDbNode(node, false, true, true))
return NDBT_FAILED;
if (res.waitNodesNoStart(&node, 1))
return NDBT_FAILED;
if (runClearTable(ctx, step))
return NDBT_FAILED;
for (i = 0; i < 2; i++)
{
if (res.restartAll(false, true, i > 0))
return NDBT_FAILED;
if (res.waitClusterNoStart())
return NDBT_FAILED;
if (res.startNodes(nodes.getBase(), nodes.size()))
return NDBT_FAILED;
if (res.waitNodesStarted(nodes.getBase(), nodes.size()))
return NDBT_FAILED;
}
if (res.startNodes(&node, 1))
return NDBT_FAILED;
if (res.waitNodesStarted(&node, 1))
return NDBT_FAILED;
HugoTransactions trans (* ctx->getTab());
if (trans.selectCount(pNdb) != 0)
return NDBT_FAILED;
return NDBT_OK;
}
NDBT_TESTSUITE(testNodeRestart); NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad", TESTCASE("NoLoad",
"Test that one node at a time can be stopped and then restarted "\ "Test that one node at a time can be stopped and then restarted "\
...@@ -1697,6 +1759,10 @@ TESTCASE("Bug26457", ""){ ...@@ -1697,6 +1759,10 @@ TESTCASE("Bug26457", ""){
TESTCASE("Bug26481", ""){ TESTCASE("Bug26481", ""){
INITIALIZER(runBug26481); INITIALIZER(runBug26481);
} }
TESTCASE("Bug26450", ""){
INITIALIZER(runLoadTable);
INITIALIZER(runBug26450);
}
NDBT_TESTSUITE_END(testNodeRestart); NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){ int main(int argc, const char** argv){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment