Commit 4fbf9129 authored by tomas@whalegate.ndb.mysql.com's avatar tomas@whalegate.ndb.mysql.com

Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
parents 1f636676 6d10d459
...@@ -10141,6 +10141,10 @@ static int ndbcluster_fill_files_table(handlerton *hton, ...@@ -10141,6 +10141,10 @@ static int ndbcluster_fill_files_table(handlerton *hton,
{ {
if (ndberr.classification == NdbError::SchemaError) if (ndberr.classification == NdbError::SchemaError)
continue; continue;
if (ndberr.classification == NdbError::UnknownResultError)
continue;
ERR_RETURN(ndberr); ERR_RETURN(ndberr);
} }
NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace()); NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace());
...@@ -10220,6 +10224,8 @@ static int ndbcluster_fill_files_table(handlerton *hton, ...@@ -10220,6 +10224,8 @@ static int ndbcluster_fill_files_table(handlerton *hton,
{ {
if (ndberr.classification == NdbError::SchemaError) if (ndberr.classification == NdbError::SchemaError)
continue; continue;
if (ndberr.classification == NdbError::UnknownResultError)
continue;
ERR_RETURN(ndberr); ERR_RETURN(ndberr);
} }
NdbDictionary::LogfileGroup lfg= NdbDictionary::LogfileGroup lfg=
......
...@@ -11794,6 +11794,13 @@ void Dblqh::sendLCP_COMPLETE_REP(Signal* signal, Uint32 lcpId) ...@@ -11794,6 +11794,13 @@ void Dblqh::sendLCP_COMPLETE_REP(Signal* signal, Uint32 lcpId)
jam(); jam();
sendEMPTY_LCP_CONF(signal, true); sendEMPTY_LCP_CONF(signal, true);
} }
if (getNodeState().getNodeRestartInProgress())
{
jam();
ndbrequire(cstartRecReq == 2);
cstartRecReq = 3;
}
return; return;
}//Dblqh::sendCOMP_LCP_ROUND() }//Dblqh::sendCOMP_LCP_ROUND()
...@@ -12064,16 +12071,28 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal) ...@@ -12064,16 +12071,28 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal)
}//if }//if
ndbrequire(ccurrentGcprec == RNIL); ndbrequire(ccurrentGcprec == RNIL);
ccurrentGcprec = 0;
gcpPtr.i = ccurrentGcprec;
ptrCheckGuard(gcpPtr, cgcprecFileSize, gcpRecord);
cnewestCompletedGci = gci; cnewestCompletedGci = gci;
if (gci > cnewestGci) { if (gci > cnewestGci) {
jam(); jam();
cnewestGci = gci; cnewestGci = gci;
}//if }//if
if(getNodeState().getNodeRestartInProgress() && cstartRecReq < 3)
{
GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0];
saveRef->dihPtr = dihPtr;
saveRef->nodeId = getOwnNodeId();
saveRef->gci = gci;
saveRef->errorCode = GCPSaveRef::NodeRestartInProgress;
sendSignal(dihBlockRef, GSN_GCP_SAVEREF, signal,
GCPSaveRef::SignalLength, JBB);
return;
}
ccurrentGcprec = 0;
gcpPtr.i = ccurrentGcprec;
ptrCheckGuard(gcpPtr, cgcprecFileSize, gcpRecord);
gcpPtr.p->gcpBlockref = dihBlockRef; gcpPtr.p->gcpBlockref = dihBlockRef;
gcpPtr.p->gcpUserptr = dihPtr; gcpPtr.p->gcpUserptr = dihPtr;
gcpPtr.p->gcpId = gci; gcpPtr.p->gcpId = gci;
...@@ -14196,15 +14215,6 @@ void Dblqh::execSTART_RECREQ(Signal* signal) ...@@ -14196,15 +14215,6 @@ void Dblqh::execSTART_RECREQ(Signal* signal)
* WE ALSO NEED TO SET CNEWEST_GCI TO ENSURE THAT LOG RECORDS ARE EXECUTED * WE ALSO NEED TO SET CNEWEST_GCI TO ENSURE THAT LOG RECORDS ARE EXECUTED
* WITH A PROPER GCI. * WITH A PROPER GCI.
*------------------------------------------------------------------------ */ *------------------------------------------------------------------------ */
if(cstartType == NodeState::ST_INITIAL_NODE_RESTART){
jam();
cstartRecReq = 2;
StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
conf->startingNodeId = getOwnNodeId();
sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
StartRecConf::SignalLength, JBB);
return;
}//if
if (c_lcp_restoring_fragments.isEmpty()) if (c_lcp_restoring_fragments.isEmpty())
{ {
...@@ -14257,6 +14267,19 @@ void Dblqh::execSTART_RECCONF(Signal* signal) ...@@ -14257,6 +14267,19 @@ void Dblqh::execSTART_RECCONF(Signal* signal)
jam(); jam();
csrExecUndoLogState = EULS_COMPLETED; csrExecUndoLogState = EULS_COMPLETED;
if(cstartType == NodeState::ST_INITIAL_NODE_RESTART)
{
jam();
cstartRecReq = 2;
StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
conf->startingNodeId = getOwnNodeId();
sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
StartRecConf::SignalLength, JBB);
return;
}
c_lcp_complete_fragments.first(fragptr); c_lcp_complete_fragments.first(fragptr);
build_acc(signal, fragptr.i); build_acc(signal, fragptr.i);
return; return;
......
...@@ -347,6 +347,12 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){ ...@@ -347,6 +347,12 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){
m_logfile_group_hash.add(ptr); m_logfile_group_hash.add(ptr);
m_logfile_group_list.add(ptr); m_logfile_group_list.add(ptr);
if (getNodeState().getNodeRestartInProgress() ||
getNodeState().getSystemRestartInProgress())
{
ptr.p->m_state = Logfile_group::LG_STARTING;
}
CreateFilegroupImplConf* conf= CreateFilegroupImplConf* conf=
(CreateFilegroupImplConf*)signal->getDataPtr(); (CreateFilegroupImplConf*)signal->getDataPtr();
conf->senderData = senderData; conf->senderData = senderData;
...@@ -370,8 +376,6 @@ Lgman::execDROP_FILEGROUP_REQ(Signal* signal) ...@@ -370,8 +376,6 @@ Lgman::execDROP_FILEGROUP_REQ(Signal* signal)
{ {
jamEntry(); jamEntry();
jamEntry();
Uint32 errorCode = 0; Uint32 errorCode = 0;
DropFilegroupImplReq req = *(DropFilegroupImplReq*)signal->getDataPtr(); DropFilegroupImplReq req = *(DropFilegroupImplReq*)signal->getDataPtr();
do do
...@@ -717,7 +721,8 @@ Lgman::create_file_commit(Signal* signal, ...@@ -717,7 +721,8 @@ Lgman::create_file_commit(Signal* signal,
Uint32 senderData = ptr.p->m_create.m_senderData; Uint32 senderData = ptr.p->m_create.m_senderData;
bool first= false; bool first= false;
if(ptr.p->m_state == Undofile::FS_CREATING) if(ptr.p->m_state == Undofile::FS_CREATING &&
(lg_ptr.p->m_state & Logfile_group::LG_ONLINE))
{ {
jam(); jam();
Local_undofile_list free(m_file_pool, lg_ptr.p->m_files); Local_undofile_list free(m_file_pool, lg_ptr.p->m_files);
...@@ -2082,13 +2087,17 @@ Lgman::execSTART_RECREQ(Signal* signal) ...@@ -2082,13 +2087,17 @@ Lgman::execSTART_RECREQ(Signal* signal)
void void
Lgman::find_log_head(Signal* signal, Ptr<Logfile_group> ptr) Lgman::find_log_head(Signal* signal, Ptr<Logfile_group> ptr)
{ {
ndbrequire(ptr.p->m_state &
(Logfile_group::LG_STARTING | Logfile_group::LG_SORTING));
if(ptr.p->m_meta_files.isEmpty() && ptr.p->m_files.isEmpty()) if(ptr.p->m_meta_files.isEmpty() && ptr.p->m_files.isEmpty())
{ {
jam(); jam();
/** /**
* Logfile_group wo/ any files * Logfile_group wo/ any files
*/ */
ptr.p->m_state &= ~(Uint32)Logfile_group::LG_STARTING;
ptr.p->m_state |= Logfile_group::LG_ONLINE;
m_logfile_group_list.next(ptr); m_logfile_group_list.next(ptr);
signal->theData[0] = LgmanContinueB::FIND_LOG_HEAD; signal->theData[0] = LgmanContinueB::FIND_LOG_HEAD;
signal->theData[1] = ptr.i; signal->theData[1] = ptr.i;
......
...@@ -182,6 +182,7 @@ public: ...@@ -182,6 +182,7 @@ public:
,LG_WAITERS_THREAD = 0x100 ,LG_WAITERS_THREAD = 0x100
,LG_FLUSH_THREAD = 0x200 ,LG_FLUSH_THREAD = 0x200
,LG_DROPPING = 0x400 ,LG_DROPPING = 0x400
,LG_STARTING = 0x800
}; };
static const Uint32 LG_THREAD_MASK = Logfile_group::LG_FORCE_SYNC_THREAD | static const Uint32 LG_THREAD_MASK = Logfile_group::LG_FORCE_SYNC_THREAD |
......
...@@ -391,7 +391,7 @@ struct NdbFileImpl : public NdbDictObjectImpl { ...@@ -391,7 +391,7 @@ struct NdbFileImpl : public NdbDictObjectImpl {
NdbFileImpl(NdbDictionary::Object::Type t); NdbFileImpl(NdbDictionary::Object::Type t);
Uint64 m_size; Uint64 m_size;
Uint32 m_free; Uint64 m_free;
BaseString m_path; BaseString m_path;
BaseString m_filegroup_name; BaseString m_filegroup_name;
Uint32 m_filegroup_id; Uint32 m_filegroup_id;
......
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