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
b3463f6d
Commit
b3463f6d
authored
Sep 21, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into mysql.com:/home/jonas/src/mysql-4.1-ndb
parents
b1fa0304
2175afe2
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
103 additions
and
30 deletions
+103
-30
ndb/src/kernel/blocks/dbtup/Dbtup.hpp
ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+2
-1
ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
+3
-3
ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
+6
-9
ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+8
-12
ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+2
-1
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
+6
-2
ndb/test/ndbapi/testSystemRestart.cpp
ndb/test/ndbapi/testSystemRestart.cpp
+60
-2
ndb/test/run-test/daily-devel-tests.txt
ndb/test/run-test/daily-devel-tests.txt
+16
-0
No files found.
ndb/src/kernel/blocks/dbtup/Dbtup.hpp
View file @
b3463f6d
...
@@ -515,6 +515,7 @@ struct Fragrecord {
...
@@ -515,6 +515,7 @@ struct Fragrecord {
Uint32
emptyPrimPage
;
Uint32
emptyPrimPage
;
Uint32
firstusedOprec
;
Uint32
firstusedOprec
;
Uint32
lastusedOprec
;
Uint32
thFreeFirst
;
Uint32
thFreeFirst
;
Uint32
thFreeCopyFirst
;
Uint32
thFreeCopyFirst
;
...
@@ -1653,7 +1654,7 @@ private:
...
@@ -1653,7 +1654,7 @@ private:
//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
void
initOpConnection
(
Operationrec
*
const
regOperPtr
);
void
initOpConnection
(
Operationrec
*
regOperPtr
,
Fragrecord
*
);
//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
//------------------------------------------------------------------
...
...
ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
View file @
b3463f6d
...
@@ -77,7 +77,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
...
@@ -77,7 +77,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
if
(
regOperPtr
.
p
->
optype
==
ZREAD
)
{
if
(
regOperPtr
.
p
->
optype
==
ZREAD
)
{
ljam
();
ljam
();
freeAllAttrBuffers
(
regOperPtr
.
p
);
freeAllAttrBuffers
(
regOperPtr
.
p
);
initOpConnection
(
regOperPtr
.
p
);
initOpConnection
(
regOperPtr
.
p
,
0
);
return
;
return
;
}
//if
}
//if
...
@@ -134,7 +134,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
...
@@ -134,7 +134,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
ndbrequire
(
regOperPtr
.
p
->
tupleState
==
ALREADY_ABORTED
);
ndbrequire
(
regOperPtr
.
p
->
tupleState
==
ALREADY_ABORTED
);
commitUpdate
(
signal
,
regOperPtr
.
p
,
regFragPtr
.
p
,
regTabPtr
.
p
);
commitUpdate
(
signal
,
regOperPtr
.
p
,
regFragPtr
.
p
,
regTabPtr
.
p
);
}
//if
}
//if
initOpConnection
(
regOperPtr
.
p
);
initOpConnection
(
regOperPtr
.
p
,
regFragPtr
.
p
);
}
//execTUP_ABORTREQ()
}
//execTUP_ABORTREQ()
void
Dbtup
::
setTupleStateOnPreviousOps
(
Uint32
prevOpIndex
)
void
Dbtup
::
setTupleStateOnPreviousOps
(
Uint32
prevOpIndex
)
...
@@ -459,7 +459,7 @@ void Dbtup::tupkeyErrorLab(Signal* signal)
...
@@ -459,7 +459,7 @@ void Dbtup::tupkeyErrorLab(Signal* signal)
freeAllAttrBuffers
(
regOperPtr
);
freeAllAttrBuffers
(
regOperPtr
);
abortUpdate
(
signal
,
regOperPtr
,
fragptr
.
p
,
tabptr
.
p
);
abortUpdate
(
signal
,
regOperPtr
,
fragptr
.
p
,
tabptr
.
p
);
removeActiveOpList
(
regOperPtr
);
removeActiveOpList
(
regOperPtr
);
initOpConnection
(
regOperPtr
);
initOpConnection
(
regOperPtr
,
fragptr
.
p
);
regOperPtr
->
transstate
=
IDLE
;
regOperPtr
->
transstate
=
IDLE
;
regOperPtr
->
tupleState
=
NO_OTHER_OP
;
regOperPtr
->
tupleState
=
NO_OTHER_OP
;
TupKeyRef
*
const
tupKeyRef
=
(
TupKeyRef
*
)
signal
->
getDataPtrSend
();
TupKeyRef
*
const
tupKeyRef
=
(
TupKeyRef
*
)
signal
->
getDataPtrSend
();
...
...
ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
View file @
b3463f6d
...
@@ -224,7 +224,8 @@ void Dbtup::removeActiveOpList(Operationrec* const regOperPtr)
...
@@ -224,7 +224,8 @@ void Dbtup::removeActiveOpList(Operationrec* const regOperPtr)
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */
/* INITIALIZATION OF ONE CONNECTION RECORD TO PREPARE FOR NEXT OP. */
/* INITIALIZATION OF ONE CONNECTION RECORD TO PREPARE FOR NEXT OP. */
/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */
void
Dbtup
::
initOpConnection
(
Operationrec
*
const
regOperPtr
)
void
Dbtup
::
initOpConnection
(
Operationrec
*
regOperPtr
,
Fragrecord
*
fragPtrP
)
{
{
Uint32
RinFragList
=
regOperPtr
->
inFragList
;
Uint32
RinFragList
=
regOperPtr
->
inFragList
;
regOperPtr
->
transstate
=
IDLE
;
regOperPtr
->
transstate
=
IDLE
;
...
@@ -244,22 +245,18 @@ void Dbtup::initOpConnection(Operationrec* const regOperPtr)
...
@@ -244,22 +245,18 @@ void Dbtup::initOpConnection(Operationrec* const regOperPtr)
regOperPtr
->
inFragList
=
ZFALSE
;
regOperPtr
->
inFragList
=
ZFALSE
;
if
(
tropPrevLinkPtr
.
i
==
RNIL
)
{
if
(
tropPrevLinkPtr
.
i
==
RNIL
)
{
ljam
();
ljam
();
FragrecordPtr
regFragPtr
;
fragPtrP
->
firstusedOprec
=
tropNextLinkPtr
.
i
;
regFragPtr
.
i
=
regOperPtr
->
fragmentPtr
;
ptrCheckGuard
(
regFragPtr
,
cnoOfFragrec
,
fragrecord
);
regFragPtr
.
p
->
firstusedOprec
=
tropNextLinkPtr
.
i
;
}
else
{
}
else
{
ljam
();
ljam
();
ptrCheckGuard
(
tropPrevLinkPtr
,
cnoOfOprec
,
operationrec
);
ptrCheckGuard
(
tropPrevLinkPtr
,
cnoOfOprec
,
operationrec
);
tropPrevLinkPtr
.
p
->
nextOprecInList
=
tropNextLinkPtr
.
i
;
tropPrevLinkPtr
.
p
->
nextOprecInList
=
tropNextLinkPtr
.
i
;
}
//if
}
//if
if
(
tropNextLinkPtr
.
i
==
RNIL
)
{
if
(
tropNextLinkPtr
.
i
==
RNIL
)
{
;
fragPtrP
->
lastusedOprec
=
tropPrevLinkPtr
.
i
;
}
else
{
}
else
{
ljam
();
ptrCheckGuard
(
tropNextLinkPtr
,
cnoOfOprec
,
operationrec
);
ptrCheckGuard
(
tropNextLinkPtr
,
cnoOfOprec
,
operationrec
);
tropNextLinkPtr
.
p
->
prevOprecInList
=
tropPrevLinkPtr
.
i
;
tropNextLinkPtr
.
p
->
prevOprecInList
=
tropPrevLinkPtr
.
i
;
}
//if
}
regOperPtr
->
prevOprecInList
=
RNIL
;
regOperPtr
->
prevOprecInList
=
RNIL
;
regOperPtr
->
nextOprecInList
=
RNIL
;
regOperPtr
->
nextOprecInList
=
RNIL
;
}
//if
}
//if
...
@@ -336,7 +333,7 @@ void Dbtup::execTUP_COMMITREQ(Signal* signal)
...
@@ -336,7 +333,7 @@ void Dbtup::execTUP_COMMITREQ(Signal* signal)
commitUpdate
(
signal
,
regOperPtr
.
p
,
regFragPtr
.
p
,
regTabPtr
.
p
);
commitUpdate
(
signal
,
regOperPtr
.
p
,
regFragPtr
.
p
,
regTabPtr
.
p
);
removeActiveOpList
(
regOperPtr
.
p
);
removeActiveOpList
(
regOperPtr
.
p
);
}
//if
}
//if
initOpConnection
(
regOperPtr
.
p
);
initOpConnection
(
regOperPtr
.
p
,
regFragPtr
.
p
);
}
//execTUP_COMMITREQ()
}
//execTUP_COMMITREQ()
void
void
...
...
ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
View file @
b3463f6d
...
@@ -319,24 +319,20 @@ void Dbtup::linkOpIntoFragList(OperationrecPtr regOperPtr,
...
@@ -319,24 +319,20 @@ void Dbtup::linkOpIntoFragList(OperationrecPtr regOperPtr,
Fragrecord
*
const
regFragPtr
)
Fragrecord
*
const
regFragPtr
)
{
{
OperationrecPtr
sopTmpOperPtr
;
OperationrecPtr
sopTmpOperPtr
;
/* ----------------------------------------------------------------- */
Uint32
tail
=
regFragPtr
->
lastusedOprec
;
/* LINK THE OPERATION INTO A DOUBLY LINKED LIST ON THE FRAGMENT*/
/* PUT IT FIRST IN THIS LIST SINCE IT DOESN'T MATTER WHERE IT */
/* IS PUT. */
/* ----------------------------------------------------------------- */
ndbrequire
(
regOperPtr
.
p
->
inFragList
==
ZFALSE
);
ndbrequire
(
regOperPtr
.
p
->
inFragList
==
ZFALSE
);
regOperPtr
.
p
->
inFragList
=
ZTRUE
;
regOperPtr
.
p
->
inFragList
=
ZTRUE
;
regOperPtr
.
p
->
prevOprecInList
=
RNIL
;
regOperPtr
.
p
->
prevOprecInList
=
tail
;
sopTmpOperPtr
.
i
=
regFragPtr
->
firstusedOprec
;
regOperPtr
.
p
->
nextOprecInList
=
RNIL
;
sopTmpOperPtr
.
i
=
tail
;
if
(
tail
==
RNIL
)
{
regFragPtr
->
firstusedOprec
=
regOperPtr
.
i
;
regFragPtr
->
firstusedOprec
=
regOperPtr
.
i
;
regOperPtr
.
p
->
nextOprecInList
=
sopTmpOperPtr
.
i
;
if
(
sopTmpOperPtr
.
i
==
RNIL
)
{
return
;
}
else
{
}
else
{
jam
();
jam
();
ptrCheckGuard
(
sopTmpOperPtr
,
cnoOfOprec
,
operationrec
);
ptrCheckGuard
(
sopTmpOperPtr
,
cnoOfOprec
,
operationrec
);
sopTmpOperPtr
.
p
->
prev
OprecInList
=
regOperPtr
.
i
;
sopTmpOperPtr
.
p
->
next
OprecInList
=
regOperPtr
.
i
;
}
//if
}
//if
regFragPtr
->
lastusedOprec
=
regOperPtr
.
i
;
}
//Dbtup::linkOpIntoFragList()
}
//Dbtup::linkOpIntoFragList()
/*
/*
...
...
ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
View file @
b3463f6d
...
@@ -963,6 +963,7 @@ void Dbtup::initializeFragrecord()
...
@@ -963,6 +963,7 @@ void Dbtup::initializeFragrecord()
regFragPtr
.
p
->
nextfreefrag
=
regFragPtr
.
i
+
1
;
regFragPtr
.
p
->
nextfreefrag
=
regFragPtr
.
i
+
1
;
regFragPtr
.
p
->
checkpointVersion
=
RNIL
;
regFragPtr
.
p
->
checkpointVersion
=
RNIL
;
regFragPtr
.
p
->
firstusedOprec
=
RNIL
;
regFragPtr
.
p
->
firstusedOprec
=
RNIL
;
regFragPtr
.
p
->
lastusedOprec
=
RNIL
;
regFragPtr
.
p
->
fragStatus
=
IDLE
;
regFragPtr
.
p
->
fragStatus
=
IDLE
;
}
//for
}
//for
regFragPtr
.
i
=
cnoOfFragrec
-
1
;
regFragPtr
.
i
=
cnoOfFragrec
-
1
;
...
@@ -1164,7 +1165,7 @@ void Dbtup::execTUPSEIZEREQ(Signal* signal)
...
@@ -1164,7 +1165,7 @@ void Dbtup::execTUPSEIZEREQ(Signal* signal)
return
;
return
;
}
//if
}
//if
regOperPtr
.
p
->
optype
=
ZREAD
;
regOperPtr
.
p
->
optype
=
ZREAD
;
initOpConnection
(
regOperPtr
.
p
);
initOpConnection
(
regOperPtr
.
p
,
0
);
regOperPtr
.
p
->
userpointer
=
userPtr
;
regOperPtr
.
p
->
userpointer
=
userPtr
;
regOperPtr
.
p
->
userblockref
=
userRef
;
regOperPtr
.
p
->
userblockref
=
userRef
;
signal
->
theData
[
0
]
=
regOperPtr
.
p
->
userpointer
;
signal
->
theData
[
0
]
=
regOperPtr
.
p
->
userpointer
;
...
...
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
View file @
b3463f6d
...
@@ -103,7 +103,7 @@ void Ndbcntr::execCONTINUEB(Signal* signal)
...
@@ -103,7 +103,7 @@ void Ndbcntr::execCONTINUEB(Signal* signal)
}
}
Uint64
now
=
NdbTick_CurrentMillisecond
();
Uint64
now
=
NdbTick_CurrentMillisecond
();
if
(
c_start
.
m_startFailureTimeout
>
now
){
if
(
now
>
c_start
.
m_startFailureTimeout
){
ndbrequire
(
false
);
ndbrequire
(
false
);
}
}
...
@@ -446,6 +446,7 @@ void Ndbcntr::execREAD_NODESCONF(Signal* signal)
...
@@ -446,6 +446,7 @@ void Ndbcntr::execREAD_NODESCONF(Signal* signal)
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_START_PARTITION_TIMEOUT
,
&
to_2
);
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_START_PARTITION_TIMEOUT
,
&
to_2
);
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_START_FAILURE_TIMEOUT
,
&
to_3
);
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_START_FAILURE_TIMEOUT
,
&
to_3
);
c_start
.
m_startTime
=
NdbTick_CurrentMillisecond
();
c_start
.
m_startPartialTimeout
=
setTimeout
(
c_start
.
m_startTime
,
to_1
);
c_start
.
m_startPartialTimeout
=
setTimeout
(
c_start
.
m_startTime
,
to_1
);
c_start
.
m_startPartitionedTimeout
=
setTimeout
(
c_start
.
m_startTime
,
to_2
);
c_start
.
m_startPartitionedTimeout
=
setTimeout
(
c_start
.
m_startTime
,
to_2
);
c_start
.
m_startFailureTimeout
=
setTimeout
(
c_start
.
m_startTime
,
to_3
);
c_start
.
m_startFailureTimeout
=
setTimeout
(
c_start
.
m_startTime
,
to_3
);
...
@@ -454,6 +455,9 @@ void Ndbcntr::execREAD_NODESCONF(Signal* signal)
...
@@ -454,6 +455,9 @@ void Ndbcntr::execREAD_NODESCONF(Signal* signal)
sendCntrStartReq
(
signal
);
sendCntrStartReq
(
signal
);
signal
->
theData
[
0
]
=
ZSTARTUP
;
sendSignalWithDelay
(
reference
(),
GSN_CONTINUEB
,
signal
,
1000
,
1
);
return
;
return
;
}
}
...
...
ndb/test/ndbapi/testSystemRestart.cpp
View file @
b3463f6d
...
@@ -872,7 +872,7 @@ int runSystemRestart7(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -872,7 +872,7 @@ int runSystemRestart7(NDBT_Context* ctx, NDBT_Step* step){
const
Uint32
nodeCount
=
restarter
.
getNumDbNodes
();
const
Uint32
nodeCount
=
restarter
.
getNumDbNodes
();
if
(
nodeCount
<
2
){
if
(
nodeCount
<
2
){
g_info
<<
"SR
8
- Needs atleast 2 nodes to test"
<<
endl
;
g_info
<<
"SR
7
- Needs atleast 2 nodes to test"
<<
endl
;
return
NDBT_OK
;
return
NDBT_OK
;
}
}
...
@@ -1001,7 +1001,52 @@ int runSystemRestart8(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -1001,7 +1001,52 @@ int runSystemRestart8(NDBT_Context* ctx, NDBT_Step* step){
i
++
;
i
++
;
}
}
g_info
<<
"runSystemRestart7 finished"
<<
endl
;
g_info
<<
"runSystemRestart8 finished"
<<
endl
;
return
result
;
}
int
runSystemRestart9
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
Ndb
*
pNdb
=
GETNDB
(
step
);
int
result
=
NDBT_OK
;
int
timeout
=
300
;
Uint32
loops
=
ctx
->
getNumLoops
();
int
records
=
ctx
->
getNumRecords
();
NdbRestarter
restarter
;
Uint32
i
=
1
;
Uint32
currentRestartNodeIndex
=
1
;
UtilTransactions
utilTrans
(
*
ctx
->
getTab
());
HugoTransactions
hugoTrans
(
*
ctx
->
getTab
());
int
args
[]
=
{
DumpStateOrd
::
DihMaxTimeBetweenLCP
};
int
dump
[]
=
{
DumpStateOrd
::
DihStartLcpImmediately
};
do
{
CHECK
(
restarter
.
dumpStateAllNodes
(
args
,
1
)
==
0
);
HugoOperations
ops
(
*
ctx
->
getTab
());
CHECK
(
ops
.
startTransaction
(
pNdb
)
==
0
);
for
(
i
=
0
;
i
<
10
;
i
++
){
CHECK
(
ops
.
pkInsertRecord
(
pNdb
,
i
,
1
,
1
)
==
0
);
CHECK
(
ops
.
execute_NoCommit
(
pNdb
)
==
0
);
}
for
(
i
=
0
;
i
<
10
;
i
++
){
CHECK
(
ops
.
pkUpdateRecord
(
pNdb
,
i
,
1
)
==
0
);
CHECK
(
ops
.
execute_NoCommit
(
pNdb
)
==
0
);
}
NdbSleep_SecSleep
(
10
);
CHECK
(
restarter
.
dumpStateAllNodes
(
dump
,
1
)
==
0
);
NdbSleep_SecSleep
(
10
);
CHECK
(
ops
.
execute_Commit
(
pNdb
)
==
0
);
CHECK
(
restarter
.
restartAll
()
==
0
);
CHECK
(
restarter
.
waitClusterStarted
(
timeout
)
==
0
);
CHECK
(
pNdb
->
waitUntilReady
(
timeout
)
==
0
);
ops
.
closeTransaction
(
pNdb
);
}
while
(
0
);
g_info
<<
"runSystemRestart9 finished"
<<
endl
;
return
result
;
return
result
;
}
}
...
@@ -1176,6 +1221,19 @@ TESTCASE("SR8",
...
@@ -1176,6 +1221,19 @@ TESTCASE("SR8",
STEP
(
runSystemRestart8
);
STEP
(
runSystemRestart8
);
FINALIZER
(
runClearTable
);
FINALIZER
(
runClearTable
);
}
}
TESTCASE
(
"SR9"
,
"Perform partition win system restart with other nodes delayed
\n
"
"* 1. Start transaction
\n
"
"* 2. insert (1,1)
\n
"
"* 3. update (1,2)
\n
"
"* 4. start lcp
\n
"
"* 5. commit
\n
"
"* 6. restart
\n
"
){
INITIALIZER
(
runWaitStarted
);
INITIALIZER
(
runClearTable
);
STEP
(
runSystemRestart9
);
FINALIZER
(
runClearTable
);
}
NDBT_TESTSUITE_END
(
testSystemRestart
);
NDBT_TESTSUITE_END
(
testSystemRestart
);
int
main
(
int
argc
,
const
char
**
argv
){
int
main
(
int
argc
,
const
char
**
argv
){
...
...
ndb/test/run-test/daily-devel-tests.txt
View file @
b3463f6d
...
@@ -190,3 +190,19 @@ max-time: 2500
...
@@ -190,3 +190,19 @@ max-time: 2500
cmd: test_event
cmd: test_event
args: -n BasicEventOperation T1 T6
args: -n BasicEventOperation T1 T6
#
max-time: 1500
cmd: testSystemRestart
args: -n SR6 -l 1 T1
max-time: 1500
cmd: testSystemRestart
args: -n SR7 -l 1 T1
max-time: 1500
cmd: testSystemRestart
args: -n S8 -l 1 T1
max-time: 1500
cmd: testSystemRestart
args: -n S9 -l 1 T1
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