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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
12d0ac07
Commit
12d0ac07
authored
Mar 01, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
fe2a8004
afdbf9b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
1 deletion
+77
-1
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+2
-1
ndb/test/ndbapi/testNodeRestart.cpp
ndb/test/ndbapi/testNodeRestart.cpp
+71
-0
ndb/test/run-test/daily-devel-tests.txt
ndb/test/run-test/daily-devel-tests.txt
+4
-0
No files found.
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
View file @
12d0ac07
...
@@ -5345,6 +5345,7 @@ void Dbtc::execTC_COMMITREQ(Signal* signal)
...
@@ -5345,6 +5345,7 @@ void Dbtc::execTC_COMMITREQ(Signal* signal)
const
Uint32
transId2
=
regApiPtr
->
transid
[
1
];
const
Uint32
transId2
=
regApiPtr
->
transid
[
1
];
Uint32
errorCode
=
0
;
Uint32
errorCode
=
0
;
regApiPtr
->
m_exec_flag
=
1
;
switch
(
regApiPtr
->
apiConnectstate
)
{
switch
(
regApiPtr
->
apiConnectstate
)
{
case
CS_STARTED
:
case
CS_STARTED
:
tcConnectptr
.
i
=
regApiPtr
->
firstTcConnect
;
tcConnectptr
.
i
=
regApiPtr
->
firstTcConnect
;
...
...
ndb/test/ndbapi/testNodeRestart.cpp
View file @
12d0ac07
...
@@ -344,6 +344,71 @@ int runDirtyRead(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -344,6 +344,71 @@ int runDirtyRead(NDBT_Context* ctx, NDBT_Step* step){
return
NDBT_FAILED
;
return
NDBT_FAILED
;
}
}
int
runLateCommit
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
int
loops
=
ctx
->
getNumLoops
();
int
records
=
ctx
->
getNumRecords
();
NdbRestarter
restarter
;
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
Ndb
*
pNdb
=
GETNDB
(
step
);
int
i
=
0
;
while
(
i
<
loops
&&
result
!=
NDBT_FAILED
&&
!
ctx
->
isTestStopped
()){
g_info
<<
i
<<
": "
;
if
(
hugoOps
.
startTransaction
(
pNdb
)
!=
0
)
return
NDBT_FAILED
;
if
(
hugoOps
.
pkUpdateRecord
(
pNdb
,
1
)
!=
0
)
return
NDBT_FAILED
;
if
(
hugoOps
.
execute_NoCommit
(
pNdb
)
!=
0
)
return
NDBT_FAILED
;
Uint32
transNode
=
hugoOps
.
getTransaction
()
->
getConnectedNodeId
();
int
id
=
i
%
restarter
.
getNumDbNodes
();
int
nodeId
;
while
((
nodeId
=
restarter
.
getDbNodeId
(
id
))
==
transNode
)
id
=
(
id
+
1
)
%
restarter
.
getNumDbNodes
();
ndbout
<<
"Restart node "
<<
nodeId
<<
endl
;
restarter
.
restartOneDbNode
(
nodeId
,
/** initial */
false
,
/** nostart */
true
,
/** abort */
true
);
restarter
.
waitNodesNoStart
(
&
nodeId
,
1
);
int
res
;
if
(
i
&
1
)
res
=
hugoOps
.
execute_Commit
(
pNdb
);
else
res
=
hugoOps
.
execute_Rollback
(
pNdb
);
ndbout_c
(
"res= %d"
,
res
);
hugoOps
.
closeTransaction
(
pNdb
);
restarter
.
startNodes
(
&
nodeId
,
1
);
restarter
.
waitNodesStarted
(
&
nodeId
,
1
);
if
(
i
&
1
)
{
if
(
res
!=
286
)
return
NDBT_FAILED
;
}
else
{
if
(
res
!=
0
)
return
NDBT_FAILED
;
}
i
++
;
}
return
NDBT_OK
;
}
NDBT_TESTSUITE
(
testNodeRestart
);
NDBT_TESTSUITE
(
testNodeRestart
);
TESTCASE
(
"NoLoad"
,
TESTCASE
(
"NoLoad"
,
"Test that one node at a time can be stopped and then restarted "
\
"Test that one node at a time can be stopped and then restarted "
\
...
@@ -600,6 +665,12 @@ TESTCASE("CommittedRead",
...
@@ -600,6 +665,12 @@ TESTCASE("CommittedRead",
STEP
(
runDirtyRead
);
STEP
(
runDirtyRead
);
FINALIZER
(
runClearTable
);
FINALIZER
(
runClearTable
);
}
}
TESTCASE
(
"LateCommit"
,
"Test commit after node failure"
){
INITIALIZER
(
runLoadTable
);
STEP
(
runLateCommit
);
FINALIZER
(
runClearTable
);
}
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-devel-tests.txt
View file @
12d0ac07
...
@@ -69,6 +69,10 @@ max-time: 2500
...
@@ -69,6 +69,10 @@ max-time: 2500
cmd: testNodeRestart
cmd: testNodeRestart
args: -n CommittedRead T1
args: -n CommittedRead T1
max-time: 2500
cmd: testNodeRestart
args: -n LateCommit T1
max-time: 2500
max-time: 2500
cmd: testNodeRestart
cmd: testNodeRestart
args: -n Terror T6 T13
args: -n Terror T6 T13
...
...
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