Commit 985c1d79 authored by unknown's avatar unknown

Merge mysqldev@production.mysql.com:my/mysql-5.1-release

into  poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb

parents 0943e98e 9276064f
......@@ -963,7 +963,7 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
ROW(NDBStopCompleted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(NDBStopForced, LogLevel::llStartUp, 1, Logger::LL_ALERT ),
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(UNDORecordsExecuted, LogLevel::llStartUp, 15, Logger::LL_INFO ),
ROW(StartReport, LogLevel::llStartUp, 4, Logger::LL_INFO ),
......
......@@ -12251,6 +12251,10 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
// Set the prev file to check if we shall close it.
logFilePtr.i = logFilePtr.p->prevLogFile;
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
logPartPtr.i = logFilePtr.p->logPartRec;
ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
exitFromInvalidate(signal);
return;
case LogFileRecord::CLOSING_INIT:
......
......@@ -1840,6 +1840,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
ndbrequire(m_file_hash.find(file_ptr, file_key));
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;
preq.m_page.m_page_no = val.m_extent_page_no;
......@@ -1865,7 +1866,6 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
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 shift = SZ * (page_no_in_extent & 7);
......@@ -1925,8 +1925,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal)
found:
header->update_free_bits(page_no, src_bits | UNCOMMITTED_MASK);
rep->bits= (src_bits & UNCOMMITTED_MASK) >> UNCOMMITTED_SHIFT;
rep->key.m_page_no=
val.m_extent_pages + val.m_extent_no * val.m_extent_size + page_no;
rep->key.m_page_no = req.key.m_page_no + page_no - page_no_in_extent;
rep->reply.errorCode= 0;
return;
}
......
......@@ -22,7 +22,7 @@
RWPool::RWPool()
{
bzero(this, sizeof(* this));
m_current_pos = GLOBAL_PAGE_SIZE_WORDS;
m_current_pos = RWPage::RWPAGE_WORDS;
m_current_first_free = REC_NIL;
m_first_free_page = RNIL;
}
......@@ -57,7 +57,7 @@ seize_free:
m_current_first_free = pageP->m_data[pos+m_record_info.m_offset_next_pool];
return true;
}
else if (pos + size < GLOBAL_PAGE_SIZE_WORDS)
else if (pos + size < RWPage::RWPAGE_WORDS)
{
seize_first:
ptr.i = (m_current_page_no << POOL_RECORD_BITS) + pos;
......@@ -81,11 +81,14 @@ seize_first:
{
pageP = m_current_page = m_memroot + 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_first_free_page = m_current_page->m_next_page;
m_current_ref_count = m_current_page->m_ref_count;
(m_memroot + m_first_free_page)->m_prev_page = RNIL;
if (m_first_free_page != RNIL)
{
(m_memroot + m_first_free_page)->m_prev_page = RNIL;
}
goto seize_free;
}
......@@ -105,7 +108,7 @@ seize_first:
m_current_page = 0;
m_current_page_no = RNIL;
m_current_pos = GLOBAL_PAGE_SIZE_WORDS;
m_current_pos = RWPage::RWPAGE_WORDS;
m_current_first_free = REC_NIL;
return false;
......@@ -154,6 +157,7 @@ RWPool::release(Ptr<void> ptr)
}
page->m_next_page = ffp;
page->m_prev_page = RNIL;
m_first_free_page = ptr_page;
return;
}
else if(ref_cnt == 1)
......
......@@ -20,12 +20,14 @@
struct RWPage
{
STATIC_CONST( RWPAGE_WORDS = GLOBAL_PAGE_SIZE_WORDS - 4 );
Uint32 m_type_id;
Uint16 m_first_free;
Uint16 m_ref_count;
Uint32 m_next_page;
Uint32 m_prev_page;
Uint32 m_data[GLOBAL_PAGE_SIZE_WORDS - 4];
Uint32 m_data[RWPAGE_WORDS];
};
/**
......
......@@ -20,7 +20,7 @@
WOPool::WOPool()
{
bzero(this, sizeof(* this));
m_current_pos = GLOBAL_PAGE_SIZE_WORDS;
m_current_pos = WOPage::WOPAGE_WORDS;
}
void
......
......@@ -20,9 +20,11 @@
struct WOPage
{
STATIC_CONST( WOPAGE_WORDS = GLOBAL_PAGE_SIZE_WORDS - 2 );
Uint32 m_type_id;
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)
Uint32 pos = m_current_pos;
Uint32 size = m_record_info.m_size;
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.p = (pageP->m_data + pos);
......
......@@ -1353,6 +1353,68 @@ runBug26481(NDBT_Context* ctx, NDBT_Step* step)
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);
TESTCASE("NoLoad",
"Test that one node at a time can be stopped and then restarted "\
......@@ -1697,6 +1759,10 @@ TESTCASE("Bug26457", ""){
TESTCASE("Bug26481", ""){
INITIALIZER(runBug26481);
}
TESTCASE("Bug26450", ""){
INITIALIZER(runLoadTable);
INITIALIZER(runBug26450);
}
NDBT_TESTSUITE_END(testNodeRestart);
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