Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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.2391 06/05/09 21:08:12 tomas@stripped +3 -0
stilled more valgrind memleaks
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
1.21 06/05/09 21:08:01 tomas@stripped +28 -0
stilled more valgrind memleaks
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
1.56 06/05/09 21:08:01 tomas@stripped +47 -57
stilled more valgrind memleaks
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
1.131 06/05/09 21:08:01 tomas@stripped +13 -13
stilled more valgrind memleaks
# 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: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-new-ndb
--- 1.130/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2006-05-09 14:51:35 +02:00
+++ 1.131/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2006-05-09 21:08:01 +02:00
@@ -80,7 +80,7 @@
: NdbDictionary::Column(* this), m_attrId(-1), m_facade(this)
{
DBUG_ENTER("NdbColumnImpl::NdbColumnImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
init();
DBUG_VOID_RETURN;
}
@@ -89,7 +89,7 @@
: NdbDictionary::Column(* this), m_attrId(-1), m_facade(&f)
{
DBUG_ENTER("NdbColumnImpl::NdbColumnImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
init();
DBUG_VOID_RETURN;
}
@@ -98,7 +98,7 @@
NdbColumnImpl::operator=(const NdbColumnImpl& col)
{
DBUG_ENTER("NdbColumnImpl::operator=");
- DBUG_PRINT("info", ("this: %x &col: %x", this, &col));
+ DBUG_PRINT("info", ("this: %p &col: %p", this, &col));
m_attrId = col.m_attrId;
m_name = col.m_name;
m_type = col.m_type;
@@ -271,7 +271,7 @@
NdbColumnImpl::~NdbColumnImpl()
{
DBUG_ENTER("NdbColumnImpl::~NdbColumnImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
if (m_blobTable != NULL)
delete m_blobTable;
m_blobTable = NULL;
@@ -282,7 +282,7 @@
NdbColumnImpl::equal(const NdbColumnImpl& col) const
{
DBUG_ENTER("NdbColumnImpl::equal");
- DBUG_PRINT("info", ("this: %x &col: %x", this, &col));
+ DBUG_PRINT("info", ("this: %p &col: %p", this, &col));
if(strcmp(m_name.c_str(), col.m_name.c_str()) != 0){
DBUG_RETURN(false);
}
@@ -391,7 +391,7 @@
NdbDictObjectImpl(NdbDictionary::Object::UserTable), m_facade(this)
{
DBUG_ENTER("NdbTableImpl::NdbTableImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
init();
DBUG_VOID_RETURN;
}
@@ -401,7 +401,7 @@
NdbDictObjectImpl(NdbDictionary::Object::UserTable), m_facade(&f)
{
DBUG_ENTER("NdbTableImpl::NdbTableImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
init();
DBUG_VOID_RETURN;
}
@@ -409,7 +409,7 @@
NdbTableImpl::~NdbTableImpl()
{
DBUG_ENTER("NdbTableImpl::~NdbTableImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
if (m_index != 0) {
delete m_index;
m_index = 0;
@@ -659,7 +659,7 @@
NdbTableImpl::assign(const NdbTableImpl& org)
{
DBUG_ENTER("NdbColumnImpl::assign");
- DBUG_PRINT("info", ("this: %x &org: %x", this, &org));
+ DBUG_PRINT("info", ("this: %p &org: %p", this, &org));
/* m_changeMask intentionally not copied */
m_primaryTableId = org.m_primaryTableId;
m_internalName.assign(org.m_internalName);
@@ -1118,7 +1118,7 @@
NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined), m_facade(this)
{
DBUG_ENTER("NdbEventImpl::NdbEventImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
init();
DBUG_VOID_RETURN;
}
@@ -1128,7 +1128,7 @@
NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined), m_facade(&f)
{
DBUG_ENTER("NdbEventImpl::NdbEventImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
init();
DBUG_VOID_RETURN;
}
@@ -1147,7 +1147,7 @@
NdbEventImpl::~NdbEventImpl()
{
DBUG_ENTER("NdbEventImpl::~NdbEventImpl");
- DBUG_PRINT("info", ("this: %x", this));
+ DBUG_PRINT("info", ("this: %p", this));
for (unsigned i = 0; i < m_columns.size(); i++)
delete m_columns[i];
if (m_tableImpl)
@@ -1176,7 +1176,7 @@
NdbEventImpl::setTable(NdbTableImpl *tableImpl)
{
DBUG_ENTER("NdbEventImpl::setTable");
- DBUG_PRINT("info", ("this: %x tableImpl: %x", this, tableImpl));
+ DBUG_PRINT("info", ("this: %p tableImpl: %p", this, tableImpl));
DBUG_ASSERT(tableImpl->m_status != NdbDictionary::Object::Invalid);
if (!m_tableImpl)
m_tableImpl = new NdbTableImpl();
--- 1.55/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp 2006-05-09 14:51:35 +02:00
+++ 1.56/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp 2006-05-09 21:08:01 +02:00
@@ -70,21 +70,6 @@
*
*/
-//#define EVENT_DEBUG
-#ifdef EVENT_DEBUG
-#define DBUG_ENTER_EVENT(A) DBUG_ENTER(A)
-#define DBUG_RETURN_EVENT(A) DBUG_RETURN(A)
-#define DBUG_VOID_RETURN_EVENT DBUG_VOID_RETURN
-#define DBUG_PRINT_EVENT(A,B) DBUG_PRINT(A,B)
-#define DBUG_DUMP_EVENT(A,B,C) DBUG_DUMP(A,B,C)
-#else
-#define DBUG_ENTER_EVENT(A)
-#define DBUG_RETURN_EVENT(A) return(A)
-#define DBUG_VOID_RETURN_EVENT return
-#define DBUG_PRINT_EVENT(A,B)
-#define DBUG_DUMP_EVENT(A,B,C)
-#endif
-
// todo handle several ndb objects
// todo free allocated data when closing NdbEventBuffer
@@ -984,7 +969,15 @@
delete op->m_facade;
}
- for (unsigned j= 0; j < m_allocated_data.size(); j++)
+ unsigned j;
+ Uint32 sz= m_active_gci.size();
+ Gci_container* array = (Gci_container*)m_active_gci.getBase();
+ for(j = 0; j < sz; j++)
+ {
+ array[j].~Gci_container();
+ }
+
+ for (j= 0; j < m_allocated_data.size(); j++)
{
unsigned sz= m_allocated_data[j]->sz;
EventBufData *data= m_allocated_data[j]->data;
@@ -1487,6 +1480,7 @@
data.req_nodeid = (Uint8)node_id;
data.ndbd_nodeid = (Uint8)node_id;
data.logType = SubTableData::LOG;
+ data.gci = m_latestGCI + 1;
/**
* Insert this event for each operation
*/
@@ -1503,8 +1497,11 @@
void
NdbEventBuffer::completeClusterFailed()
{
- DBUG_ENTER("NdbEventBuffer::completeClusterFailed");
+ NdbEventOperation* op= m_ndb->getEventOperation(0);
+ if (op == 0)
+ return;
+ DBUG_ENTER("NdbEventBuffer::completeClusterFailed");
SubTableData data;
LinearSectionPtr ptr[3];
bzero(&data, sizeof(data));
@@ -1513,15 +1510,27 @@
data.tableId = ~0;
data.operation = NdbDictionary::Event::_TE_CLUSTER_FAILURE;
data.logType = SubTableData::LOG;
-
+ data.gci = m_latestGCI + 1;
+
+ /**
+ * Insert this event for each operation
+ */
+ do
+ {
+ NdbEventOperationImpl* impl= &op->m_impl;
+ data.senderData = impl->m_oid;
+ insertDataL(impl, &data, ptr);
+ } while((op = m_ndb->getEventOperation(op)));
+
/**
* Find min not completed GCI
*/
+ Uint32 i;
Uint32 sz= m_active_gci.size();
Uint64 gci= ~0;
Gci_container* bucket = 0;
Gci_container* array = (Gci_container*)m_active_gci.getBase();
- for(Uint32 i = 0; i<sz; i++)
+ for(i = 0; i < sz; i++)
{
if(array[i].m_gcp_complete_rep_count && array[i].m_gci < gci)
{
@@ -1530,57 +1539,28 @@
}
}
- if(bucket == 0)
- {
- /**
- * Did not find any not completed GCI's
- * lets fake one...
- */
- gci = m_latestGCI + 1;
- bucket = array + ( gci & ACTIVE_GCI_MASK );
- bucket->m_gcp_complete_rep_count = 1;
- }
-
- const Uint32 cnt= bucket->m_gcp_complete_rep_count = 1;
-
/**
- * Release all GCI's
+ * Release all GCI's with m_gci > gci
*/
- for(Uint32 i = 0; i<sz; i++)
+ for(i = 0; i < sz; i++)
{
Gci_container* tmp = array + i;
- if(!tmp->m_data.is_empty())
+ if (tmp->m_gci > gci)
{
- free_list(tmp->m_data);
-#if 0
- m_free_data_count++;
- EventBufData* loop= tmp->m_head;
- while(loop != tmp->m_tail)
+ if(!tmp->m_data.is_empty())
{
- m_free_data_count++;
- loop = loop->m_next;
+ free_list(tmp->m_data);
}
-#endif
+ tmp->~Gci_container();
+ bzero(tmp, sizeof(Gci_container));
}
- bzero(tmp, sizeof(Gci_container));
}
+ assert(bucket != 0 && data.gci == gci);
+ const Uint32 cnt= bucket->m_gcp_complete_rep_count = 1;
bucket->m_gci = gci;
bucket->m_gcp_complete_rep_count = cnt;
- data.gci = gci;
-
- /**
- * Insert this event for each operation
- */
- NdbEventOperation* op= 0;
- while((op = m_ndb->getEventOperation(op)))
- {
- NdbEventOperationImpl* impl= &op->m_impl;
- data.senderData = impl->m_oid;
- insertDataL(impl, &data, ptr);
- }
-
/**
* And finally complete this GCI
*/
@@ -2273,8 +2253,12 @@
if (m_gci_op_alloc != 0) {
Uint32 bytes = m_gci_op_alloc * sizeof(Gci_op);
memcpy(m_gci_op_list, old_list, bytes);
+ DBUG_PRINT_EVENT("info", ("this: %p delete m_gci_op_list: %p",
+ this, old_list));
delete [] old_list;
}
+ DBUG_PRINT_EVENT("info", ("this: %p new m_gci_op_list: %p",
+ this, m_gci_op_list));
m_gci_op_alloc = n;
}
assert(m_gci_op_count < m_gci_op_alloc);
@@ -2286,6 +2270,9 @@
void
EventBufData_list::move_gci_ops(EventBufData_list *list, Uint64 gci)
{
+ DBUG_ENTER_EVENT("EventBufData_list::move_gci_ops");
+ DBUG_PRINT_EVENT("info", ("this: %p list: %p gci: %llu",
+ this, list, gci));
assert(!m_is_not_multi_list);
if (!list->m_is_not_multi_list)
{
@@ -2301,6 +2288,8 @@
}
{
Gci_ops *new_gci_ops = new Gci_ops;
+ DBUG_PRINT_EVENT("info", ("this: %p m_gci_op_list: %p",
+ new_gci_ops, list->m_gci_op_list));
if (m_gci_ops_list_tail)
m_gci_ops_list_tail->m_next = new_gci_ops;
else
@@ -2319,6 +2308,7 @@
list->m_gci_op_list = 0;
list->m_gci_ops_list_tail = 0;
list->m_gci_op_alloc = 0;
+ DBUG_VOID_RETURN_EVENT;
}
NdbEventOperation*
--- 1.20/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp 2006-04-21 06:40:43 +02:00
+++ 1.21/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp 2006-05-09 21:08:01 +02:00
@@ -25,6 +25,20 @@
#include <UtilBuffer.hpp>
#define NDB_EVENT_OP_MAGIC_NUMBER 0xA9F301B4
+//#define EVENT_DEBUG
+#ifdef EVENT_DEBUG
+#define DBUG_ENTER_EVENT(A) DBUG_ENTER(A)
+#define DBUG_RETURN_EVENT(A) DBUG_RETURN(A)
+#define DBUG_VOID_RETURN_EVENT DBUG_VOID_RETURN
+#define DBUG_PRINT_EVENT(A,B) DBUG_PRINT(A,B)
+#define DBUG_DUMP_EVENT(A,B,C) DBUG_DUMP(A,B,C)
+#else
+#define DBUG_ENTER_EVENT(A)
+#define DBUG_RETURN_EVENT(A) return(A)
+#define DBUG_VOID_RETURN_EVENT return
+#define DBUG_PRINT_EVENT(A,B)
+#define DBUG_DUMP_EVENT(A,B,C)
+#endif
class NdbEventOperationImpl;
@@ -149,19 +163,29 @@
m_gci_ops_list_tail(0),
m_gci_op_alloc(0)
{
+ DBUG_ENTER_EVENT("EventBufData_list::EventBufData_list");
+ DBUG_PRINT_EVENT("info", ("this: %p", this));
+ DBUG_VOID_RETURN_EVENT;
}
inline
EventBufData_list::~EventBufData_list()
{
+ DBUG_ENTER_EVENT("EventBufData_list::~EventBufData_list");
+ DBUG_PRINT_EVENT("info", ("this: %p m_is_not_multi_list: %u",
+ this, m_is_not_multi_list));
if (m_is_not_multi_list)
+ {
+ DBUG_PRINT_EVENT("info", ("delete m_gci_op_list: %p", m_gci_op_list));
delete [] m_gci_op_list;
+ }
else
{
Gci_ops *op = first_gci_ops();
while (op)
op = next_gci_ops();
}
+ DBUG_VOID_RETURN_EVENT;
}
inline
@@ -223,7 +247,11 @@
Gci_ops *first = m_gci_ops_list;
m_gci_ops_list = first->m_next;
if (first->m_gci_op_list)
+ {
+ DBUG_PRINT_EVENT("info", ("this: %p delete m_gci_op_list: %p",
+ this, first->m_gci_op_list));
delete [] first->m_gci_op_list;
+ }
delete first;
if (m_gci_ops_list == 0)
m_gci_ops_list_tail = 0;
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2391) | tomas | 9 May |