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)
* 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;
......
......@@ -347,6 +347,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();
conf->senderData = senderData;
......@@ -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;
......
......@@ -182,6 +182,7 @@ public:
,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