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
c0a2c118
Commit
c0a2c118
authored
Feb 19, 2007
by
tomas@poseidon.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb
into poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
parents
53cc4c33
44fa3eaa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
2 deletions
+139
-2
storage/ndb/src/kernel/blocks/ERROR_codes.txt
storage/ndb/src/kernel/blocks/ERROR_codes.txt
+3
-1
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+26
-1
storage/ndb/test/include/NdbRestarter.hpp
storage/ndb/test/include/NdbRestarter.hpp
+2
-0
storage/ndb/test/ndbapi/testNodeRestart.cpp
storage/ndb/test/ndbapi/testNodeRestart.cpp
+42
-0
storage/ndb/test/run-test/daily-basic-tests.txt
storage/ndb/test/run-test/daily-basic-tests.txt
+4
-0
storage/ndb/test/src/NdbRestarter.cpp
storage/ndb/test/src/NdbRestarter.cpp
+62
-0
No files found.
storage/ndb/src/kernel/blocks/ERROR_codes.txt
View file @
c0a2c118
...
@@ -5,7 +5,7 @@ Next DBACC 3002
...
@@ -5,7 +5,7 @@ Next DBACC 3002
Next DBTUP 4024
Next DBTUP 4024
Next DBLQH 5045
Next DBLQH 5045
Next DBDICT 6007
Next DBDICT 6007
Next DBDIH 71
78
Next DBDIH 71
81
Next DBTC 8039
Next DBTC 8039
Next CMVMI 9000
Next CMVMI 9000
Next BACKUP 10038
Next BACKUP 10038
...
@@ -73,6 +73,8 @@ Delay GCP_SAVEREQ by 10 secs
...
@@ -73,6 +73,8 @@ Delay GCP_SAVEREQ by 10 secs
7177: Delay copying of sysfileData in execCOPY_GCIREQ
7177: Delay copying of sysfileData in execCOPY_GCIREQ
7180: Crash master during master-take-over in execMASTER_LCPCONF
ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING:
ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING:
-----------------------------------------------------------------
-----------------------------------------------------------------
...
...
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
View file @
c0a2c118
...
@@ -4892,6 +4892,8 @@ void
...
@@ -4892,6 +4892,8 @@ void
Dbdih
::
startLcpMasterTakeOver
(
Signal
*
signal
,
Uint32
nodeId
){
Dbdih
::
startLcpMasterTakeOver
(
Signal
*
signal
,
Uint32
nodeId
){
jam
();
jam
();
Uint32
oldNode
=
c_lcpMasterTakeOverState
.
failedNodeId
;
c_lcpMasterTakeOverState
.
minTableId
=
~
0
;
c_lcpMasterTakeOverState
.
minTableId
=
~
0
;
c_lcpMasterTakeOverState
.
minFragId
=
~
0
;
c_lcpMasterTakeOverState
.
minFragId
=
~
0
;
c_lcpMasterTakeOverState
.
failedNodeId
=
nodeId
;
c_lcpMasterTakeOverState
.
failedNodeId
=
nodeId
;
...
@@ -4910,7 +4912,20 @@ Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){
...
@@ -4910,7 +4912,20 @@ Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){
/**
/**
* Node failure during master take over...
* Node failure during master take over...
*/
*/
g_eventLogger
.
info
(
"Nodefail during master take over"
);
g_eventLogger
.
info
(
"Nodefail during master take over (old: %d)"
,
oldNode
);
}
NodeRecordPtr
nodePtr
;
nodePtr
.
i
=
oldNode
;
if
(
oldNode
>
0
&&
oldNode
<
MAX_NDB_NODES
)
{
jam
();
ptrCheckGuard
(
nodePtr
,
MAX_NDB_NODES
,
nodeRecord
);
if
(
nodePtr
.
p
->
m_nodefailSteps
.
get
(
NF_LCP_TAKE_OVER
))
{
jam
();
checkLocalNodefailComplete
(
signal
,
oldNode
,
NF_LCP_TAKE_OVER
);
}
}
}
setLocalNodefailHandling
(
signal
,
nodeId
,
NF_LCP_TAKE_OVER
);
setLocalNodefailHandling
(
signal
,
nodeId
,
NF_LCP_TAKE_OVER
);
...
@@ -5927,6 +5942,14 @@ void Dbdih::execMASTER_LCPREQ(Signal* signal)
...
@@ -5927,6 +5942,14 @@ void Dbdih::execMASTER_LCPREQ(Signal* signal)
jamEntry
();
jamEntry
();
const
BlockReference
newMasterBlockref
=
req
->
masterRef
;
const
BlockReference
newMasterBlockref
=
req
->
masterRef
;
if
(
newMasterBlockref
!=
cmasterdihref
)
{
jam
();
ndbout_c
(
"resending GSN_MASTER_LCPREQ"
);
sendSignalWithDelay
(
reference
(),
GSN_MASTER_LCPREQ
,
signal
,
signal
->
getLength
(),
50
);
return
;
}
Uint32
failedNodeId
=
req
->
failedNodeId
;
Uint32
failedNodeId
=
req
->
failedNodeId
;
/**
/**
...
@@ -6223,6 +6246,8 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal)
...
@@ -6223,6 +6246,8 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal)
ptrCheckGuard
(
nodePtr
,
MAX_NDB_NODES
,
nodeRecord
);
ptrCheckGuard
(
nodePtr
,
MAX_NDB_NODES
,
nodeRecord
);
nodePtr
.
p
->
lcpStateAtTakeOver
=
lcpState
;
nodePtr
.
p
->
lcpStateAtTakeOver
=
lcpState
;
CRASH_INSERTION
(
7180
);
#ifdef VM_TRACE
#ifdef VM_TRACE
g_eventLogger
.
info
(
"MASTER_LCPCONF"
);
g_eventLogger
.
info
(
"MASTER_LCPCONF"
);
printMASTER_LCP_CONF
(
stdout
,
&
signal
->
theData
[
0
],
0
,
0
);
printMASTER_LCP_CONF
(
stdout
,
&
signal
->
theData
[
0
],
0
,
0
);
...
...
storage/ndb/test/include/NdbRestarter.hpp
View file @
c0a2c118
...
@@ -61,6 +61,8 @@ public:
...
@@ -61,6 +61,8 @@ public:
int
dumpStateAllNodes
(
const
int
*
_args
,
int
_num_args
);
int
dumpStateAllNodes
(
const
int
*
_args
,
int
_num_args
);
int
getMasterNodeId
();
int
getMasterNodeId
();
int
getNextMasterNodeId
(
int
nodeId
);
int
getNodeGroup
(
int
nodeId
);
int
getRandomNodeSameNodeGroup
(
int
nodeId
,
int
randomNumber
);
int
getRandomNodeSameNodeGroup
(
int
nodeId
,
int
randomNumber
);
int
getRandomNodeOtherNodeGroup
(
int
nodeId
,
int
randomNumber
);
int
getRandomNodeOtherNodeGroup
(
int
nodeId
,
int
randomNumber
);
int
getRandomNotMasterNodeId
(
int
randomNumber
);
int
getRandomNotMasterNodeId
(
int
randomNumber
);
...
...
storage/ndb/test/ndbapi/testNodeRestart.cpp
View file @
c0a2c118
...
@@ -1273,6 +1273,45 @@ int runBug25984(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -1273,6 +1273,45 @@ int runBug25984(NDBT_Context* ctx, NDBT_Step* step){
return
NDBT_OK
;
return
NDBT_OK
;
}
}
int
runBug26457
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
)
{
NdbRestarter
res
;
if
(
res
.
getNumDbNodes
()
<
4
)
return
NDBT_OK
;
int
loops
=
ctx
->
getNumLoops
();
while
(
loops
--
)
{
retry:
int
master
=
res
.
getMasterNodeId
();
int
next
=
res
.
getNextMasterNodeId
(
master
);
ndbout_c
(
"master: %d next: %d"
,
master
,
next
);
if
(
res
.
getNodeGroup
(
master
)
==
res
.
getNodeGroup
(
next
))
{
res
.
restartOneDbNode
(
next
,
false
,
false
,
true
);
if
(
res
.
waitClusterStarted
())
return
NDBT_FAILED
;
goto
retry
;
}
int
val2
[]
=
{
DumpStateOrd
::
CmvmiSetRestartOnErrorInsert
,
2
};
if
(
res
.
dumpStateOneNode
(
next
,
val2
,
2
))
return
NDBT_FAILED
;
if
(
res
.
insertErrorInNode
(
next
,
7180
))
return
NDBT_FAILED
;
res
.
restartOneDbNode
(
master
,
false
,
false
,
true
);
if
(
res
.
waitClusterStarted
())
return
NDBT_FAILED
;
}
return
NDBT_OK
;
}
NDBT_TESTSUITE
(
testNodeRestart
);
NDBT_TESTSUITE
(
testNodeRestart
);
TESTCASE
(
"NoLoad"
,
TESTCASE
(
"NoLoad"
,
...
@@ -1612,6 +1651,9 @@ TESTCASE("Bug25554", ""){
...
@@ -1612,6 +1651,9 @@ TESTCASE("Bug25554", ""){
TESTCASE
(
"Bug25984"
,
""
){
TESTCASE
(
"Bug25984"
,
""
){
INITIALIZER
(
runBug25984
);
INITIALIZER
(
runBug25984
);
}
}
TESTCASE
(
"Bug26457"
,
""
){
INITIALIZER
(
runBug26457
);
}
NDBT_TESTSUITE_END
(
testNodeRestart
);
NDBT_TESTSUITE_END
(
testNodeRestart
);
int
main
(
int
argc
,
const
char
**
argv
){
int
main
(
int
argc
,
const
char
**
argv
){
...
...
storage/ndb/test/run-test/daily-basic-tests.txt
View file @
c0a2c118
...
@@ -529,6 +529,10 @@ max-time: 3000
...
@@ -529,6 +529,10 @@ max-time: 3000
cmd: testNodeRestart
cmd: testNodeRestart
args: -n Bug25984
args: -n Bug25984
max-time: 1000
cmd: testNodeRestart
args: -n Bug26457 T1
#
#
# DICT TESTS
# DICT TESTS
max-time: 1500
max-time: 1500
...
...
storage/ndb/test/src/NdbRestarter.cpp
View file @
c0a2c118
...
@@ -127,6 +127,68 @@ NdbRestarter::getMasterNodeId(){
...
@@ -127,6 +127,68 @@ NdbRestarter::getMasterNodeId(){
return
node
;
return
node
;
}
}
int
NdbRestarter
::
getNodeGroup
(
int
nodeId
){
if
(
!
isConnected
())
return
-
1
;
if
(
getStatus
()
!=
0
)
return
-
1
;
for
(
size_t
i
=
0
;
i
<
ndbNodes
.
size
();
i
++
)
{
if
(
ndbNodes
[
i
].
node_id
==
nodeId
)
{
return
ndbNodes
[
i
].
node_group
;
}
}
return
-
1
;
}
int
NdbRestarter
::
getNextMasterNodeId
(
int
nodeId
){
if
(
!
isConnected
())
return
-
1
;
if
(
getStatus
()
!=
0
)
return
-
1
;
size_t
i
;
for
(
i
=
0
;
i
<
ndbNodes
.
size
();
i
++
)
{
if
(
ndbNodes
[
i
].
node_id
==
nodeId
)
{
break
;
}
}
assert
(
i
<
ndbNodes
.
size
());
if
(
i
==
ndbNodes
.
size
())
return
-
1
;
int
dynid
=
ndbNodes
[
i
].
dynamic_id
;
int
minid
=
dynid
;
for
(
i
=
0
;
i
<
ndbNodes
.
size
();
i
++
)
if
(
ndbNodes
[
i
].
dynamic_id
>
minid
)
minid
=
ndbNodes
[
i
].
dynamic_id
;
for
(
i
=
0
;
i
<
ndbNodes
.
size
();
i
++
)
if
(
ndbNodes
[
i
].
dynamic_id
>
dynid
&&
ndbNodes
[
i
].
dynamic_id
<
minid
)
{
minid
=
ndbNodes
[
i
].
dynamic_id
;
}
if
(
minid
!=
~
0
)
{
for
(
i
=
0
;
i
<
ndbNodes
.
size
();
i
++
)
if
(
ndbNodes
[
i
].
dynamic_id
==
minid
)
return
ndbNodes
[
i
].
node_id
;
}
return
getMasterNodeId
();
}
int
int
NdbRestarter
::
getRandomNotMasterNodeId
(
int
rand
){
NdbRestarter
::
getRandomNotMasterNodeId
(
int
rand
){
int
master
=
getMasterNodeId
();
int
master
=
getMasterNodeId
();
...
...
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