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.2077 06/01/27 07:34:17 jonas@stripped +3 -0
ndb dd -
fix bug in LCP + extent alloc
storage/ndb/src/kernel/blocks/tsman.cpp
1.5 06/01/27 07:34:14 jonas@stripped +7 -4
ifdef printouts
storage/ndb/src/kernel/blocks/pgman.cpp
1.6 06/01/27 07:34:14 jonas@stripped +50 -5
Fix LCP in pgman with more than 32 pages in one bucket
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
1.7 06/01/27 07:34:14 jonas@stripped +14 -10
fix for page allocation
# 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-new
--- 1.6/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2006-01-26 12:07:18 +01:00
+++ 1.7/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2006-01-27 07:34:14 +01:00
@@ -350,11 +350,14 @@
LocalDLList<Extent_info> list(c_extent_pool, alloc.m_free_extents[pos]);
list.first(ext);
while((pageBits= tsman.alloc_page_from_extent(&ext.p->m_key, bits)) < 0)
- if(!list.next(ext) || ++cnt < 10)
+ if(!list.next(ext) || ++cnt == 10)
break;
+ ndbout_c("cnt: %d", cnt);
if (cnt == 10 || ext.isNull())
goto alloc;
list.remove(ext);
+ alloc.m_curr_extent_info_ptr_i= ext.i;
+ ext.p->m_free_matrix_pos= RNIL;
}
else
{
@@ -390,18 +393,19 @@
LocalSLList<Extent_info, Extent_list_t>
list1(c_extent_pool, alloc.m_extent_list);
list1.add(ext);
- }
- 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);
+
+ 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);
#ifdef VM_TRACE
- ddassert(pageBits >= 0);
+ ddassert(pageBits >= 0);
#else
- if (unlikely(pageBits < 0))
- {
- return -AllocExtentReq::NoExtentAvailable;
- }
+ if (unlikely(pageBits < 0))
+ {
+ return -AllocExtentReq::NoExtentAvailable;
+ }
#endif
+ }
}
/**
--- 1.5/storage/ndb/src/kernel/blocks/pgman.cpp 2006-01-26 12:07:19 +01:00
+++ 1.6/storage/ndb/src/kernel/blocks/pgman.cpp 2006-01-27 07:34:14 +01:00
@@ -40,10 +40,11 @@
#define dbg(x)
#endif
+static bool g_dbg_lcp = false;
#if 1
#define DBG_LCP(x)
#else
-#define DBG_LCP(x) ndbout << x
+#define DBG_LCP(x) if(g_dbg_lcp) ndbout << x
#endif
Pgman::Pgman(const Configuration & conf) :
@@ -1156,15 +1157,25 @@
// start or re-start from beginning of current hash bucket
if (m_lcp_curr_bucket != ~(Uint32)0)
{
+ DBG_LCP(" PROCESS LCP m_lcp_curr_bucket"
+ << m_lcp_curr_bucket << endl);
+
Page_hashlist::Iterator iter;
pl_hash.next(m_lcp_curr_bucket, iter);
-
- while (iter.curr.i != RNIL && --max_count > 0)
+ Uint32 loop = 0;
+ while (iter.curr.i != RNIL &&
+ m_lcp_outstanding < max_count &&
+ (loop ++ < 32 || iter.bucket == m_lcp_curr_bucket))
{
Ptr<Page_entry>& ptr = iter.curr;
Uint16 state = ptr.p->m_state;
-
- DBG_LCP("PROCESS LCP: " << ptr);
+
+ DBG_LCP("LCP "
+ << " m_lcp_outstanding: " << m_lcp_outstanding
+ << " max_count: " << max_count
+ << " loop: " << loop
+ << " iter.curr.i: " << iter.curr.i
+ << " " << ptr);
if (ptr.p->m_last_lcp < m_last_lcp &&
(state & Page_entry::DIRTY))
@@ -1214,6 +1225,10 @@
ptr.p->m_last_lcp = m_last_lcp;
m_lcp_outstanding++;
}
+ else
+ {
+ DBG_LCP(" NOT DIRTY" << endl);
+ }
pl_hash.next(iter);
}
@@ -2235,6 +2250,36 @@
#else
ndbout << "Only in VM_TRACE builds" << endl;
#endif
+ }
+
+ if (signal->theData[0] == 11004)
+ {
+ ndbout << "Dump LCP bucket m_lcp_outstanding: %d", m_lcp_outstanding;
+ if (m_lcp_curr_bucket != ~(Uint32)0)
+ {
+ Page_hashlist::Iterator iter;
+ pl_hash.next(m_lcp_curr_bucket, iter);
+
+ ndbout_c(" %d", m_lcp_curr_bucket);
+
+ while (iter.curr.i != RNIL && iter.bucket == m_lcp_curr_bucket)
+ {
+ Ptr<Page_entry>& ptr = iter.curr;
+ ndbout << ptr << endl;
+ pl_hash.next(iter);
+ }
+
+ ndbout_c("-- done");
+ }
+ else
+ {
+ ndbout_c(" == ~0");
+ }
+ }
+
+ if (signal->theData[0] == 11005)
+ {
+ g_dbg_lcp = ~g_dbg_lcp;
}
}
--- 1.4/storage/ndb/src/kernel/blocks/tsman.cpp 2006-01-26 12:07:19 +01:00
+++ 1.5/storage/ndb/src/kernel/blocks/tsman.cpp 2006-01-27 07:34:14 +01:00
@@ -30,6 +30,7 @@
#include <signaldata/GetTabInfo.hpp>
#include <dbtup/Dbtup.hpp>
+#define JONAS 0
Tsman::Tsman(const Configuration & conf, class Pgman* pg, class Lgman* lg) :
SimulatedBlock(TSMAN, conf),
@@ -1725,8 +1726,9 @@
unsigned bit =
(header->get_free_bits(page_no_in_extent) & ((1 << (SZ - 1)) - 1));
header->update_free_bits(page_no_in_extent, bit);
- ndbout_c("toggle page: (%d, %d, %d) from %x to %x",
- key->m_page_no, extent, page_no_in_extent, old, bit);
+ if (JONAS)
+ ndbout_c("toggle page: (%d, %d, %d) from %x to %x",
+ key->m_page_no, extent, page_no_in_extent, old, bit);
return 0;
}
@@ -1842,8 +1844,9 @@
return;
found:
- ndbout_c("alloc page: (%d, %d, %d)",
- data_off + extent * size + page_no, per_page + extent, page_no);
+ if (JONAS)
+ ndbout_c("alloc page: (%d, %d, %d)",
+ data_off + extent * size + page_no, per_page + extent, page_no);
src_bits |= (1 << (SZ - 1)); // high unlogged, allocated bit
header->update_free_bits(page_no, src_bits);
rep->bits= src_bits & ((1 << (SZ - 1)) - 1);
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2077) | jonas | 27 Jan |