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
f4226023
Commit
f4226023
authored
Apr 24, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#18780
Fix various abort cases (mainly MM but also 1 DD) that has been found running dbt2
parent
34f4301c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
18 deletions
+71
-18
storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
+12
-2
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
+3
-8
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+4
-5
storage/ndb/test/ndbapi/testBasic.cpp
storage/ndb/test/ndbapi/testBasic.cpp
+45
-0
storage/ndb/test/run-test/daily-basic-tests.txt
storage/ndb/test/run-test/daily-basic-tests.txt
+7
-3
No files found.
storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
View file @
f4226023
...
@@ -118,7 +118,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
...
@@ -118,7 +118,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
PagePtr
page
;
PagePtr
page
;
Tuple_header
*
tuple_ptr
=
(
Tuple_header
*
)
Tuple_header
*
tuple_ptr
=
(
Tuple_header
*
)
get_ptr
(
&
page
,
&
regOperPtr
.
p
->
m_tuple_location
,
regTabPtr
.
p
);
get_ptr
(
&
page
,
&
regOperPtr
.
p
->
m_tuple_location
,
regTabPtr
.
p
);
Uint32
bits
=
tuple_ptr
->
m_header_bits
;
if
(
regOperPtr
.
p
->
op_struct
.
op_type
!=
ZDELETE
)
if
(
regOperPtr
.
p
->
op_struct
.
op_type
!=
ZDELETE
)
{
{
Tuple_header
*
copy
=
(
Tuple_header
*
)
Tuple_header
*
copy
=
(
Tuple_header
*
)
...
@@ -132,7 +133,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
...
@@ -132,7 +133,7 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
disk_page_abort_prealloc
(
signal
,
regFragPtr
.
p
,
&
key
,
key
.
m_page_idx
);
disk_page_abort_prealloc
(
signal
,
regFragPtr
.
p
,
&
key
,
key
.
m_page_idx
);
}
}
Uint32
bits
=
tuple_ptr
->
m_header_bits
;
Uint32
copy_bits
=
copy
->
m_header_bits
;
Uint32
copy_bits
=
copy
->
m_header_bits
;
if
(
!
(
bits
&
Tuple_header
::
ALLOC
))
if
(
!
(
bits
&
Tuple_header
::
ALLOC
))
{
{
...
@@ -174,6 +175,15 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
...
@@ -174,6 +175,15 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
tuple_ptr
->
m_header_bits
|=
Tuple_header
::
FREED
;
tuple_ptr
->
m_header_bits
|=
Tuple_header
::
FREED
;
}
}
}
}
else
if
(
regOperPtr
.
p
->
is_first_operation
()
&&
regOperPtr
.
p
->
is_last_operation
())
{
if
(
bits
&
Tuple_header
::
ALLOC
)
{
tuple_ptr
->
m_header_bits
&=
~
(
Uint32
)
Tuple_header
::
ALLOC
;
tuple_ptr
->
m_header_bits
|=
Tuple_header
::
FREED
;
}
}
if
(
regOperPtr
.
p
->
is_first_operation
()
&&
regOperPtr
.
p
->
is_last_operation
())
if
(
regOperPtr
.
p
->
is_first_operation
()
&&
regOperPtr
.
p
->
is_last_operation
())
{
{
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
View file @
f4226023
...
@@ -1053,7 +1053,6 @@ Dbtup::disk_page_abort_prealloc_callback(Signal* signal,
...
@@ -1053,7 +1053,6 @@ Dbtup::disk_page_abort_prealloc_callback(Signal* signal,
Ptr
<
Fragrecord
>
fragPtr
;
Ptr
<
Fragrecord
>
fragPtr
;
getFragmentrec
(
fragPtr
,
pagePtr
.
p
->
m_fragment_id
,
tabPtr
.
p
);
getFragmentrec
(
fragPtr
,
pagePtr
.
p
->
m_fragment_id
,
tabPtr
.
p
);
disk_page_set_dirty
(
pagePtr
);
disk_page_abort_prealloc_callback_1
(
signal
,
fragPtr
.
p
,
pagePtr
,
sz
);
disk_page_abort_prealloc_callback_1
(
signal
,
fragPtr
.
p
,
pagePtr
,
sz
);
}
}
...
@@ -1063,6 +1062,9 @@ Dbtup::disk_page_abort_prealloc_callback_1(Signal* signal,
...
@@ -1063,6 +1062,9 @@ Dbtup::disk_page_abort_prealloc_callback_1(Signal* signal,
PagePtr
pagePtr
,
PagePtr
pagePtr
,
Uint32
sz
)
Uint32
sz
)
{
{
jam
();
disk_page_set_dirty
(
pagePtr
);
Disk_alloc_info
&
alloc
=
fragPtrP
->
m_disk_alloc_info
;
Disk_alloc_info
&
alloc
=
fragPtrP
->
m_disk_alloc_info
;
Uint32
page_idx
=
pagePtr
.
p
->
list_index
;
Uint32
page_idx
=
pagePtr
.
p
->
list_index
;
Uint32
used
=
pagePtr
.
p
->
uncommitted_used_space
;
Uint32
used
=
pagePtr
.
p
->
uncommitted_used_space
;
...
@@ -1075,13 +1077,6 @@ Dbtup::disk_page_abort_prealloc_callback_1(Signal* signal,
...
@@ -1075,13 +1077,6 @@ Dbtup::disk_page_abort_prealloc_callback_1(Signal* signal,
ddassert
(
alloc
.
calc_page_free_bits
(
free
-
used
)
==
old_idx
);
ddassert
(
alloc
.
calc_page_free_bits
(
free
-
used
)
==
old_idx
);
Uint32
new_idx
=
alloc
.
calc_page_free_bits
(
free
-
used
+
sz
);
Uint32
new_idx
=
alloc
.
calc_page_free_bits
(
free
-
used
+
sz
);
#ifdef VM_TRACE
Local_key
key
;
key
.
m_page_no
=
pagePtr
.
p
->
m_page_no
;
key
.
m_file_no
=
pagePtr
.
p
->
m_file_no
;
ndbout
<<
"disk_page_abort_prealloc_callback_1"
<<
key
<<
endl
;
#endif
Ptr
<
Extent_info
>
extentPtr
;
Ptr
<
Extent_info
>
extentPtr
;
c_extent_pool
.
getPtr
(
extentPtr
,
ext
);
c_extent_pool
.
getPtr
(
extentPtr
,
ext
);
if
(
old_idx
!=
new_idx
)
if
(
old_idx
!=
new_idx
)
...
...
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
View file @
f4226023
...
@@ -1408,8 +1408,6 @@ int Dbtup::handleInsertReq(Signal* signal,
...
@@ -1408,8 +1408,6 @@ int Dbtup::handleInsertReq(Signal* signal,
}
}
req_struct
->
m_use_rowid
=
false
;
req_struct
->
m_use_rowid
=
false
;
base
->
m_header_bits
&=
~
(
Uint32
)
Tuple_header
::
FREE
;
base
->
m_header_bits
&=
~
(
Uint32
)
Tuple_header
::
FREE
;
base
->
m_header_bits
|=
Tuple_header
::
ALLOC
&
(
regOperPtr
.
p
->
is_first_operation
()
?
~
0
:
1
);
}
}
else
else
{
{
...
@@ -1418,8 +1416,6 @@ int Dbtup::handleInsertReq(Signal* signal,
...
@@ -1418,8 +1416,6 @@ int Dbtup::handleInsertReq(Signal* signal,
{
{
ndbout_c
(
"no mem insert but rowid (same)"
);
ndbout_c
(
"no mem insert but rowid (same)"
);
base
->
m_header_bits
&=
~
(
Uint32
)
Tuple_header
::
FREE
;
base
->
m_header_bits
&=
~
(
Uint32
)
Tuple_header
::
FREE
;
base
->
m_header_bits
|=
Tuple_header
::
ALLOC
&
(
regOperPtr
.
p
->
is_first_operation
()
?
~
0
:
1
);
}
}
else
else
{
{
...
@@ -1427,6 +1423,9 @@ int Dbtup::handleInsertReq(Signal* signal,
...
@@ -1427,6 +1423,9 @@ int Dbtup::handleInsertReq(Signal* signal,
ndbrequire
(
false
);
ndbrequire
(
false
);
}
}
}
}
base
->
m_header_bits
|=
Tuple_header
::
ALLOC
&
(
regOperPtr
.
p
->
is_first_operation
()
?
~
0
:
1
);
if
(
disk_insert
)
if
(
disk_insert
)
{
{
...
@@ -2888,7 +2887,7 @@ Dbtup::handle_size_change_after_update(KeyReqStruct* req_struct,
...
@@ -2888,7 +2887,7 @@ Dbtup::handle_size_change_after_update(KeyReqStruct* req_struct,
if
(
needed
<=
alloc
)
if
(
needed
<=
alloc
)
{
{
ndbassert
(
!
regOperPtr
->
is_first_operation
());
//
ndbassert(!regOperPtr->is_first_operation());
ndbout_c
(
" no grow"
);
ndbout_c
(
" no grow"
);
return
0
;
return
0
;
}
}
...
...
storage/ndb/test/ndbapi/testBasic.cpp
View file @
f4226023
...
@@ -1041,6 +1041,38 @@ runMassiveRollback3(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -1041,6 +1041,38 @@ runMassiveRollback3(NDBT_Context* ctx, NDBT_Step* step){
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
Ndb
*
pNdb
=
GETNDB
(
step
);
Ndb
*
pNdb
=
GETNDB
(
step
);
const
Uint32
BATCH
=
10
;
const
Uint32
OPS_TOTAL
=
50
;
const
Uint32
LOOPS
=
100
;
for
(
Uint32
loop
=
0
;
loop
<
LOOPS
;
loop
++
)
{
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
bool
ok
=
true
;
for
(
Uint32
i
=
0
;
i
<
OPS_TOTAL
;
i
+=
BATCH
)
{
CHECK
(
hugoOps
.
pkInsertRecord
(
pNdb
,
i
,
BATCH
,
0
)
==
0
);
if
(
hugoOps
.
execute_NoCommit
(
pNdb
)
!=
0
)
{
ok
=
false
;
break
;
}
}
hugoOps
.
execute_Rollback
(
pNdb
);
CHECK
(
hugoOps
.
closeTransaction
(
pNdb
)
==
0
);
}
hugoOps
.
closeTransaction
(
pNdb
);
return
result
;
}
int
runMassiveRollback4
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
Ndb
*
pNdb
=
GETNDB
(
step
);
const
Uint32
BATCH
=
10
;
const
Uint32
BATCH
=
10
;
const
Uint32
OPS_TOTAL
=
20
;
const
Uint32
OPS_TOTAL
=
20
;
const
Uint32
LOOPS
=
100
;
const
Uint32
LOOPS
=
100
;
...
@@ -1052,6 +1084,12 @@ runMassiveRollback3(NDBT_Context* ctx, NDBT_Step* step){
...
@@ -1052,6 +1084,12 @@ runMassiveRollback3(NDBT_Context* ctx, NDBT_Step* step){
for
(
Uint32
i
=
0
;
i
<
OPS_TOTAL
;
i
+=
BATCH
)
for
(
Uint32
i
=
0
;
i
<
OPS_TOTAL
;
i
+=
BATCH
)
{
{
CHECK
(
hugoOps
.
pkInsertRecord
(
pNdb
,
i
,
BATCH
,
0
)
==
0
);
CHECK
(
hugoOps
.
pkInsertRecord
(
pNdb
,
i
,
BATCH
,
0
)
==
0
);
CHECK
(
hugoOps
.
pkDeleteRecord
(
pNdb
,
i
,
BATCH
)
==
0
);
if
(
hugoOps
.
execute_NoCommit
(
pNdb
)
!=
0
)
{
ok
=
false
;
break
;
}
if
(
hugoOps
.
execute_NoCommit
(
pNdb
)
!=
0
)
if
(
hugoOps
.
execute_NoCommit
(
pNdb
)
!=
0
)
{
{
ok
=
false
;
ok
=
false
;
...
@@ -1399,6 +1437,13 @@ TESTCASE("MassiveRollback3",
...
@@ -1399,6 +1437,13 @@ TESTCASE("MassiveRollback3",
STEP
(
runMassiveRollback3
);
STEP
(
runMassiveRollback3
);
FINALIZER
(
runClearTable2
);
FINALIZER
(
runClearTable2
);
}
}
TESTCASE
(
"MassiveRollback4"
,
"Test rollback of 4096 operations"
){
INITIALIZER
(
runClearTable2
);
STEP
(
runMassiveRollback4
);
STEP
(
runMassiveRollback4
);
FINALIZER
(
runClearTable2
);
}
TESTCASE
(
"MassiveTransaction"
,
TESTCASE
(
"MassiveTransaction"
,
"Test very large insert transaction"
){
"Test very large insert transaction"
){
INITIALIZER
(
runLoadTable2
);
INITIALIZER
(
runLoadTable2
);
...
...
storage/ndb/test/run-test/daily-basic-tests.txt
View file @
f4226023
...
@@ -201,15 +201,19 @@ args: -n PkDeleteAsynch
...
@@ -201,15 +201,19 @@ args: -n PkDeleteAsynch
max-time: 500
max-time: 500
cmd: testBasic
cmd: testBasic
args: -n MassiveRollback T1 T
6 T13
D1 D2
args: -n MassiveRollback T1 T
7
D1 D2
max-time: 500
max-time: 500
cmd: testBasic
cmd: testBasic
args: -n MassiveRollback2 T1 T
6 T13
D1 D2
args: -n MassiveRollback2 T1 T
7
D1 D2
max-time: 500
max-time: 500
cmd: testBasic
cmd: testBasic
args: -n MassiveRollback3 T1 D1
args: -n MassiveRollback3 T1 T7 D1 D2
max-time: 500
cmd: testBasic
args: -n MassiveRollback4 T1 T7 D1 D2
max-time: 500
max-time: 500
cmd: testBasic
cmd: testBasic
...
...
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