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.2100 06/02/15 13:20:15 jonas@stripped +8 -0
ndb dd -
Fix bug in tsman undo
storage/ndb/src/kernel/vm/pc.hpp
1.12 06/02/15 13:20:12 jonas@stripped +0 -16
Move Ptr to Pool.hpp
storage/ndb/src/kernel/vm/Pool.hpp
1.2 06/02/15 13:20:12 jonas@stripped +96 -3
Update Pool.hpp
storage/ndb/src/kernel/vm/Makefile.am
1.14 06/02/15 13:20:12 jonas@stripped +1 -3
Remove SuperPool & NdbdSuperPool for now
storage/ndb/src/kernel/blocks/tsman.hpp
1.5 06/02/15 13:20:12 jonas@stripped +7 -4
Add page_lsn to undo handling
storage/ndb/src/kernel/blocks/tsman.cpp
1.9 06/02/15 13:20:12 jonas@stripped +19 -8
Add page_lsn to undo handling
storage/ndb/src/kernel/blocks/record_types.hpp
1.2 06/02/15 13:20:12 jonas@stripped +22 -0
Start filling up record_types.hpp
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
1.12 06/02/15 13:20:12 jonas@stripped +5 -1
Add page lsn to undo handling in tsman
BitKeeper/deleted/.del-RecordPool.hpp~b2360628ee40b04e
1.2 06/02/14 16:14:24 jonas@stripped +0 -0
Delete: storage/ndb/src/kernel/vm/RecordPool.hpp
# 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-ndb
--- 1.11/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2006-02-14 07:57:37 +01:00
+++ 1.12/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2006-02-15 13:20:12 +01:00
@@ -1478,13 +1478,17 @@
Uint32 free = pageP->free_space;
Uint32 new_bits = alloc.calc_page_free_bits(free);
pageP->list_index = 0x8000 | new_bits;
+
+ Uint64 lsn = 0;
+ lsn += pageP->m_page_header.m_page_lsn_hi; lsn <<= 32;
+ lsn += pageP->m_page_header.m_page_lsn_lo;
Tablespace_client tsman(signal, c_tsman,
fragPtrP->fragTableId,
fragPtrP->fragmentId,
fragPtrP->m_tablespace_id);
- tsman.restart_undo_page_free_bits(&undo->m_key, new_bits, undo->m_lsn);
+ tsman.restart_undo_page_free_bits(&undo->m_key, new_bits, undo->m_lsn, lsn);
}
int
--- 1.1/storage/ndb/src/kernel/blocks/record_types.hpp 2006-02-13 13:12:43 +01:00
+++ 1.2/storage/ndb/src/kernel/blocks/record_types.hpp 2006-02-15 13:20:12 +01:00
@@ -20,9 +20,31 @@
/**
* Record types
*/
+#define PGMAN_PAGE_REQUEST 1
+
+#define LGMAN_LOG_BUFFER_WAITER 2
+#define LGMAN_LOG_SYNC_WAITER 3
+
+#define DBTUP_PAGE_REQUEST 4
+#define DBTUP_EXTENT_INFO 5
/**
* Resource groups
*/
+
+/**
+ * Operations for dd
+ * PGMAN_PAGE_REQUEST
+ * LGMAN_LOG_BUFFER_WAITER
+ * LGMAN_LOG_SYNC_WAITER
+ * DBTUP_PAGE_REQUEST
+ */
+#define RG_DISK_OPERATIONS 1
+
+/**
+ * Records for dd
+ * DBTUP_EXTENT_INFO
+ */
+#define RG_DISK_RECORDS 2
#endif
--- 1.8/storage/ndb/src/kernel/blocks/tsman.cpp 2006-02-14 08:08:30 +01:00
+++ 1.9/storage/ndb/src/kernel/blocks/tsman.cpp 2006-02-15 13:20:12 +01:00
@@ -1747,7 +1747,8 @@
Uint32 fragId,
Local_key *key,
unsigned bits,
- Uint64 undo_lsn)
+ Uint64 undo_lsn,
+ Uint64 page_lsn)
{
jamEntry();
@@ -1790,6 +1791,20 @@
File_formats::Datafile::Extent_header* header =
page->get_header(extent_no, size);
+ Uint64 lsn = 0;
+ lsn += page->m_page_header.m_page_lsn_hi; lsn <<= 32;
+ lsn += page->m_page_header.m_page_lsn_lo;
+
+ if (undo_lsn > lsn && undo_lsn > page_lsn)
+ {
+ if (DBG_UNDO)
+ ndbout << "tsman: ignore " << undo_lsn << "(" << lsn << ", "
+ << page_lsn << ") "
+ << *key << " "
+ << " -> " << bits << endl;
+ return 0;
+ }
+
if (header->m_table == RNIL)
{
if (DBG_UNDO)
@@ -1797,15 +1812,11 @@
return 0;
}
- ndbrequire(header->m_table == tableId);
- ndbrequire(header->m_fragment_id == fragId);
-
Uint32 page_no_in_extent = (key->m_page_no - data_off) % size;
Uint32 src = header->get_free_bits(page_no_in_extent);
-
- Uint64 lsn = 0;
- lsn += page->m_page_header.m_page_lsn_hi; lsn <<= 32;
- lsn += page->m_page_header.m_page_lsn_lo;
+
+ ndbrequire(header->m_table == tableId);
+ ndbrequire(header->m_fragment_id == fragId);
/**
* Toggle word
--- 1.4/storage/ndb/src/kernel/blocks/tsman.hpp 2006-02-13 13:12:43 +01:00
+++ 1.5/storage/ndb/src/kernel/blocks/tsman.hpp 2006-02-15 13:20:12 +01:00
@@ -200,7 +200,7 @@
int get_page_free_bits(Signal*, Local_key*, unsigned*, unsigned*);
int unmap_page(Signal*, Local_key*, unsigned uncommitted_bits);
int restart_undo_page_free_bits(Signal*, Uint32, Uint32, Local_key*,
- unsigned committed_bits, Uint64 lsn);
+ unsigned committed_bits, Uint64, Uint64);
int alloc_extent(Signal* signal, Uint32 tablespace, Local_key* key);
int alloc_page_from_extent(Signal*, Uint32, Local_key*, Uint32 bits);
@@ -283,7 +283,8 @@
/**
* Undo handling of page bits
*/
- int restart_undo_page_free_bits(Local_key*, unsigned bits, Uint64 lsn);
+ int restart_undo_page_free_bits(Local_key*, unsigned bits,
+ Uint64 lsn, Uint64 page_lsn);
/**
* Get tablespace info
@@ -382,14 +383,16 @@
int
Tablespace_client::restart_undo_page_free_bits(Local_key* key,
unsigned committed_bits,
- Uint64 lsn)
+ Uint64 lsn,
+ Uint64 page_lsn)
{
return m_tsman->restart_undo_page_free_bits(m_signal,
m_table_id,
m_fragment_id,
key,
committed_bits,
- lsn);
+ lsn,
+ page_lsn);
}
--- 1.1/storage/ndb/src/kernel/vm/Pool.hpp 2006-02-13 13:12:43 +01:00
+++ 1.2/storage/ndb/src/kernel/vm/Pool.hpp 2006-02-15 13:20:12 +01:00
@@ -21,9 +21,10 @@
struct Record_info
{
- Uint32 m_size;
- Uint32 m_offset_next_pool;
- Uint32 m_type_id;
+ Uint16 m_size;
+ Uint16 m_type_id;
+ Uint16 m_offset_next_pool;
+ Uint16 m_offset_magic;
};
struct Resource_limit
@@ -38,6 +39,98 @@
{
class SimulatedBlock* m_block;
struct Resource_limit* m_resource_limit;
+
+ /**
+ * Alloc consekutive pages
+ *
+ * @param i : out : i value of first page
+ * @return : pointer to first page (NULL if failed)
+ *
+ * Will handle resource limit
+ */
+ void* alloc_page(Uint32 *i);
+
+ /**
+ * Release pages
+ *
+ * @param i : in : i value of first page
+ * @param p : in : pointer to first page
+ */
+ void release_page(Uint32 i, void* p);
+
+ /**
+ * Alloc consekutive pages
+ *
+ * @param cnt : in/out : no of requested pages,
+ * return no of allocated (undefined return NULL)
+ * out will never be > in
+ * @param i : out : i value of first page
+ * @param min : in : will never allocate less than min
+ * @return : pointer to first page (NULL if failed)
+ *
+ * Will handle resource limit
+ */
+ void* alloc_pages(Uint32 *i, Uint32 *cnt, Uint32 min = 1);
+
+ /**
+ * Release pages
+ *
+ * @param i : in : i value of first page
+ * @param p : in : pointer to first page
+ * @param cnt : in : no of pages to release
+ */
+ void release_pages(Uint32 i, void* p, Uint32 cnt);
+
+ /**
+ * Pool abort
+ * Only know issue is getPtr with invalid i-value.
+ * If other emerges, we will add argument to this method
+ */
+ struct AbortArg
+ {
+ Uint32 m_expected_magic;
+ Uint32 m_found_magic;
+ Uint32 i;
+ void * p;
+ };
+ void handle_abort(const AbortArg &);
+};
+
+template <typename T>
+struct Ptr
+{
+ T * p;
+ Uint32 i;
+ inline bool isNull() const { return i == RNIL; }
+ inline void setNull() { i = RNIL; }
+};
+
+template <typename T>
+struct ConstPtr
+{
+ const T * p;
+ Uint32 i;
+ inline bool isNull() const { return i == RNIL; }
+ inline void setNull() { i = RNIL; }
+};
+
+#ifdef XX_DOCUMENTATION_XX
+/**
+ * Any pool should implement the following
+ */
+struct Pool
+{
+public:
+ Pool();
+
+ void init(const Record_info& ri, const Pool_context& pc);
+
+ bool seize(Uint32*, void**);
+ void* seize(Uint32*);
+
+ void release(Uint32 i, void* p);
+ void * getPtr(Uint32 i);
};
+#endif
#endif
--- 1.11/storage/ndb/src/kernel/vm/pc.hpp 2005-11-07 12:19:08 +01:00
+++ 1.12/storage/ndb/src/kernel/vm/pc.hpp 2006-02-15 13:20:12 +01:00
@@ -239,20 +239,4 @@
#define MEMCOPY_NO_WORDS(to, from, no_of_words) \
memcpy((to), (void*)(from), (size_t)(no_of_words << 2));
-template <class T>
-struct Ptr {
- T * p;
- Uint32 i;
- inline bool isNull() const { return i == RNIL; }
- inline void setNull() { i = RNIL; }
-};
-
-template <class T>
-struct ConstPtr {
- const T * p;
- Uint32 i;
- inline bool isNull() const { return i == RNIL; }
- inline void setNull() { i = RNIL; }
-};
-
#endif
--- 1.13/storage/ndb/src/kernel/vm/Makefile.am 2006-01-22 18:23:43 +01:00
+++ 1.14/storage/ndb/src/kernel/vm/Makefile.am 2006-02-15 13:20:12 +01:00
@@ -19,9 +19,7 @@
SectionReader.cpp \
Mutex.cpp SafeCounter.cpp \
Rope.cpp \
- SuperPool.cpp \
- ndbd_malloc.cpp ndbd_malloc_impl.cpp \
- NdbdSuperPool.cpp
+ ndbd_malloc.cpp ndbd_malloc_impl.cpp
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/mgmapi
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2100) | jonas | 15 Feb |