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
850211eb
Commit
850211eb
authored
Apr 23, 2005
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
b75789e3
6778b029
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
234 additions
and
77 deletions
+234
-77
ndb/src/kernel/blocks/dbtup/Dbtup.hpp
ndb/src/kernel/blocks/dbtup/Dbtup.hpp
+8
-0
ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
+41
-39
ndb/src/kernel/blocks/dbtup/Notes.txt
ndb/src/kernel/blocks/dbtup/Notes.txt
+20
-5
ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
+11
-0
ndb/src/ndbapi/ndberror.c
ndb/src/ndbapi/ndberror.c
+3
-2
ndb/test/ndbapi/testOIBasic.cpp
ndb/test/ndbapi/testOIBasic.cpp
+151
-31
No files found.
ndb/src/kernel/blocks/dbtup/Dbtup.hpp
View file @
850211eb
...
@@ -1779,6 +1779,10 @@ private:
...
@@ -1779,6 +1779,10 @@ private:
Operationrec
*
const
regOperPtr
,
Operationrec
*
const
regOperPtr
,
Tablerec
*
const
regTabPtr
);
Tablerec
*
const
regTabPtr
);
int
addTuxEntries
(
Signal
*
signal
,
Operationrec
*
regOperPtr
,
Tablerec
*
regTabPtr
);
// these crash the node on error
// these crash the node on error
void
executeTuxCommitTriggers
(
Signal
*
signal
,
void
executeTuxCommitTriggers
(
Signal
*
signal
,
...
@@ -1789,6 +1793,10 @@ private:
...
@@ -1789,6 +1793,10 @@ private:
Operationrec
*
regOperPtr
,
Operationrec
*
regOperPtr
,
Tablerec
*
const
regTabPtr
);
Tablerec
*
const
regTabPtr
);
void
removeTuxEntries
(
Signal
*
signal
,
Operationrec
*
regOperPtr
,
Tablerec
*
regTabPtr
);
// *****************************************************************
// *****************************************************************
// Error Handling routines.
// Error Handling routines.
// *****************************************************************
// *****************************************************************
...
...
ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp
View file @
850211eb
...
@@ -973,25 +973,7 @@ Dbtup::executeTuxInsertTriggers(Signal* signal,
...
@@ -973,25 +973,7 @@ Dbtup::executeTuxInsertTriggers(Signal* signal,
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
tupVersion
=
tupVersion
;
req
->
tupVersion
=
tupVersion
;
req
->
opInfo
=
TuxMaintReq
::
OpAdd
;
req
->
opInfo
=
TuxMaintReq
::
OpAdd
;
// loop over index list
return
addTuxEntries
(
signal
,
regOperPtr
,
regTabPtr
);
const
ArrayList
<
TupTriggerData
>&
triggerList
=
regTabPtr
->
tuxCustomTriggers
;
TriggerPtr
triggerPtr
;
triggerList
.
first
(
triggerPtr
);
while
(
triggerPtr
.
i
!=
RNIL
)
{
ljam
();
req
->
indexId
=
triggerPtr
.
p
->
indexId
;
req
->
errorCode
=
RNIL
;
EXECUTE_DIRECT
(
DBTUX
,
GSN_TUX_MAINT_REQ
,
signal
,
TuxMaintReq
::
SignalLength
);
ljamEntry
();
if
(
req
->
errorCode
!=
0
)
{
ljam
();
terrorCode
=
req
->
errorCode
;
return
-
1
;
}
triggerList
.
next
(
triggerPtr
);
}
return
0
;
}
}
int
int
...
@@ -1012,9 +994,18 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal,
...
@@ -1012,9 +994,18 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal,
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
tupVersion
=
tupVersion
;
req
->
tupVersion
=
tupVersion
;
req
->
opInfo
=
TuxMaintReq
::
OpAdd
;
req
->
opInfo
=
TuxMaintReq
::
OpAdd
;
// loop over index list
return
addTuxEntries
(
signal
,
regOperPtr
,
regTabPtr
);
}
int
Dbtup
::
addTuxEntries
(
Signal
*
signal
,
Operationrec
*
regOperPtr
,
Tablerec
*
regTabPtr
)
{
TuxMaintReq
*
const
req
=
(
TuxMaintReq
*
)
signal
->
getDataPtrSend
();
const
ArrayList
<
TupTriggerData
>&
triggerList
=
regTabPtr
->
tuxCustomTriggers
;
const
ArrayList
<
TupTriggerData
>&
triggerList
=
regTabPtr
->
tuxCustomTriggers
;
TriggerPtr
triggerPtr
;
TriggerPtr
triggerPtr
;
Uint32
failPtrI
;
triggerList
.
first
(
triggerPtr
);
triggerList
.
first
(
triggerPtr
);
while
(
triggerPtr
.
i
!=
RNIL
)
{
while
(
triggerPtr
.
i
!=
RNIL
)
{
ljam
();
ljam
();
...
@@ -1026,11 +1017,29 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal,
...
@@ -1026,11 +1017,29 @@ Dbtup::executeTuxUpdateTriggers(Signal* signal,
if
(
req
->
errorCode
!=
0
)
{
if
(
req
->
errorCode
!=
0
)
{
ljam
();
ljam
();
terrorCode
=
req
->
errorCode
;
terrorCode
=
req
->
errorCode
;
return
-
1
;
failPtrI
=
triggerPtr
.
i
;
goto
fail
;
}
}
triggerList
.
next
(
triggerPtr
);
triggerList
.
next
(
triggerPtr
);
}
}
return
0
;
return
0
;
fail:
req
->
opInfo
=
TuxMaintReq
::
OpRemove
;
triggerList
.
first
(
triggerPtr
);
while
(
triggerPtr
.
i
!=
failPtrI
)
{
ljam
();
req
->
indexId
=
triggerPtr
.
p
->
indexId
;
req
->
errorCode
=
RNIL
;
EXECUTE_DIRECT
(
DBTUX
,
GSN_TUX_MAINT_REQ
,
signal
,
TuxMaintReq
::
SignalLength
);
ljamEntry
();
ndbrequire
(
req
->
errorCode
==
0
);
triggerList
.
next
(
triggerPtr
);
}
#ifdef VM_TRACE
ndbout
<<
"aborted partial tux update: op "
<<
hex
<<
regOperPtr
<<
endl
;
#endif
return
-
1
;
}
}
int
int
...
@@ -1049,7 +1058,6 @@ Dbtup::executeTuxCommitTriggers(Signal* signal,
...
@@ -1049,7 +1058,6 @@ Dbtup::executeTuxCommitTriggers(Signal* signal,
{
{
TuxMaintReq
*
const
req
=
(
TuxMaintReq
*
)
signal
->
getDataPtrSend
();
TuxMaintReq
*
const
req
=
(
TuxMaintReq
*
)
signal
->
getDataPtrSend
();
// get version
// get version
// XXX could add prevTupVersion to Operationrec
Uint32
tupVersion
;
Uint32
tupVersion
;
if
(
regOperPtr
->
optype
==
ZINSERT
)
{
if
(
regOperPtr
->
optype
==
ZINSERT
)
{
if
(
!
regOperPtr
->
deleteInsertFlag
)
if
(
!
regOperPtr
->
deleteInsertFlag
)
...
@@ -1087,21 +1095,7 @@ Dbtup::executeTuxCommitTriggers(Signal* signal,
...
@@ -1087,21 +1095,7 @@ Dbtup::executeTuxCommitTriggers(Signal* signal,
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
tupVersion
=
tupVersion
;
req
->
tupVersion
=
tupVersion
;
req
->
opInfo
=
TuxMaintReq
::
OpRemove
;
req
->
opInfo
=
TuxMaintReq
::
OpRemove
;
// loop over index list
removeTuxEntries
(
signal
,
regOperPtr
,
regTabPtr
);
const
ArrayList
<
TupTriggerData
>&
triggerList
=
regTabPtr
->
tuxCustomTriggers
;
TriggerPtr
triggerPtr
;
triggerList
.
first
(
triggerPtr
);
while
(
triggerPtr
.
i
!=
RNIL
)
{
ljam
();
req
->
indexId
=
triggerPtr
.
p
->
indexId
;
req
->
errorCode
=
RNIL
;
EXECUTE_DIRECT
(
DBTUX
,
GSN_TUX_MAINT_REQ
,
signal
,
TuxMaintReq
::
SignalLength
);
ljamEntry
();
// commit must succeed
ndbrequire
(
req
->
errorCode
==
0
);
triggerList
.
next
(
triggerPtr
);
}
}
}
void
void
...
@@ -1132,7 +1126,15 @@ Dbtup::executeTuxAbortTriggers(Signal* signal,
...
@@ -1132,7 +1126,15 @@ Dbtup::executeTuxAbortTriggers(Signal* signal,
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
pageOffset
=
regOperPtr
->
pageOffset
;
req
->
tupVersion
=
tupVersion
;
req
->
tupVersion
=
tupVersion
;
req
->
opInfo
=
TuxMaintReq
::
OpRemove
;
req
->
opInfo
=
TuxMaintReq
::
OpRemove
;
// loop over index list
removeTuxEntries
(
signal
,
regOperPtr
,
regTabPtr
);
}
void
Dbtup
::
removeTuxEntries
(
Signal
*
signal
,
Operationrec
*
regOperPtr
,
Tablerec
*
regTabPtr
)
{
TuxMaintReq
*
const
req
=
(
TuxMaintReq
*
)
signal
->
getDataPtrSend
();
const
ArrayList
<
TupTriggerData
>&
triggerList
=
regTabPtr
->
tuxCustomTriggers
;
const
ArrayList
<
TupTriggerData
>&
triggerList
=
regTabPtr
->
tuxCustomTriggers
;
TriggerPtr
triggerPtr
;
TriggerPtr
triggerPtr
;
triggerList
.
first
(
triggerPtr
);
triggerList
.
first
(
triggerPtr
);
...
@@ -1143,7 +1145,7 @@ Dbtup::executeTuxAbortTriggers(Signal* signal,
...
@@ -1143,7 +1145,7 @@ Dbtup::executeTuxAbortTriggers(Signal* signal,
EXECUTE_DIRECT
(
DBTUX
,
GSN_TUX_MAINT_REQ
,
EXECUTE_DIRECT
(
DBTUX
,
GSN_TUX_MAINT_REQ
,
signal
,
TuxMaintReq
::
SignalLength
);
signal
,
TuxMaintReq
::
SignalLength
);
ljamEntry
();
ljamEntry
();
//
abort
must succeed
// must succeed
ndbrequire
(
req
->
errorCode
==
0
);
ndbrequire
(
req
->
errorCode
==
0
);
triggerList
.
next
(
triggerPtr
);
triggerList
.
next
(
triggerPtr
);
}
}
...
...
ndb/src/kernel/blocks/dbtup/Notes.txt
View file @
850211eb
...
@@ -135,6 +135,24 @@ abort DELETE none -
...
@@ -135,6 +135,24 @@ abort DELETE none -
1) alternatively, store prevTupVersion in operation record.
1) alternatively, store prevTupVersion in operation record.
Abort from ordered index error
------------------------------
Obviously, index update failure causes operation failure.
The operation is then aborted later by TC.
The problem here is with multiple indexes. Some may have been
updated successfully before the one that failed. Therefore
the trigger code aborts the successful ones already in
the prepare phase.
In other words, multiple indexes are treated as one.
Abort from any cause
--------------------
[ hairy stuff ]
Read attributes, query status
Read attributes, query status
-----------------------------
-----------------------------
...
@@ -170,14 +188,11 @@ used to decide if the scan can see the tuple.
...
@@ -170,14 +188,11 @@ used to decide if the scan can see the tuple.
This signal may also be called during any phase since commit/abort
This signal may also be called during any phase since commit/abort
of all operations is not done in one time-slice.
of all operations is not done in one time-slice.
Commit and abort
----------------
[ hairy stuff ]
Problems
Problems
--------
--------
Current abort code can destroy a tuple version too early. This
Current abort code can destroy a tuple version too early. This
happens in test case "ticuur" (insert-commit-update-update-rollback),
happens in test case "ticuur" (insert-commit-update-update-rollback),
if abort of first update arrives before abort of second update.
if abort of first update arrives before abort of second update.
vim: set textwidth=68:
ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp
View file @
850211eb
...
@@ -23,6 +23,11 @@
...
@@ -23,6 +23,11 @@
int
int
Dbtux
::
allocNode
(
Signal
*
signal
,
NodeHandle
&
node
)
Dbtux
::
allocNode
(
Signal
*
signal
,
NodeHandle
&
node
)
{
{
if
(
ERROR_INSERTED
(
12007
))
{
jam
();
CLEAR_ERROR_INSERT_VALUE
;
return
TuxMaintReq
::
NoMemError
;
}
Frag
&
frag
=
node
.
m_frag
;
Frag
&
frag
=
node
.
m_frag
;
Uint32
pageId
=
NullTupLoc
.
getPageId
();
Uint32
pageId
=
NullTupLoc
.
getPageId
();
Uint32
pageOffset
=
NullTupLoc
.
getPageOffset
();
Uint32
pageOffset
=
NullTupLoc
.
getPageOffset
();
...
@@ -34,6 +39,12 @@ Dbtux::allocNode(Signal* signal, NodeHandle& node)
...
@@ -34,6 +39,12 @@ Dbtux::allocNode(Signal* signal, NodeHandle& node)
node
.
m_loc
=
TupLoc
(
pageId
,
pageOffset
);
node
.
m_loc
=
TupLoc
(
pageId
,
pageOffset
);
node
.
m_node
=
reinterpret_cast
<
TreeNode
*>
(
node32
);
node
.
m_node
=
reinterpret_cast
<
TreeNode
*>
(
node32
);
ndbrequire
(
node
.
m_loc
!=
NullTupLoc
&&
node
.
m_node
!=
0
);
ndbrequire
(
node
.
m_loc
!=
NullTupLoc
&&
node
.
m_node
!=
0
);
}
else
{
switch
(
errorCode
)
{
case
827
:
errorCode
=
TuxMaintReq
::
NoMemError
;
break
;
}
}
}
return
errorCode
;
return
errorCode
;
}
}
...
...
ndb/src/ndbapi/ndberror.c
View file @
850211eb
...
@@ -179,10 +179,11 @@ ErrorBundle ErrorCodes[] = {
...
@@ -179,10 +179,11 @@ ErrorBundle ErrorCodes[] = {
*/
*/
{
623
,
IS
,
"623"
},
{
623
,
IS
,
"623"
},
{
624
,
IS
,
"624"
},
{
624
,
IS
,
"624"
},
{
625
,
IS
,
"Out of memory in Ndb Kernel, index part (increase IndexMemory)"
},
{
625
,
IS
,
"Out of memory in Ndb Kernel,
hash
index part (increase IndexMemory)"
},
{
640
,
IS
,
"Too many hash indexes (should not happen)"
},
{
640
,
IS
,
"Too many hash indexes (should not happen)"
},
{
826
,
IS
,
"Too many tables and attributes (increase MaxNoOfAttributes or MaxNoOfTables)"
},
{
826
,
IS
,
"Too many tables and attributes (increase MaxNoOfAttributes or MaxNoOfTables)"
},
{
827
,
IS
,
"Out of memory in Ndb Kernel, data part (increase DataMemory)"
},
{
827
,
IS
,
"Out of memory in Ndb Kernel, table data (increase DataMemory)"
},
{
902
,
IS
,
"Out of memory in Ndb Kernel, ordered index data (increase DataMemory)"
},
{
902
,
IS
,
"Out of memory in Ndb Kernel, data part (increase DataMemory)"
},
{
902
,
IS
,
"Out of memory in Ndb Kernel, data part (increase DataMemory)"
},
{
903
,
IS
,
"Too many ordered indexes (increase MaxNoOfOrderedIndexes)"
},
{
903
,
IS
,
"Too many ordered indexes (increase MaxNoOfOrderedIndexes)"
},
{
904
,
IS
,
"Out of fragment records (increase MaxNoOfOrderedIndexes)"
},
{
904
,
IS
,
"Out of fragment records (increase MaxNoOfOrderedIndexes)"
},
...
...
ndb/test/ndbapi/testOIBasic.cpp
View file @
850211eb
This diff is collapsed.
Click to expand it.
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