ndb - bug#25901

  handle undofile/logfile groups that were created while node was node
parent af76e150
...@@ -14215,15 +14215,6 @@ void Dblqh::execSTART_RECREQ(Signal* signal) ...@@ -14215,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())
{ {
...@@ -14276,6 +14267,19 @@ void Dblqh::execSTART_RECCONF(Signal* signal) ...@@ -14276,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;
......
...@@ -346,6 +346,12 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){ ...@@ -346,6 +346,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();
...@@ -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;
......
...@@ -175,13 +175,14 @@ public: ...@@ -175,13 +175,14 @@ public:
,LG_SORTING = 0x002 // Sorting files ,LG_SORTING = 0x002 // Sorting files
,LG_SEARCHING = 0x004 // Searching in last file ,LG_SEARCHING = 0x004 // Searching in last file
,LG_EXEC_THREAD = 0x008 // Execute thread is running ,LG_EXEC_THREAD = 0x008 // Execute thread is running
,LG_READ_THREAD = 0x010 // Read thread is running ,LG_READ_THREAD = 0x010 // Read thread is running
,LG_FORCE_SYNC_THREAD = 0x020 ,LG_FORCE_SYNC_THREAD = 0x020
,LG_SYNC_WAITERS_THREAD = 0x040 ,LG_SYNC_WAITERS_THREAD = 0x040
,LG_CUT_LOG_THREAD = 0x080 ,LG_CUT_LOG_THREAD = 0x080
,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 |
......
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