Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2350 06/04/24 09:02:46 jonas@stripped +5 -0
ndb - bug#18780
Fix various abort cases (mainly MM but also 1 DD)
that has been found running dbt2
storage/ndb/test/run-test/daily-basic-tests.txt
1.43 06/04/24 09:02:43 jonas@stripped +7 -3
Add autotest of various abort cases
storage/ndb/test/ndbapi/testBasic.cpp
1.12 06/04/24 09:02:43 jonas@stripped +45 -0
Add new testcases for various abort cases
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
1.33 06/04/24 09:02:43 jonas@stripped +4 -5
Fix abort case
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
1.16 06/04/24 09:02:43 jonas@stripped +3 -8
Set page dirty even if in cache
storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp
1.9 06/04/24 09:02:43 jonas@stripped +12 -2
Fix abort case
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jonas
# Host: perch.ndb.mysql.com
# Root: /home/jonas/src/51-work
--- 1.15/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2006-04-21 06:51:55 +02:00
+++ 1.16/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2006-04-24 09:02:43 +02:00
@@ -1053,7 +1053,6 @@
Ptr<Fragrecord> fragPtr;
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);
}
@@ -1063,6 +1062,9 @@
PagePtr pagePtr,
Uint32 sz)
{
+ jam();
+ disk_page_set_dirty(pagePtr);
+
Disk_alloc_info& alloc= fragPtrP->m_disk_alloc_info;
Uint32 page_idx = pagePtr.p->list_index;
Uint32 used = pagePtr.p->uncommitted_used_space;
@@ -1075,13 +1077,6 @@
ddassert(alloc.calc_page_free_bits(free - used) == old_idx);
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;
c_extent_pool.getPtr(extentPtr, ext);
if (old_idx != new_idx)
--- 1.42/storage/ndb/test/run-test/daily-basic-tests.txt 2006-04-21 09:09:30 +02:00
+++ 1.43/storage/ndb/test/run-test/daily-basic-tests.txt 2006-04-24 09:02:43 +02:00
@@ -201,15 +201,19 @@
max-time: 500
cmd: testBasic
-args: -n MassiveRollback T1 T6 T13 D1 D2
+args: -n MassiveRollback T1 T7 D1 D2
max-time: 500
cmd: testBasic
-args: -n MassiveRollback2 T1 T6 T13 D1 D2
+args: -n MassiveRollback2 T1 T7 D1 D2
max-time: 500
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
cmd: testBasic
--- 1.8/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp 2006-04-21 09:09:30 +02:00
+++ 1.9/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp 2006-04-24 09:02:43 +02:00
@@ -118,7 +118,8 @@
PagePtr page;
Tuple_header *tuple_ptr= (Tuple_header*)
get_ptr(&page, ®OperPtr.p->m_tuple_location, regTabPtr.p);
-
+
+ Uint32 bits= tuple_ptr->m_header_bits;
if(regOperPtr.p->op_struct.op_type != ZDELETE)
{
Tuple_header *copy= (Tuple_header*)
@@ -132,7 +133,7 @@
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;
if(! (bits & Tuple_header::ALLOC))
{
@@ -170,6 +171,15 @@
/**
* Aborting last operation that performed ALLOC
*/
+ tuple_ptr->m_header_bits &= ~(Uint32)Tuple_header::ALLOC;
+ 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;
}
--- 1.32/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2006-04-21 13:58:52 +02:00
+++ 1.33/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2006-04-24 09:02:43 +02:00
@@ -1408,8 +1408,6 @@
}
req_struct->m_use_rowid = false;
base->m_header_bits &= ~(Uint32)Tuple_header::FREE;
- base->m_header_bits |= Tuple_header::ALLOC &
- (regOperPtr.p->is_first_operation() ? ~0 : 1);
}
else
{
@@ -1418,8 +1416,6 @@
{
ndbout_c("no mem insert but rowid (same)");
base->m_header_bits &= ~(Uint32)Tuple_header::FREE;
- base->m_header_bits |= Tuple_header::ALLOC &
- (regOperPtr.p->is_first_operation() ? ~0 : 1);
}
else
{
@@ -1427,6 +1423,9 @@
ndbrequire(false);
}
}
+
+ base->m_header_bits |= Tuple_header::ALLOC &
+ (regOperPtr.p->is_first_operation() ? ~0 : 1);
if (disk_insert)
{
@@ -2888,7 +2887,7 @@
if(needed <= alloc)
{
- ndbassert(!regOperPtr->is_first_operation());
+ //ndbassert(!regOperPtr->is_first_operation());
ndbout_c(" no grow");
return 0;
}
--- 1.11/storage/ndb/test/ndbapi/testBasic.cpp 2006-04-21 09:09:30 +02:00
+++ 1.12/storage/ndb/test/ndbapi/testBasic.cpp 2006-04-24 09:02:43 +02:00
@@ -1042,6 +1042,38 @@
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 OPS_TOTAL = 20;
const Uint32 LOOPS = 100;
@@ -1052,6 +1084,12 @@
for (Uint32 i = 0; i<OPS_TOTAL; i+= BATCH)
{
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)
{
ok = false;
@@ -1397,6 +1435,13 @@
INITIALIZER(runClearTable2);
STEP(runMassiveRollback3);
STEP(runMassiveRollback3);
+ FINALIZER(runClearTable2);
+}
+TESTCASE("MassiveRollback4",
+ "Test rollback of 4096 operations"){
+ INITIALIZER(runClearTable2);
+ STEP(runMassiveRollback4);
+ STEP(runMassiveRollback4);
FINALIZER(runClearTable2);
}
TESTCASE("MassiveTransaction",
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2350) BUG#18780 | jonas | 24 Apr |