Commit 65cbaab7 authored by unknown's avatar unknown

ndb - bug#25901

  handle undofile/logfile groups that were created while node was node


storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Make sure that START_RECREQ is run on lgman/tsman even during initial node restart
storage/ndb/src/kernel/blocks/lgman.cpp:
  Set state to LG_STARTING during node/system restart
storage/ndb/src/kernel/blocks/lgman.hpp:
  add new state
parent f19dec39
......@@ -14215,15 +14215,6 @@ void Dblqh::execSTART_RECREQ(Signal* signal)
* WE ALSO NEED TO SET CNEWEST_GCI TO ENSURE THAT LOG RECORDS ARE EXECUTED
* 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())
{
......@@ -14276,6 +14267,19 @@ void Dblqh::execSTART_RECCONF(Signal* signal)
jam();
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);
build_acc(signal, fragptr.i);
return;
......
......@@ -346,6 +346,12 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){
m_logfile_group_hash.add(ptr);
m_logfile_group_list.add(ptr);
if (getNodeState().getNodeRestartInProgress() ||
getNodeState().getSystemRestartInProgress())
{
ptr.p->m_state = Logfile_group::LG_STARTING;
}
CreateFilegroupImplConf* conf=
(CreateFilegroupImplConf*)signal->getDataPtr();
......@@ -370,8 +376,6 @@ Lgman::execDROP_FILEGROUP_REQ(Signal* signal)
{
jamEntry();
jamEntry();
Uint32 errorCode = 0;
DropFilegroupImplReq req = *(DropFilegroupImplReq*)signal->getDataPtr();
do
......@@ -717,7 +721,8 @@ Lgman::create_file_commit(Signal* signal,
Uint32 senderData = ptr.p->m_create.m_senderData;
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();
Local_undofile_list free(m_file_pool, lg_ptr.p->m_files);
......@@ -2082,13 +2087,17 @@ Lgman::execSTART_RECREQ(Signal* signal)
void
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())
{
jam();
/**
* 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);
signal->theData[0] = LgmanContinueB::FIND_LOG_HEAD;
signal->theData[1] = ptr.i;
......
......@@ -175,13 +175,14 @@ public:
,LG_SORTING = 0x002 // Sorting files
,LG_SEARCHING = 0x004 // Searching in last file
,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_SYNC_WAITERS_THREAD = 0x040
,LG_CUT_LOG_THREAD = 0x080
,LG_WAITERS_THREAD = 0x100
,LG_FLUSH_THREAD = 0x200
,LG_DROPPING = 0x400
,LG_STARTING = 0x800
};
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