Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
ea88a770
Commit
ea88a770
authored
Jun 25, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-telco-gca
into perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
parents
6b25b945
5201c499
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
265 additions
and
85 deletions
+265
-85
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
+3
-2
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+262
-83
No files found.
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
View file @
ea88a770
...
@@ -1585,7 +1585,8 @@ public:
...
@@ -1585,7 +1585,8 @@ public:
ACTIVE_WRITE_LOG
=
17
,
///< A write operation during
ACTIVE_WRITE_LOG
=
17
,
///< A write operation during
///< writing of log
///< writing of log
READ_SR_INVALIDATE_PAGES
=
18
,
READ_SR_INVALIDATE_PAGES
=
18
,
WRITE_SR_INVALIDATE_PAGES
=
19
WRITE_SR_INVALIDATE_PAGES
=
19
,
WRITE_SR_INVALIDATE_PAGES_UPDATE_PAGE0
=
20
};
};
/**
/**
* We have to remember the log pages read.
* We have to remember the log pages read.
...
@@ -2381,7 +2382,7 @@ private:
...
@@ -2381,7 +2382,7 @@ private:
void
errorReport
(
Signal
*
signal
,
int
place
);
void
errorReport
(
Signal
*
signal
,
int
place
);
void
warningReport
(
Signal
*
signal
,
int
place
);
void
warningReport
(
Signal
*
signal
,
int
place
);
void
invalidateLogAfterLastGCI
(
Signal
*
signal
);
void
invalidateLogAfterLastGCI
(
Signal
*
signal
);
void
readFileInInvalidate
(
Signal
*
signal
);
void
readFileInInvalidate
(
Signal
*
signal
,
bool
stepNext
);
void
exitFromInvalidate
(
Signal
*
signal
);
void
exitFromInvalidate
(
Signal
*
signal
);
Uint32
calcPageCheckSum
(
LogPageRecordPtr
logP
);
Uint32
calcPageCheckSum
(
LogPageRecordPtr
logP
);
Uint32
handleLongTupKey
(
Signal
*
signal
,
Uint32
*
dataPtr
,
Uint32
len
);
Uint32
handleLongTupKey
(
Signal
*
signal
,
Uint32
*
dataPtr
,
Uint32
len
);
...
...
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
View file @
ea88a770
...
@@ -139,6 +139,10 @@ operator<<(NdbOut& out, Operation_t op)
...
@@ -139,6 +139,10 @@ operator<<(NdbOut& out, Operation_t op)
//#define MARKER_TRACE 1
//#define MARKER_TRACE 1
//#define TRACE_SCAN_TAKEOVER 1
//#define TRACE_SCAN_TAKEOVER 1
#ifndef DEBUG_REDO
#define DEBUG_REDO 0
#endif
const
Uint32
NR_ScanNo
=
0
;
const
Uint32
NR_ScanNo
=
0
;
#if defined VM_TRACE || defined ERROR_INSERT || defined NDBD_TRACENR
#if defined VM_TRACE || defined ERROR_INSERT || defined NDBD_TRACENR
...
@@ -12280,9 +12284,6 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
...
@@ -12280,9 +12284,6 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
case
LogFileRecord
:
:
CLOSE_SR_INVALIDATE_PAGES
:
case
LogFileRecord
:
:
CLOSE_SR_INVALIDATE_PAGES
:
jam
();
jam
();
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
CLOSED
;
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
CLOSED
;
// 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
;
logPartPtr
.
i
=
logFilePtr
.
p
->
logPartRec
;
ptrCheckGuard
(
logPartPtr
,
clogPartFileSize
,
logPartRecord
);
ptrCheckGuard
(
logPartPtr
,
clogPartFileSize
,
logPartRecord
);
...
@@ -12332,7 +12333,7 @@ void Dblqh::execFSOPENCONF(Signal* signal)
...
@@ -12332,7 +12333,7 @@ void Dblqh::execFSOPENCONF(Signal* signal)
case
LogFileRecord
:
:
OPEN_SR_INVALIDATE_PAGES
:
case
LogFileRecord
:
:
OPEN_SR_INVALIDATE_PAGES
:
jam
();
jam
();
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
OPEN
;
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
OPEN
;
readFileInInvalidate
(
signal
);
readFileInInvalidate
(
signal
,
false
);
return
;
return
;
case
LogFileRecord
:
:
OPENING_INIT
:
case
LogFileRecord
:
:
OPENING_INIT
:
jam
();
jam
();
...
@@ -12532,6 +12533,7 @@ void Dblqh::execFSWRITECONF(Signal* signal)
...
@@ -12532,6 +12533,7 @@ void Dblqh::execFSWRITECONF(Signal* signal)
case
LogFileOperationRecord
:
:
WRITE_SR_INVALIDATE_PAGES
:
case
LogFileOperationRecord
:
:
WRITE_SR_INVALIDATE_PAGES
:
jam
();
jam
();
invalidateLogAfterLastGCI
(
signal
);
invalidateLogAfterLastGCI
(
signal
);
CRASH_INSERTION
(
5047
);
return
;
return
;
case
LogFileOperationRecord
:
:
WRITE_PAGE_ZERO
:
case
LogFileOperationRecord
:
:
WRITE_PAGE_ZERO
:
jam
();
jam
();
...
@@ -12569,6 +12571,14 @@ void Dblqh::execFSWRITECONF(Signal* signal)
...
@@ -12569,6 +12571,14 @@ void Dblqh::execFSWRITECONF(Signal* signal)
jam
();
jam
();
firstPageWriteLab
(
signal
);
firstPageWriteLab
(
signal
);
return
;
return
;
case
LogFileOperationRecord
:
:
WRITE_SR_INVALIDATE_PAGES_UPDATE_PAGE0
:
jam
();
// We are done...send completed signal and exit this phase.
releaseLfo
(
signal
);
signal
->
theData
[
0
]
=
ZSR_FOURTH_COMP
;
signal
->
theData
[
1
]
=
logPartPtr
.
i
;
sendSignal
(
cownref
,
GSN_CONTINUEB
,
signal
,
2
,
JBB
);
return
;
default:
default:
jam
();
jam
();
systemErrorLab
(
signal
,
__LINE__
);
systemErrorLab
(
signal
,
__LINE__
);
...
@@ -13647,6 +13657,12 @@ void Dblqh::writeSinglePage(Signal* signal, Uint32 pageNo,
...
@@ -13647,6 +13657,12 @@ void Dblqh::writeSinglePage(Signal* signal, Uint32 pageNo,
signal
->
theData
[
6
]
=
logPagePtr
.
i
;
signal
->
theData
[
6
]
=
logPagePtr
.
i
;
signal
->
theData
[
7
]
=
pageNo
;
signal
->
theData
[
7
]
=
pageNo
;
sendSignal
(
NDBFS_REF
,
GSN_FSWRITEREQ
,
signal
,
8
,
JBA
);
sendSignal
(
NDBFS_REF
,
GSN_FSWRITEREQ
,
signal
,
8
,
JBA
);
if
(
DEBUG_REDO
)
ndbout_c
(
"writeSingle 1 page at part: %u file: %u pos: %u"
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
pageNo
);
}
//Dblqh::writeSinglePage()
}
//Dblqh::writeSinglePage()
/* ##########################################################################
/* ##########################################################################
...
@@ -13712,6 +13728,12 @@ void Dblqh::openSrLastFileLab(Signal* signal)
...
@@ -13712,6 +13728,12 @@ void Dblqh::openSrLastFileLab(Signal* signal)
void
Dblqh
::
readSrLastFileLab
(
Signal
*
signal
)
void
Dblqh
::
readSrLastFileLab
(
Signal
*
signal
)
{
{
logPartPtr
.
p
->
logLap
=
logPagePtr
.
p
->
logPageWord
[
ZPOS_LOG_LAP
];
logPartPtr
.
p
->
logLap
=
logPagePtr
.
p
->
logPageWord
[
ZPOS_LOG_LAP
];
if
(
DEBUG_REDO
)
ndbout_c
(
"readSrLastFileLab part: %u logExecState: %u logPartState: %u logLap: %u"
,
logPartPtr
.
i
,
logPartPtr
.
p
->
logExecState
,
logPartPtr
.
p
->
logPartState
,
logPartPtr
.
p
->
logLap
);
if
(
logPartPtr
.
p
->
noLogFiles
>
cmaxLogFilesInPageZero
)
{
if
(
logPartPtr
.
p
->
noLogFiles
>
cmaxLogFilesInPageZero
)
{
jam
();
jam
();
initGciInLogFileRec
(
signal
,
cmaxLogFilesInPageZero
);
initGciInLogFileRec
(
signal
,
cmaxLogFilesInPageZero
);
...
@@ -14783,6 +14805,20 @@ void Dblqh::srLogLimits(Signal* signal)
...
@@ -14783,6 +14805,20 @@ void Dblqh::srLogLimits(Signal* signal)
break
;
break
;
}
//if
}
//if
}
//while
}
//while
if
(
DEBUG_REDO
)
{
LogFileRecordPtr
tmp
;
tmp
.
i
=
logPartPtr
.
p
->
stopLogfile
;
ptrCheckGuard
(
tmp
,
clogFileFileSize
,
logFileRecord
);
ndbout_c
(
"srLogLimits part: %u start file: %u mb: %u stop file: %u mb: %u"
,
logPartPtr
.
i
,
tlastPrepRef
>>
16
,
tlastPrepRef
&
65535
,
tmp
.
p
->
fileNo
,
logPartPtr
.
p
->
stopMbyte
);
}
/* ------------------------------------------------------------------------
/* ------------------------------------------------------------------------
* WE HAVE NOW FOUND BOTH THE START AND THE STOP OF THE LOG. NOW START
* WE HAVE NOW FOUND BOTH THE START AND THE STOP OF THE LOG. NOW START
* EXECUTING THE LOG. THE FIRST ACTION IS TO OPEN THE LOG FILE WHERE TO
* EXECUTING THE LOG. THE FIRST ACTION IS TO OPEN THE LOG FILE WHERE TO
...
@@ -15209,6 +15245,12 @@ void Dblqh::execSr(Signal* signal)
...
@@ -15209,6 +15245,12 @@ void Dblqh::execSr(Signal* signal)
case
ZCOMPLETED_GCI_TYPE
:
case
ZCOMPLETED_GCI_TYPE
:
jam
();
jam
();
logWord
=
readLogword
(
signal
);
logWord
=
readLogword
(
signal
);
if
(
DEBUG_REDO
)
ndbout_c
(
"found gci: %u part: %u file: %u page: %u"
,
logWord
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
logFilePtr
.
p
->
currentFilepage
);
if
(
logWord
==
logPartPtr
.
p
->
logLastGci
)
{
if
(
logWord
==
logPartPtr
.
p
->
logLastGci
)
{
jam
();
jam
();
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
...
@@ -15225,6 +15267,10 @@ void Dblqh::execSr(Signal* signal)
...
@@ -15225,6 +15267,10 @@ void Dblqh::execSr(Signal* signal)
logPartPtr
.
p
->
headPageNo
=
logFilePtr
.
p
->
currentFilepage
;
logPartPtr
.
p
->
headPageNo
=
logFilePtr
.
p
->
currentFilepage
;
logPartPtr
.
p
->
headPageIndex
=
logPartPtr
.
p
->
headPageIndex
=
logPagePtr
.
p
->
logPageWord
[
ZCURR_PAGE_INDEX
];
logPagePtr
.
p
->
logPageWord
[
ZCURR_PAGE_INDEX
];
logPartPtr
.
p
->
logLap
=
logPagePtr
.
p
->
logPageWord
[
ZPOS_LOG_LAP
];
if
(
DEBUG_REDO
)
ndbout_c
(
"execSr part: %u logLap: %u"
,
logPartPtr
.
i
,
logPartPtr
.
p
->
logLap
);
}
//if
}
//if
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* THERE IS NO NEED OF EXECUTING PAST THIS LINE SINCE THERE WILL ONLY BE LOG */
/* THERE IS NO NEED OF EXECUTING PAST THIS LINE SINCE THERE WILL ONLY BE LOG */
...
@@ -15389,67 +15435,140 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) {
...
@@ -15389,67 +15435,140 @@ void Dblqh::invalidateLogAfterLastGCI(Signal* signal) {
}
}
switch
(
lfoPtr
.
p
->
lfoState
)
{
switch
(
lfoPtr
.
p
->
lfoState
)
{
case
LogFileOperationRecord
:
:
READ_SR_INVALIDATE_PAGES
:
jam
();
// Check if this page must be invalidated.
// If the log lap number on a page after the head of the tail is the same
// as the actual log lap number we must invalidate this page. Otherwise it
// could be impossible to find the end of the log in a later system/node
// restart.
if
(
logPagePtr
.
p
->
logPageWord
[
ZPOS_LOG_LAP
]
==
logPartPtr
.
p
->
logLap
)
{
// This page must be invalidated.
// We search for end
// read next
releaseLfo
(
signal
);
releaseLogpage
(
signal
);
readFileInInvalidate
(
signal
,
true
);
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
READ_SR_INVALIDATE_PAGES
;
return
;
}
/**
* We found the "last" page to invalidate...
* Invalidate backwards until head...
*/
// Fall through...
case
LogFileOperationRecord
:
:
WRITE_SR_INVALIDATE_PAGES
:
case
LogFileOperationRecord
:
:
WRITE_SR_INVALIDATE_PAGES
:
jam
();
jam
();
releaseLfo
(
signal
);
releaseLfo
(
signal
);
releaseLogpage
(
signal
);
releaseLogpage
(
signal
);
if
(
logPartPtr
.
p
->
invalidatePageNo
<
(
clogFileSize
*
ZPAGES_IN_MBYTE
-
1
))
{
// We continue in this file.
// Step backwards...
logPartPtr
.
p
->
invalidatePageNo
++
;
logPartPtr
.
p
->
invalidatePageNo
--
;
}
else
{
// We continue in the next file.
if
(
logPartPtr
.
p
->
invalidatePageNo
==
0
)
logFilePtr
.
i
=
logFilePtr
.
p
->
nextLogFile
;
{
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
logPartPtr
.
p
->
invalidateFileNo
=
logFilePtr
.
p
->
fileNo
;
// Page 0 is used for file descriptors.
logPartPtr
.
p
->
invalidatePageNo
=
1
;
if
(
logFilePtr
.
p
->
logFileStatus
!=
LogFileRecord
::
OPEN
)
{
jam
();
jam
();
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
OPEN_SR_INVALIDATE_PAGES
;
openFileRw
(
signal
,
logFilePtr
);
if
(
logFilePtr
.
p
->
fileNo
==
0
)
return
;
{
break
;
/**
* We're wrapping in the log...
* update logLap
*/
logPartPtr
.
p
->
logLap
--
;
ndbrequire
(
logPartPtr
.
p
->
logLap
);
// Should always be > 0
if
(
DEBUG_REDO
)
ndbout_c
(
"invalidateLogAfterLastGCI part: %u wrap from file 0 -> logLap: %u"
,
logPartPtr
.
i
,
logPartPtr
.
p
->
logLap
);
}
}
/**
* Move to prev file
*/
logFilePtr
.
i
=
logFilePtr
.
p
->
prevLogFile
;
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
logPartPtr
.
p
->
invalidateFileNo
=
logFilePtr
.
p
->
fileNo
;
logPartPtr
.
p
->
invalidatePageNo
=
clogFileSize
*
ZPAGES_IN_MBYTE
-
1
;
}
}
// Read a page from the log file.
readFileInInvalidate
(
signal
);
if
(
logPartPtr
.
p
->
invalidateFileNo
==
logPartPtr
.
p
->
headFileNo
&&
logPartPtr
.
p
->
invalidatePageNo
==
logPartPtr
.
p
->
headPageNo
)
{
/**
* Done...
*/
logFilePtr
.
i
=
logPartPtr
.
p
->
currentLogfile
;
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
logFilePtr
.
i
=
logFilePtr
.
p
->
nextLogFile
;
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
// Close files if necessary. Current file and the next file should be
// left open.
exitFromInvalidate
(
signal
);
return
;
return
;
break
;
}
case
LogFileOperationRecord
:
:
READ_SR_INVALIDATE_PAGES
:
seizeLogpage
(
signal
);
jam
();
releaseLfo
(
signal
);
/**
// Check if this page must be invalidated.
* Make page really empty
// If the log lap number on a page after the head of the tail is the same
*/
// as the actual log lap number we must invalidate this page. Otherwise it
bzero
(
logPagePtr
.
p
,
sizeof
(
LogPageRecord
));
// could be impossible to find the end of the log in a later system/node
// restart.
if
(
logPagePtr
.
p
->
logPageWord
[
ZPOS_LOG_LAP
]
==
logPartPtr
.
p
->
logLap
)
{
// This page must be invalidated.
logPagePtr
.
p
->
logPageWord
[
ZPOS_LOG_LAP
]
=
0
;
// Contact NDBFS. Real time break.
writeSinglePage
(
signal
,
logPartPtr
.
p
->
invalidatePageNo
,
writeSinglePage
(
signal
,
logPartPtr
.
p
->
invalidatePageNo
,
ZPAGE_SIZE
-
1
,
__LINE__
);
ZPAGE_SIZE
-
1
,
__LINE__
);
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
WRITE_SR_INVALIDATE_PAGES
;
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
WRITE_SR_INVALIDATE_PAGES
;
}
else
{
// We are done with invalidating. Finish start phase 3.4.
exitFromInvalidate
(
signal
);
}
return
;
return
;
break
;
default:
default:
jam
();
jam
();
systemError
(
signal
,
__LINE__
);
systemError
(
signal
,
__LINE__
);
return
;
return
;
break
;
break
;
}
}
return
;
}
//Dblqh::invalidateLogAfterLastGCI
}
//Dblqh::invalidateLogAfterLastGCI
void
Dblqh
::
readFileInInvalidate
(
Signal
*
signal
)
{
void
Dblqh
::
readFileInInvalidate
(
Signal
*
signal
,
bool
stepNext
)
{
jam
();
jam
();
if
(
stepNext
)
{
logPartPtr
.
p
->
invalidatePageNo
++
;
if
(
logPartPtr
.
p
->
invalidatePageNo
==
(
clogFileSize
*
ZPAGES_IN_MBYTE
))
{
// We continue in the next file.
logFilePtr
.
i
=
logFilePtr
.
p
->
nextLogFile
;
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
logPartPtr
.
p
->
invalidateFileNo
=
logFilePtr
.
p
->
fileNo
;
// Page 0 is used for file descriptors.
logPartPtr
.
p
->
invalidatePageNo
=
1
;
if
(
logFilePtr
.
p
->
fileNo
==
0
)
{
/**
* We're wrapping in the log...
* update logLap
*/
logPartPtr
.
p
->
logLap
++
;
if
(
DEBUG_REDO
)
ndbout_c
(
"readFileInInvalidate part: %u wrap to file 0 -> logLap: %u"
,
logPartPtr
.
i
,
logPartPtr
.
p
->
logLap
);
}
if
(
logFilePtr
.
p
->
logFileStatus
!=
LogFileRecord
::
OPEN
)
{
jam
();
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
OPEN_SR_INVALIDATE_PAGES
;
openFileRw
(
signal
,
logFilePtr
);
return
;
}
}
}
// Contact NDBFS. Real time break.
// Contact NDBFS. Real time break.
readSinglePage
(
signal
,
logPartPtr
.
p
->
invalidatePageNo
);
readSinglePage
(
signal
,
logPartPtr
.
p
->
invalidatePageNo
);
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
READ_SR_INVALIDATE_PAGES
;
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
READ_SR_INVALIDATE_PAGES
;
...
@@ -15457,35 +15576,58 @@ void Dblqh::readFileInInvalidate(Signal* signal) {
...
@@ -15457,35 +15576,58 @@ void Dblqh::readFileInInvalidate(Signal* signal) {
void
Dblqh
::
exitFromInvalidate
(
Signal
*
signal
)
{
void
Dblqh
::
exitFromInvalidate
(
Signal
*
signal
)
{
jam
();
jam
();
// Close files if necessary. Current file and the next file should be
// left open.
if
(
logFilePtr
.
i
!=
logPartPtr
.
p
->
currentLogfile
)
{
LogFileRecordPtr
currentLogFilePtr
;
LogFileRecordPtr
nextAfterCurrentLogFilePtr
;
currentLogFilePtr
.
i
=
logPartPtr
.
p
->
currentLogfile
;
loop:
ptrCheckGuard
(
currentLogFilePtr
,
clogFileFileSize
,
logFileRecord
);
logFilePtr
.
i
=
logFilePtr
.
p
->
nextLogFile
;
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
nextAfterCurrentLogFilePtr
.
i
=
currentLogFilePtr
.
p
->
nextLogFile
;
if
(
logFilePtr
.
i
==
logPartPtr
.
p
->
currentLogfile
)
{
jam
();
goto
done
;
}
if
(
logFilePtr
.
p
->
fileNo
==
0
)
{
jam
();
/**
* Logfile 0 shoult *not* be closed
*/
goto
loop
;
}
if
(
logFilePtr
.
p
->
logFileStatus
==
LogFileRecord
::
CLOSED
)
{
jam
();
goto
done
;
}
if
(
logFilePtr
.
i
!=
nextAfterCurrentLogFilePtr
.
i
)
{
jam
();
// This file should be closed.
ndbrequire
(
logFilePtr
.
p
->
logFileStatus
==
LogFileRecord
::
OPEN
);
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
CLOSE_SR_INVALIDATE_PAGES
;
logFilePtr
.
p
->
logFileStatus
=
LogFileRecord
::
CLOSE_SR_INVALIDATE_PAGES
;
closeFile
(
signal
,
logFilePtr
,
__LINE__
);
closeFile
(
signal
,
logFilePtr
,
__LINE__
);
// Return from this function and wait for close confirm. Then come back
// and test the previous file for closing.
return
;
return
;
}
}
// We are done with closing files, send completed signal and exit this phase.
done:
signal
->
theData
[
0
]
=
ZSR_FOURTH_COMP
;
if
(
DEBUG_REDO
)
signal
->
theData
[
1
]
=
logPartPtr
.
i
;
ndbout_c
(
"exitFromInvalidate part: %u head file: %u page: %u"
,
sendSignal
(
cownref
,
GSN_CONTINUEB
,
signal
,
2
,
JBB
);
logPartPtr
.
i
,
logPartPtr
.
p
->
headFileNo
,
logPartPtr
.
p
->
headPageNo
);
logFilePtr
.
i
=
logPartPtr
.
p
->
firstLogfile
;
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
logPagePtr
.
i
=
logFilePtr
.
p
->
logPageZero
;
ptrCheckGuard
(
logPagePtr
,
clogPageFileSize
,
logPageRecord
);
logPagePtr
.
p
->
logPageWord
[
ZPAGE_HEADER_SIZE
+
ZPOS_FILE_NO
]
=
logPartPtr
.
p
->
headFileNo
;
writeSinglePage
(
signal
,
0
,
ZPAGE_SIZE
-
1
,
__LINE__
);
lfoPtr
.
p
->
logFileRec
=
logFilePtr
.
i
;
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
WRITE_SR_INVALIDATE_PAGES_UPDATE_PAGE0
;
return
;
return
;
}
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* THE EXECUTION OF A LOG RECORD IS COMPLETED. RELEASE PAGES IF THEY WERE */
/* THE EXECUTION OF A LOG RECORD IS COMPLETED. RELEASE PAGES IF THEY WERE */
/* READ FROM DISK FOR THIS PARTICULAR OPERATION. */
/* READ FROM DISK FOR THIS PARTICULAR OPERATION. */
...
@@ -15876,20 +16018,10 @@ void Dblqh::readSrFourthZeroLab(Signal* signal)
...
@@ -15876,20 +16018,10 @@ void Dblqh::readSrFourthZeroLab(Signal* signal)
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
ptrCheckGuard
(
logFilePtr
,
clogFileFileSize
,
logFileRecord
);
logPartPtr
.
p
->
invalidateFileNo
=
logPartPtr
.
p
->
headFileNo
;
logPartPtr
.
p
->
invalidateFileNo
=
logPartPtr
.
p
->
headFileNo
;
logPartPtr
.
p
->
invalidatePageNo
=
logPartPtr
.
p
->
headPageNo
;
logPartPtr
.
p
->
invalidatePageNo
=
logPartPtr
.
p
->
headPageNo
;
logPartPtr
.
p
->
logExecState
=
LogPartRecord
::
LES_EXEC_LOG_INVALIDATE
;
logPartPtr
.
p
->
logExecState
=
LogPartRecord
::
LES_EXEC_LOG_INVALIDATE
;
seizeLfo
(
signal
);
initLfo
(
signal
);
// The state here is a little confusing, but simulates that we return
// to invalidateLogAfterLastGCI() from an invalidate write and are ready
// to read a page from file.
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
WRITE_SR_INVALIDATE_PAGES
;
/**
readFileInInvalidate
(
signal
,
true
);
* Make sure we dont release zero page
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
READ_SR_INVALIDATE_PAGES
;
*/
seizeLogpage
(
signal
);
invalidateLogAfterLastGCI
(
signal
);
return
;
return
;
}
//Dblqh::readSrFourthZeroLab()
}
//Dblqh::readSrFourthZeroLab()
...
@@ -16402,6 +16534,14 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType, Uint32 place)
...
@@ -16402,6 +16534,14 @@ void Dblqh::completedLogPage(Signal* signal, Uint32 clpType, Uint32 place)
signal
->
theData
[
4
]
=
ZVAR_NO_LOG_PAGE_WORD
;
signal
->
theData
[
4
]
=
ZVAR_NO_LOG_PAGE_WORD
;
signal
->
theData
[
5
]
=
twlpNoPages
;
signal
->
theData
[
5
]
=
twlpNoPages
;
sendSignal
(
NDBFS_REF
,
GSN_FSWRITEREQ
,
signal
,
15
,
JBA
);
sendSignal
(
NDBFS_REF
,
GSN_FSWRITEREQ
,
signal
,
15
,
JBA
);
if
(
DEBUG_REDO
)
ndbout_c
(
"writing %d pages at part: %u file: %u pos: %u"
,
twlpNoPages
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
logFilePtr
.
p
->
filePosition
);
if
(
twlpType
==
ZNORMAL
)
{
if
(
twlpType
==
ZNORMAL
)
{
jam
();
jam
();
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
ACTIVE_WRITE_LOG
;
lfoPtr
.
p
->
lfoState
=
LogFileOperationRecord
::
ACTIVE_WRITE_LOG
;
...
@@ -17561,6 +17701,14 @@ void Dblqh::readExecLog(Signal* signal)
...
@@ -17561,6 +17701,14 @@ void Dblqh::readExecLog(Signal* signal)
signal
->
theData
[
14
]
=
lfoPtr
.
p
->
logPageArray
[
8
];
signal
->
theData
[
14
]
=
lfoPtr
.
p
->
logPageArray
[
8
];
signal
->
theData
[
15
]
=
lfoPtr
.
p
->
logPageArray
[
9
];
signal
->
theData
[
15
]
=
lfoPtr
.
p
->
logPageArray
[
9
];
sendSignal
(
NDBFS_REF
,
GSN_FSREADREQ
,
signal
,
16
,
JBA
);
sendSignal
(
NDBFS_REF
,
GSN_FSREADREQ
,
signal
,
16
,
JBA
);
if
(
DEBUG_REDO
)
ndbout_c
(
"readExecLog %u page at part: %u file: %u pos: %u"
,
lfoPtr
.
p
->
noPagesRw
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
logPartPtr
.
p
->
execSrStartPageNo
);
}
//Dblqh::readExecLog()
}
//Dblqh::readExecLog()
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
...
@@ -17623,6 +17771,14 @@ void Dblqh::readExecSr(Signal* signal)
...
@@ -17623,6 +17771,14 @@ void Dblqh::readExecSr(Signal* signal)
signal
->
theData
[
13
]
=
lfoPtr
.
p
->
logPageArray
[
7
];
signal
->
theData
[
13
]
=
lfoPtr
.
p
->
logPageArray
[
7
];
signal
->
theData
[
14
]
=
tresPageid
;
signal
->
theData
[
14
]
=
tresPageid
;
sendSignal
(
NDBFS_REF
,
GSN_FSREADREQ
,
signal
,
15
,
JBA
);
sendSignal
(
NDBFS_REF
,
GSN_FSREADREQ
,
signal
,
15
,
JBA
);
if
(
DEBUG_REDO
)
ndbout_c
(
"readExecSr %u page at part: %u file: %u pos: %u"
,
8
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
tresPageid
);
}
//Dblqh::readExecSr()
}
//Dblqh::readExecSr()
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
...
@@ -17778,6 +17934,13 @@ void Dblqh::readSinglePage(Signal* signal, Uint32 pageNo)
...
@@ -17778,6 +17934,13 @@ void Dblqh::readSinglePage(Signal* signal, Uint32 pageNo)
signal
->
theData
[
6
]
=
logPagePtr
.
i
;
signal
->
theData
[
6
]
=
logPagePtr
.
i
;
signal
->
theData
[
7
]
=
pageNo
;
signal
->
theData
[
7
]
=
pageNo
;
sendSignal
(
NDBFS_REF
,
GSN_FSREADREQ
,
signal
,
8
,
JBA
);
sendSignal
(
NDBFS_REF
,
GSN_FSREADREQ
,
signal
,
8
,
JBA
);
if
(
DEBUG_REDO
)
ndbout_c
(
"readSinglePage 1 page at part: %u file: %u pos: %u"
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
pageNo
);
}
//Dblqh::readSinglePage()
}
//Dblqh::readSinglePage()
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
...
@@ -18261,8 +18424,17 @@ void Dblqh::writeCompletedGciLog(Signal* signal)
...
@@ -18261,8 +18424,17 @@ void Dblqh::writeCompletedGciLog(Signal* signal)
jam
();
jam
();
changeMbyte
(
signal
);
changeMbyte
(
signal
);
}
//if
}
//if
logFilePtr
.
p
->
remainingWordsInMbyte
=
logFilePtr
.
p
->
remainingWordsInMbyte
=
logFilePtr
.
p
->
remainingWordsInMbyte
-
ZCOMPLETED_GCI_LOG_SIZE
;
logFilePtr
.
p
->
remainingWordsInMbyte
-
ZCOMPLETED_GCI_LOG_SIZE
;
if
(
DEBUG_REDO
)
ndbout_c
(
"writeCompletedGciLog gci: %u part: %u file: %u page: %u"
,
cnewestCompletedGci
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
logFilePtr
.
p
->
currentFilepage
);
writeLogWord
(
signal
,
ZCOMPLETED_GCI_TYPE
);
writeLogWord
(
signal
,
ZCOMPLETED_GCI_TYPE
);
writeLogWord
(
signal
,
cnewestCompletedGci
);
writeLogWord
(
signal
,
cnewestCompletedGci
);
logPartPtr
.
p
->
logPartNewestCompletedGCI
=
cnewestCompletedGci
;
logPartPtr
.
p
->
logPartNewestCompletedGCI
=
cnewestCompletedGci
;
...
@@ -18299,6 +18471,13 @@ void Dblqh::writeDirty(Signal* signal, Uint32 place)
...
@@ -18299,6 +18471,13 @@ void Dblqh::writeDirty(Signal* signal, Uint32 place)
signal
->
theData
[
6
]
=
logPagePtr
.
i
;
signal
->
theData
[
6
]
=
logPagePtr
.
i
;
signal
->
theData
[
7
]
=
logPartPtr
.
p
->
prevFilepage
;
signal
->
theData
[
7
]
=
logPartPtr
.
p
->
prevFilepage
;
sendSignal
(
NDBFS_REF
,
GSN_FSWRITEREQ
,
signal
,
8
,
JBA
);
sendSignal
(
NDBFS_REF
,
GSN_FSWRITEREQ
,
signal
,
8
,
JBA
);
if
(
DEBUG_REDO
)
ndbout_c
(
"writeDirty 1 page at part: %u file: %u pos: %u"
,
logPartPtr
.
i
,
logFilePtr
.
p
->
fileNo
,
logPartPtr
.
p
->
prevFilepage
);
}
//Dblqh::writeDirty()
}
//Dblqh::writeDirty()
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment