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
5dac4e99
Commit
5dac4e99
authored
Jan 11, 2007
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0-ndb
parents
ab4ca58a
07ac8c85
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
194 additions
and
14 deletions
+194
-14
ndb/include/kernel/signaldata/DumpStateOrd.hpp
ndb/include/kernel/signaldata/DumpStateOrd.hpp
+1
-0
ndb/src/kernel/blocks/ERROR_codes.txt
ndb/src/kernel/blocks/ERROR_codes.txt
+3
-0
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+2
-1
ndb/src/kernel/blocks/qmgr/Qmgr.hpp
ndb/src/kernel/blocks/qmgr/Qmgr.hpp
+4
-0
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
+80
-13
ndb/test/ndbapi/testNodeRestart.cpp
ndb/test/ndbapi/testNodeRestart.cpp
+96
-0
ndb/test/run-test/daily-basic-tests.txt
ndb/test/run-test/daily-basic-tests.txt
+8
-0
No files found.
ndb/include/kernel/signaldata/DumpStateOrd.hpp
View file @
5dac4e99
...
@@ -67,6 +67,7 @@ public:
...
@@ -67,6 +67,7 @@ public:
// 100-105 TUP and ACC
// 100-105 TUP and ACC
// 200-240 UTIL
// 200-240 UTIL
// 300-305 TRIX
// 300-305 TRIX
QmgrErr935
=
935
,
NdbfsDumpFileStat
=
400
,
NdbfsDumpFileStat
=
400
,
NdbfsDumpAllFiles
=
401
,
NdbfsDumpAllFiles
=
401
,
NdbfsDumpOpenFiles
=
402
,
NdbfsDumpOpenFiles
=
402
,
...
...
ndb/src/kernel/blocks/ERROR_codes.txt
View file @
5dac4e99
...
@@ -21,6 +21,9 @@ Crash president when he starts to run in ArbitState 1-9.
...
@@ -21,6 +21,9 @@ Crash president when he starts to run in ArbitState 1-9.
910: Crash new president after node crash
910: Crash new president after node crash
935 : Crash master on node failure (delayed)
and skip sending GSN_COMMIT_FAILREQ to specified node
ERROR CODES FOR TESTING NODE FAILURE, GLOBAL CHECKPOINT HANDLING:
ERROR CODES FOR TESTING NODE FAILURE, GLOBAL CHECKPOINT HANDLING:
-----------------------------------------------------------------
-----------------------------------------------------------------
...
...
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
View file @
5dac4e99
...
@@ -3554,7 +3554,6 @@ void Dbdih::endTakeOver(Uint32 takeOverPtrI)
...
@@ -3554,7 +3554,6 @@ void Dbdih::endTakeOver(Uint32 takeOverPtrI)
takeOverPtr
.
i
=
takeOverPtrI
;
takeOverPtr
.
i
=
takeOverPtrI
;
ptrCheckGuard
(
takeOverPtr
,
MAX_NDB_NODES
,
takeOverRecord
);
ptrCheckGuard
(
takeOverPtr
,
MAX_NDB_NODES
,
takeOverRecord
);
releaseTakeOver
(
takeOverPtrI
);
if
((
takeOverPtr
.
p
->
toMasterStatus
!=
TakeOverRecord
::
IDLE
)
&&
if
((
takeOverPtr
.
p
->
toMasterStatus
!=
TakeOverRecord
::
IDLE
)
&&
(
takeOverPtr
.
p
->
toMasterStatus
!=
TakeOverRecord
::
TO_WAIT_START_TAKE_OVER
))
{
(
takeOverPtr
.
p
->
toMasterStatus
!=
TakeOverRecord
::
TO_WAIT_START_TAKE_OVER
))
{
jam
();
jam
();
...
@@ -3568,6 +3567,7 @@ void Dbdih::endTakeOver(Uint32 takeOverPtrI)
...
@@ -3568,6 +3567,7 @@ void Dbdih::endTakeOver(Uint32 takeOverPtrI)
}
//if
}
//if
setAllowNodeStart
(
takeOverPtr
.
p
->
toStartingNode
,
true
);
setAllowNodeStart
(
takeOverPtr
.
p
->
toStartingNode
,
true
);
initTakeOver
(
takeOverPtr
);
initTakeOver
(
takeOverPtr
);
releaseTakeOver
(
takeOverPtrI
);
}
//Dbdih::endTakeOver()
}
//Dbdih::endTakeOver()
void
Dbdih
::
releaseTakeOver
(
Uint32
takeOverPtrI
)
void
Dbdih
::
releaseTakeOver
(
Uint32
takeOverPtrI
)
...
@@ -4709,6 +4709,7 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI)
...
@@ -4709,6 +4709,7 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI)
break
;
break
;
}
}
ndbrequire
(
ok
);
ndbrequire
(
ok
);
endTakeOver
(
takeOverPtr
.
i
);
}
//if
}
//if
}
//Dbdih::handleTakeOverNewMaster()
}
//Dbdih::handleTakeOverNewMaster()
...
...
ndb/src/kernel/blocks/qmgr/Qmgr.hpp
View file @
5dac4e99
...
@@ -425,6 +425,10 @@ private:
...
@@ -425,6 +425,10 @@ private:
StopReq
c_stopReq
;
StopReq
c_stopReq
;
bool
check_multi_node_shutdown
(
Signal
*
signal
);
bool
check_multi_node_shutdown
(
Signal
*
signal
);
#ifdef ERROR_INSERT
Uint32
c_error_insert_extra
;
#endif
};
};
#endif
#endif
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
View file @
5dac4e99
...
@@ -2894,6 +2894,17 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
...
@@ -2894,6 +2894,17 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
systemErrorLab
(
signal
,
__LINE__
);
systemErrorLab
(
signal
,
__LINE__
);
return
;
return
;
}
//if
}
//if
if
(
getNodeState
().
startLevel
<
NodeState
::
SL_STARTED
)
{
jam
();
CRASH_INSERTION
(
932
);
char
buf
[
100
];
BaseString
::
snprintf
(
buf
,
100
,
"Node failure during restart"
);
progError
(
__LINE__
,
NDBD_EXIT_SR_OTHERNODEFAILED
,
buf
);
ndbrequire
(
false
);
}
TnoFailedNodes
=
cnoFailedNodes
;
TnoFailedNodes
=
cnoFailedNodes
;
failReport
(
signal
,
failedNodePtr
.
i
,
(
UintR
)
ZTRUE
,
aFailCause
);
failReport
(
signal
,
failedNodePtr
.
i
,
(
UintR
)
ZTRUE
,
aFailCause
);
if
(
cpresident
==
getOwnNodeId
())
{
if
(
cpresident
==
getOwnNodeId
())
{
...
@@ -2980,6 +2991,16 @@ void Qmgr::execPREP_FAILREQ(Signal* signal)
...
@@ -2980,6 +2991,16 @@ void Qmgr::execPREP_FAILREQ(Signal* signal)
return
;
return
;
}
//if
}
//if
if
(
getNodeState
().
startLevel
<
NodeState
::
SL_STARTED
)
{
jam
();
CRASH_INSERTION
(
932
);
char
buf
[
100
];
BaseString
::
snprintf
(
buf
,
100
,
"Node failure during restart"
);
progError
(
__LINE__
,
NDBD_EXIT_SR_OTHERNODEFAILED
,
buf
);
ndbrequire
(
false
);
}
guard0
=
cnoPrepFailedNodes
-
1
;
guard0
=
cnoPrepFailedNodes
-
1
;
arrGuard
(
guard0
,
MAX_NDB_NODES
);
arrGuard
(
guard0
,
MAX_NDB_NODES
);
for
(
Tindex
=
0
;
Tindex
<=
guard0
;
Tindex
++
)
{
for
(
Tindex
=
0
;
Tindex
<=
guard0
;
Tindex
++
)
{
...
@@ -3157,6 +3178,18 @@ Qmgr::sendCommitFailReq(Signal* signal)
...
@@ -3157,6 +3178,18 @@ Qmgr::sendCommitFailReq(Signal* signal)
for
(
nodePtr
.
i
=
1
;
nodePtr
.
i
<
MAX_NDB_NODES
;
nodePtr
.
i
++
)
{
for
(
nodePtr
.
i
=
1
;
nodePtr
.
i
<
MAX_NDB_NODES
;
nodePtr
.
i
++
)
{
jam
();
jam
();
ptrAss
(
nodePtr
,
nodeRec
);
ptrAss
(
nodePtr
,
nodeRec
);
#ifdef ERROR_INSERT
if
(
ERROR_INSERTED
(
935
)
&&
nodePtr
.
i
==
c_error_insert_extra
)
{
ndbout_c
(
"skipping node %d"
,
c_error_insert_extra
);
CLEAR_ERROR_INSERT_VALUE
;
signal
->
theData
[
0
]
=
9999
;
sendSignalWithDelay
(
CMVMI_REF
,
GSN_NDB_TAMPER
,
signal
,
1000
,
1
);
continue
;
}
#endif
if
(
nodePtr
.
p
->
phase
==
ZRUNNING
)
{
if
(
nodePtr
.
p
->
phase
==
ZRUNNING
)
{
jam
();
jam
();
nodePtr
.
p
->
sendCommitFailReqStatus
=
Q_ACTIVE
;
nodePtr
.
p
->
sendCommitFailReqStatus
=
Q_ACTIVE
;
...
@@ -3227,6 +3260,33 @@ void Qmgr::execPREP_FAILREF(Signal* signal)
...
@@ -3227,6 +3260,33 @@ void Qmgr::execPREP_FAILREF(Signal* signal)
return
;
return
;
}
//Qmgr::execPREP_FAILREF()
}
//Qmgr::execPREP_FAILREF()
static
Uint32
clear_nodes
(
Uint32
dstcnt
,
Uint16
dst
[],
Uint32
srccnt
,
const
Uint16
src
[])
{
if
(
srccnt
==
0
)
return
dstcnt
;
Uint32
pos
=
0
;
for
(
Uint32
i
=
0
;
i
<
dstcnt
;
i
++
)
{
Uint32
node
=
dst
[
i
];
for
(
Uint32
j
=
0
;
j
<
srccnt
;
j
++
)
{
if
(
node
==
dst
[
j
])
{
node
=
RNIL
;
break
;
}
}
if
(
node
!=
RNIL
)
{
dst
[
pos
++
]
=
node
;
}
}
return
pos
;
}
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* THE PRESIDENT IS NOW COMMITTING THE PREVIOUSLY PREPARED NODE FAILURE. */
/* THE PRESIDENT IS NOW COMMITTING THE PREVIOUSLY PREPARED NODE FAILURE. */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
...
@@ -3314,19 +3374,18 @@ void Qmgr::execCOMMIT_FAILREQ(Signal* signal)
...
@@ -3314,19 +3374,18 @@ void Qmgr::execCOMMIT_FAILREQ(Signal* signal)
NodeFailRep
::
SignalLength
,
JBB
);
NodeFailRep
::
SignalLength
,
JBB
);
}
//if
}
//if
}
//for
}
//for
if
(
cpresident
!=
getOwnNodeId
())
{
jam
();
/**
cnoFailedNodes
=
cnoCommitFailedNodes
-
cnoFailedNodes
;
* Remove committed nodes from failed/prepared
if
(
cnoFailedNodes
>
0
)
{
*/
jam
();
cnoFailedNodes
=
clear_nodes
(
cnoFailedNodes
,
guard0
=
cnoFailedNodes
-
1
;
cfailedNodes
,
arrGuard
(
guard0
+
cnoCommitFailedNodes
,
MAX_NDB_NODES
);
cnoCommitFailedNodes
,
for
(
Tj
=
0
;
Tj
<=
guard0
;
Tj
++
)
{
ccommitFailedNodes
);
jam
();
cnoPrepFailedNodes
=
clear_nodes
(
cnoPrepFailedNodes
,
cfailedNodes
[
Tj
]
=
cfailedNodes
[
Tj
+
cnoCommitFailedNodes
];
cprepFailedNodes
,
}
//for
cnoCommitFailedNodes
,
}
//if
ccommitFailedNodes
);
}
//if
cnoCommitFailedNodes
=
0
;
cnoCommitFailedNodes
=
0
;
}
//if
}
//if
/**-----------------------------------------------------------------------
/**-----------------------------------------------------------------------
...
@@ -4705,6 +4764,14 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
...
@@ -4705,6 +4764,14 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
default:
default:
;
;
}
//switch
}
//switch
#ifdef ERROR_INSERT
if
(
signal
->
theData
[
0
]
==
935
&&
signal
->
getLength
()
==
2
)
{
SET_ERROR_INSERT_VALUE
(
935
);
c_error_insert_extra
=
signal
->
theData
[
1
];
}
#endif
}
//Qmgr::execDUMP_STATE_ORD()
}
//Qmgr::execDUMP_STATE_ORD()
void
Qmgr
::
execSET_VAR_REQ
(
Signal
*
signal
)
void
Qmgr
::
execSET_VAR_REQ
(
Signal
*
signal
)
...
...
ndb/test/ndbapi/testNodeRestart.cpp
View file @
5dac4e99
...
@@ -954,6 +954,96 @@ int runBug24717(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -954,6 +954,96 @@ int runBug24717(NDBT_Context* ctx, NDBT_Step* step){
return
NDBT_OK
;
return
NDBT_OK
;
}
}
int
runBug25364
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
NdbRestarter
restarter
;
Ndb
*
pNdb
=
GETNDB
(
step
);
int
loops
=
ctx
->
getNumLoops
();
if
(
restarter
.
getNumDbNodes
()
<
4
)
return
NDBT_OK
;
int
val2
[]
=
{
DumpStateOrd
::
CmvmiSetRestartOnErrorInsert
,
1
};
for
(;
loops
;
loops
--
)
{
int
master
=
restarter
.
getMasterNodeId
();
int
victim
=
restarter
.
getRandomNodeOtherNodeGroup
(
master
,
rand
());
int
second
=
restarter
.
getRandomNodeSameNodeGroup
(
victim
,
rand
());
int
dump
[]
=
{
935
,
victim
}
;
if
(
restarter
.
dumpStateOneNode
(
master
,
dump
,
2
))
return
NDBT_FAILED
;
if
(
restarter
.
dumpStateOneNode
(
master
,
val2
,
2
))
return
NDBT_FAILED
;
if
(
restarter
.
restartOneDbNode
(
second
,
false
,
true
,
true
))
return
NDBT_FAILED
;
int
nodes
[
2
]
=
{
master
,
second
};
if
(
restarter
.
waitNodesNoStart
(
nodes
,
2
))
return
NDBT_FAILED
;
restarter
.
startNodes
(
nodes
,
2
);
if
(
restarter
.
waitNodesStarted
(
nodes
,
2
))
return
NDBT_FAILED
;
}
return
NDBT_OK
;
}
int
runBug25554
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
int
loops
=
ctx
->
getNumLoops
();
int
records
=
ctx
->
getNumRecords
();
NdbRestarter
restarter
;
if
(
restarter
.
getNumDbNodes
()
<
4
)
return
NDBT_OK
;
for
(
int
i
=
0
;
i
<
loops
;
i
++
)
{
int
master
=
restarter
.
getMasterNodeId
();
int
node1
=
restarter
.
getRandomNodeOtherNodeGroup
(
master
,
rand
());
restarter
.
restartOneDbNode
(
node1
,
false
,
true
,
true
);
int
val2
[]
=
{
DumpStateOrd
::
CmvmiSetRestartOnErrorInsert
,
1
};
if
(
restarter
.
dumpStateOneNode
(
master
,
val2
,
2
))
return
NDBT_FAILED
;
if
(
restarter
.
insertErrorInNode
(
master
,
7141
))
return
NDBT_FAILED
;
if
(
restarter
.
waitNodesNoStart
(
&
node1
,
1
))
return
NDBT_FAILED
;
if
(
restarter
.
dumpStateOneNode
(
node1
,
val2
,
2
))
return
NDBT_FAILED
;
if
(
restarter
.
insertErrorInNode
(
node1
,
932
))
return
NDBT_FAILED
;
if
(
restarter
.
startNodes
(
&
node1
,
1
))
return
NDBT_FAILED
;
int
nodes
[]
=
{
master
,
node1
};
if
(
restarter
.
waitNodesNoStart
(
nodes
,
2
))
return
NDBT_FAILED
;
if
(
restarter
.
startNodes
(
nodes
,
2
))
return
NDBT_FAILED
;
if
(
restarter
.
waitClusterStarted
())
return
NDBT_FAILED
;
}
return
NDBT_OK
;
}
NDBT_TESTSUITE
(
testNodeRestart
);
NDBT_TESTSUITE
(
testNodeRestart
);
TESTCASE
(
"NoLoad"
,
TESTCASE
(
"NoLoad"
,
...
@@ -1270,6 +1360,12 @@ TESTCASE("Bug20185",
...
@@ -1270,6 +1360,12 @@ TESTCASE("Bug20185",
TESTCASE
(
"Bug24717"
,
""
){
TESTCASE
(
"Bug24717"
,
""
){
INITIALIZER
(
runBug24717
);
INITIALIZER
(
runBug24717
);
}
}
TESTCASE
(
"Bug25364"
,
""
){
INITIALIZER
(
runBug25364
);
}
TESTCASE
(
"Bug25554"
,
""
){
INITIALIZER
(
runBug25554
);
}
NDBT_TESTSUITE_END
(
testNodeRestart
);
NDBT_TESTSUITE_END
(
testNodeRestart
);
int
main
(
int
argc
,
const
char
**
argv
){
int
main
(
int
argc
,
const
char
**
argv
){
...
...
ndb/test/run-test/daily-basic-tests.txt
View file @
5dac4e99
...
@@ -469,6 +469,14 @@ max-time: 1000
...
@@ -469,6 +469,14 @@ max-time: 1000
cmd: testNodeRestart
cmd: testNodeRestart
args: -n Bug24717 T1
args: -n Bug24717 T1
max-time: 1000
cmd: testNodeRestart
args: -n Bug25364 T1
max-time: 1000
cmd: testNodeRestart
args: -n Bug25554 T1
# OLD FLEX
# OLD FLEX
max-time: 500
max-time: 500
cmd: flexBench
cmd: flexBench
...
...
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