diff options
author | tomas@whalegate.ndb.mysql.com <> | 2007-05-22 17:53:07 +0200 |
---|---|---|
committer | tomas@whalegate.ndb.mysql.com <> | 2007-05-22 17:53:07 +0200 |
commit | b46c826aee666ef9bc05a287248d157987e51b2c (patch) | |
tree | d7fe615b2f32e32607f7bea9e64d0317f6f3a35c /storage | |
parent | d424f0d890c854c6ada0d6ee289d41fc5f4d0711 (diff) | |
download | mariadb-git-b46c826aee666ef9bc05a287248d157987e51b2c.tar.gz |
Bug #28593 cluster backup scans in acc index order, bad for disk data
- change to scan in tup and disk order (if applicable)
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ndb/src/kernel/blocks/backup/Backup.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 29 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp | 21 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/pgman.cpp | 2 |
5 files changed, 47 insertions, 9 deletions
diff --git a/storage/ndb/src/kernel/blocks/backup/Backup.cpp b/storage/ndb/src/kernel/blocks/backup/Backup.cpp index a07617f0bfb..57082eaccc8 100644 --- a/storage/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/storage/ndb/src/kernel/blocks/backup/Backup.cpp @@ -3543,10 +3543,10 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) ScanFragReq::setHoldLockFlag(req->requestInfo, 0); ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); ScanFragReq::setAttrLen(req->requestInfo,attrLen); + ScanFragReq::setTupScanFlag(req->requestInfo, 1); if (ptr.p->is_lcp()) { ScanFragReq::setScanPrio(req->requestInfo, 1); - ScanFragReq::setTupScanFlag(req->requestInfo, 1); ScanFragReq::setNoDiskFlag(req->requestInfo, 1); ScanFragReq::setLcpScanFlag(req->requestInfo, 1); } diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index a359267f9d9..6c99e8d0e13 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -8476,9 +8476,32 @@ void Dblqh::continueAfterReceivingAllAiLab(Signal* signal) AccScanReq::setLockMode(req->requestInfo, scanptr.p->scanLockMode); AccScanReq::setReadCommittedFlag(req->requestInfo, scanptr.p->readCommitted); AccScanReq::setDescendingFlag(req->requestInfo, scanptr.p->descending); - AccScanReq::setNoDiskScanFlag(req->requestInfo, - !tcConnectptr.p->m_disk_table); - AccScanReq::setLcpScanFlag(req->requestInfo, scanptr.p->lcpScan); + + if (refToBlock(tcConnectptr.p->clientBlockref) == BACKUP) + { + if (scanptr.p->lcpScan) + { + AccScanReq::setNoDiskScanFlag(req->requestInfo, 1); + AccScanReq::setLcpScanFlag(req->requestInfo, 1); + } + else + { + /* If backup scan disktables in disk order */ + AccScanReq::setNoDiskScanFlag(req->requestInfo, + !tcConnectptr.p->m_disk_table); + AccScanReq::setLcpScanFlag(req->requestInfo, 0); + } + } + else + { +#if BUG_27776_FIXED + AccScanReq::setNoDiskScanFlag(req->requestInfo, + !tcConnectptr.p->m_disk_table); +#else + AccScanReq::setNoDiskScanFlag(req->requestInfo, 1); +#endif + AccScanReq::setLcpScanFlag(req->requestInfo, 0); + } req->transId1 = tcConnectptr.p->transid[0]; req->transId2 = tcConnectptr.p->transid[1]; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp index 54abbf18664..db336df6652 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp @@ -318,6 +318,7 @@ Dbtup::restart_setup_page(Disk_alloc_info& alloc, PagePtr pagePtr) unsigned uncommitted, committed; uncommitted = committed = ~(unsigned)0; int ret = tsman.get_page_free_bits(&page, &uncommitted, &committed); + jamEntry(); idx = alloc.calc_page_free_bits(real_free); ddassert(idx == committed); @@ -428,12 +429,12 @@ Dbtup::disk_page_prealloc(Signal* signal, c_extent_pool.getPtr(ext); if ((pageBits= tsman.alloc_page_from_extent(&ext.p->m_key, bits)) >= 0) { - jam(); + jamEntry(); found= true; } else { - jam(); + jamEntry(); /** * The current extent is not in a free list * and since it couldn't accomadate the request @@ -490,7 +491,7 @@ Dbtup::disk_page_prealloc(Signal* signal, if ((err= tsman.alloc_extent(&ext.p->m_key)) < 0) { - jam(); + jamEntry(); #if NOT_YET_UNDO_ALLOC_EXTENT c_lgman->free_log_space(logfile_group_id, sizeof(Disk_undo::AllocExtent)>>2); @@ -542,6 +543,7 @@ Dbtup::disk_page_prealloc(Signal* signal, alloc.m_curr_extent_info_ptr_i= ext.i; ext.p->m_free_matrix_pos= RNIL; pageBits= tsman.alloc_page_from_extent(&ext.p->m_key, bits); + jamEntry(); ddassert(pageBits >= 0); } @@ -601,6 +603,7 @@ Dbtup::disk_page_prealloc(Signal* signal, } int res= m_pgman.get_page(signal, preq, flags); + jamEntry(); switch(res) { case 0: @@ -900,6 +903,7 @@ Dbtup::disk_page_set_dirty(PagePtr pagePtr) // Make sure no one will allocate it... tsman.unmap_page(&key, MAX_FREE_LIST - 1); + jamEntry(); } void @@ -951,6 +955,7 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count) fragPtr.p->m_tablespace_id); tsman.unmap_page(&key, idx); + jamEntry(); pagePtr.p->list_index = idx | 0x8000; } @@ -999,6 +1004,7 @@ Dbtup::disk_page_alloc(Signal* signal, fragPtrP->m_tablespace_id); tsman.update_page_free_bits(key, new_bits, lsn); + jamEntry(); } } @@ -1051,6 +1057,7 @@ Dbtup::disk_page_free(Signal *signal, fragPtrP->m_tablespace_id); tsman.update_page_free_bits(key, new_bits, lsn); + jamEntry(); } Uint32 ext = pagePtr.p->m_extent_info_ptr; @@ -1104,6 +1111,7 @@ Dbtup::disk_page_abort_prealloc(Signal *signal, Fragrecord* fragPtrP, memcpy(&req.m_page, key, sizeof(Local_key)); int res= m_pgman.get_page(signal, req, flags); + jamEntry(); switch(res) { case 0: @@ -1232,6 +1240,7 @@ Dbtup::disk_page_alloc_extent_log_buffer_callback(Signal* signal, Uint64 lsn= lgman.add_entry(c, 1); tsman.update_lsn(&key, lsn); + jamEntry(); } #endif @@ -1250,6 +1259,7 @@ Dbtup::disk_page_undo_alloc(Page* page, const Local_key* key, Uint64 lsn= lgman.add_entry(c, 1); m_pgman.update_lsn(* key, lsn); + jamEntry(); return lsn; } @@ -1279,6 +1289,7 @@ Dbtup::disk_page_undo_update(Page* page, const Local_key* key, Uint64 lsn= lgman.add_entry(c, 3); m_pgman.update_lsn(* key, lsn); + jamEntry(); return lsn; } @@ -1308,6 +1319,7 @@ Dbtup::disk_page_undo_free(Page* page, const Local_key* key, Uint64 lsn= lgman.add_entry(c, 3); m_pgman.update_lsn(* key, lsn); + jamEntry(); return lsn; } @@ -1402,6 +1414,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, int flags = 0; int res= m_pgman.get_page(signal, preq, flags); + jamEntry(); switch(res) { case 0: @@ -1545,6 +1558,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal, lsn = undo->m_lsn - 1; // make sure undo isn't run again... m_pgman.update_lsn(undo->m_key, lsn); + jamEntry(); } else if (DBG_UNDO) { @@ -1637,6 +1651,7 @@ Dbtup::disk_restart_undo_page_bits(Signal* signal, Apply_undo* undo) fragPtrP->m_tablespace_id); tsman.restart_undo_page_free_bits(&undo->m_key, new_bits, undo->m_lsn, lsn); + jamEntry(); } int diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index 04e60edfb2e..eb9b9c7acc2 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -62,13 +62,11 @@ Dbtup::execACC_SCANREQ(Signal* signal) break; } -#if BUG_27776_FIXED if (!AccScanReq::getNoDiskScanFlag(req->requestInfo) && tablePtr.p->m_no_of_disk_attributes) { bits |= ScanOp::SCAN_DD; } -#endif bool mm = (bits & ScanOp::SCAN_DD); if (tablePtr.p->m_attributes[mm].m_no_of_varsize > 0) { diff --git a/storage/ndb/src/kernel/blocks/pgman.cpp b/storage/ndb/src/kernel/blocks/pgman.cpp index af648c71253..719b60fa466 100644 --- a/storage/ndb/src/kernel/blocks/pgman.cpp +++ b/storage/ndb/src/kernel/blocks/pgman.cpp @@ -1561,6 +1561,7 @@ Pgman::execFSWRITEREF(Signal* signal) int Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req) { + jamEntry(); #ifdef VM_TRACE Ptr<Page_request> tmp = { &page_req, RNIL}; debugOut << "PGMAN: >get_page" << endl; @@ -1708,6 +1709,7 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req) void Pgman::update_lsn(Ptr<Page_entry> ptr, Uint32 block, Uint64 lsn) { + jamEntry(); #ifdef VM_TRACE const char* bname = getBlockName(block, "?"); debugOut << "PGMAN: >update_lsn: block=" << bname << " lsn=" << lsn << endl; |