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@stripped, 2007-03-07 17:50:24+01:00, jonas@stripped +6 -0
Merge perch.ndb.mysql.com:/home/jonas/src/51-work
into perch.ndb.mysql.com:/home/jonas/src/51-telco
MERGE: 1.2403.16.13
storage/ndb/include/mgmapi/mgmapi_config_parameters.h@stripped, 2007-03-07 17:50:22+01:00, jonas@stripped +1 -1
merge
MERGE: 1.31.1.1
storage/ndb/src/common/mgmcommon/IPCConfig.cpp@stripped, 2007-03-07 17:48:52+01:00, jonas@stripped +0 -0
Auto merged
MERGE: 1.28.1.1
storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-03-07 17:50:22+01:00, jonas@stripped +12 -12
merge
MERGE: 1.94.3.1
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp@stripped, 2007-03-07 17:48:52+01:00, jonas@stripped +0 -0
Auto merged
MERGE: 1.47.1.1
storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp@stripped, 2007-03-07 17:48:52+01:00, jonas@stripped +0 -0
Auto merged
MERGE: 1.9.1.1
storage/ndb/test/ndbapi/testNdbApi.cpp@stripped, 2007-03-07 17:50:22+01:00, jonas@stripped +59 -59
merge
MERGE: 1.24.1.1
# 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-telco/RESYNC
--- 1.32/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-03-07 17:50:29 +01:00
+++ 1.33/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2007-03-07 17:50:29 +01:00
@@ -155,6 +155,7 @@
#define CFG_TCP_RCV_BUF_SIZE 457
#define CFG_TCP_SND_BUF_SIZE 458
#define CFG_TCP_MAXSEG_SIZE 459
+#define CFG_TCP_BIND_INADDR_ANY 460
#define CFG_SHM_SEND_SIGNAL_ID 500
#define CFG_SHM_CHECKSUM 501
--- 1.99/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-03-07 17:50:29 +01:00
+++ 1.100/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2007-03-07 17:50:29 +01:00
@@ -343,6 +343,18 @@
"0",
STR_VALUE(MAX_INT_RNIL) },
+ {
+ KEY_INTERNAL,
+ "TcpBind_INADDR_ANY",
+ DB_TOKEN,
+ "Bind IP_ADDR_ANY so that connections can be made from anywhere (for autogenerated connections)",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_BOOL,
+ "false",
+ "false",
+ "true"},
+
/***************************************************************************
* DB
***************************************************************************/
@@ -1841,7 +1853,18 @@
"0",
"2G"
},
-
+
+ {
+ CFG_TCP_BIND_INADDR_ANY,
+ "TcpBind_INADDR_ANY",
+ "TCP",
+ "Bind InAddrAny instead of hostname for server part of connection",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_BOOL,
+ "false",
+ "false", "true" },
+
/****************************************************************************
* SHM
***************************************************************************/
@@ -3094,6 +3117,13 @@
DBUG_RETURN(false);
}
+ Uint32 bindAnyAddr = 0;
+ node1->get("TcpBind_INADDR_ANY", &bindAnyAddr);
+ if (bindAnyAddr)
+ {
+ ctx.m_currentSection->put("TcpBind_INADDR_ANY", 1, true);
+ }
+
Uint32 port= 0;
if(strcmp(type1, MGM_TOKEN)==0)
node1->get("PortNumber",&port);
--- 1.29/storage/ndb/src/common/mgmcommon/IPCConfig.cpp 2007-03-07 17:50:29 +01:00
+++ 1.30/storage/ndb/src/common/mgmcommon/IPCConfig.cpp 2007-03-07 17:50:29 +01:00
@@ -250,10 +250,15 @@
else
conf.isMgmConnection= false;
+ Uint32 bindInAddrAny = 0;
+ iter.get(CFG_TCP_BIND_INADDR_ANY, &bindInAddrAny);
+
if (nodeId == nodeIdServer && !conf.isMgmConnection) {
- tr.add_transporter_interface(remoteNodeId, localHostName, server_port);
+ tr.add_transporter_interface(remoteNodeId,
+ !bindInAddrAny ? localHostName : "",
+ server_port);
}
-
+
DBUG_PRINT("info", ("Transporter between this node %d and node %d using port %d, signalId %d, checksum %d",
nodeId, remoteNodeId, server_port, sendSignalId, checksum));
/*
--- 1.25/storage/ndb/test/ndbapi/testNdbApi.cpp 2007-03-07 17:50:29 +01:00
+++ 1.26/storage/ndb/test/ndbapi/testNdbApi.cpp 2007-03-07 17:50:29 +01:00
@@ -1517,6 +1517,61 @@
return NDBT_OK;
}
+static
+Uint32
+do_cnt(Ndb_cluster_connection* con)
+{
+ Uint32 cnt = 0;
+ const Ndb* p = 0;
+ con->lock_ndb_objects();
+ while ((p = con->get_next_ndb_object(p)) != 0) cnt++;
+ con->unlock_ndb_objects();
+ return cnt;
+}
+
+int runCheckNdbObjectList(NDBT_Context* ctx, NDBT_Step* step)
+{
+ const NdbDictionary::Table* pTab = ctx->getTab();
+
+ Ndb_cluster_connection* con = &ctx->m_cluster_connection;
+
+ Uint32 cnt1 = do_cnt(con);
+ Vector<Ndb*> objs;
+ for (Uint32 i = 0; i<100; i++)
+ {
+ Uint32 add = 1 + (rand() % 5);
+ for (Uint32 j = 0; j<add; j++)
+ {
+ Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB");
+ if (pNdb == NULL){
+ ndbout << "pNdb == NULL" << endl;
+ return NDBT_FAILED;
+ }
+ objs.push_back(pNdb);
+ }
+ if (do_cnt(con) != (cnt1 + objs.size()))
+ return NDBT_FAILED;
+ }
+
+ for (Uint32 i = 0; i<100 && objs.size(); i++)
+ {
+ Uint32 sub = 1 + rand() % objs.size();
+ for (Uint32 j = 0; j<sub && objs.size(); j++)
+ {
+ Uint32 idx = rand() % objs.size();
+ delete objs[idx];
+ objs.erase(idx);
+ }
+ if (do_cnt(con) != (cnt1 + objs.size()))
+ return NDBT_FAILED;
+ }
+
+ for (Uint32 i = 0; i<objs.size(); i++)
+ delete objs[i];
+
+ return (cnt1 == do_cnt(con)) ? NDBT_OK : NDBT_FAILED;
+}
+
template class Vector<NdbScanOperation*>;
@@ -1615,6 +1670,10 @@
STEP(runTestIgnoreError);
FINALIZER(runClearTable);
FINALIZER(createPkIndex_Drop);
+}
+TESTCASE("CheckNdbObjectList",
+ ""){
+ INITIALIZER(runCheckNdbObjectList);
}
NDBT_TESTSUITE_END(testNdbApi);
--- 1.49/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2007-03-07 17:50:29 +01:00
+++ 1.50/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2007-03-07 17:50:29 +01:00
@@ -269,14 +269,16 @@
m_name(0),
m_run_connect_thread(0),
m_event_add_drop_mutex(0),
- m_latest_trans_gci(0)
+ m_latest_trans_gci(0),
+ m_first_ndb_object(0)
{
DBUG_ENTER("Ndb_cluster_connection");
DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%lx", (long) this));
if (!m_event_add_drop_mutex)
m_event_add_drop_mutex= NdbMutex_Create();
-
+ m_new_delete_ndb_mutex = NdbMutex_Create();
+
g_eventLogger.createConsoleHandler();
g_eventLogger.setCategory("NdbApi");
g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
@@ -399,7 +401,74 @@
if (m_event_add_drop_mutex)
NdbMutex_Destroy(m_event_add_drop_mutex);
+ NdbMutex_Destroy(m_new_delete_ndb_mutex);
+ m_new_delete_ndb_mutex = 0;
+
DBUG_VOID_RETURN;
+}
+
+void
+Ndb_cluster_connection::lock_ndb_objects()
+{
+ NdbMutex_Lock(m_impl.m_new_delete_ndb_mutex);
+}
+
+void
+Ndb_cluster_connection::unlock_ndb_objects()
+{
+ NdbMutex_Unlock(m_impl.m_new_delete_ndb_mutex);
+}
+
+const Ndb*
+Ndb_cluster_connection::get_next_ndb_object(const Ndb* p)
+{
+ if (p == 0)
+ return m_impl.m_first_ndb_object;
+
+ return p->theImpl->m_next_ndb_object;
+}
+
+void
+Ndb_cluster_connection_impl::link_ndb_object(Ndb* p)
+{
+ lock_ndb_objects();
+ if (m_first_ndb_object != 0)
+ {
+ m_first_ndb_object->theImpl->m_prev_ndb_object = p;
+ }
+
+ p->theImpl->m_next_ndb_object = m_first_ndb_object;
+ m_first_ndb_object = p;
+
+ unlock_ndb_objects();
+}
+
+void
+Ndb_cluster_connection_impl::unlink_ndb_object(Ndb* p)
+{
+ lock_ndb_objects();
+ Ndb* prev = p->theImpl->m_prev_ndb_object;
+ Ndb* next = p->theImpl->m_next_ndb_object;
+
+ if (prev == 0)
+ {
+ assert(m_first_ndb_object == p);
+ m_first_ndb_object = next;
+ }
+ else
+ {
+ prev->theImpl->m_next_ndb_object = next;
+ }
+
+ if (next)
+ {
+ next->theImpl->m_prev_ndb_object = prev;
+ }
+
+ p->theImpl->m_prev_ndb_object = 0;
+ p->theImpl->m_next_ndb_object = 0;
+
+ unlock_ndb_objects();
}
void
--- 1.10/storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp 2007-03-07 17:50:29 +01:00
+++ 1.11/storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp 2007-03-07 17:50:29 +01:00
@@ -27,6 +27,7 @@
class ConfigRetriever;
class NdbThread;
class ndb_mgm_configuration;
+class Ndb;
extern "C" {
void* run_ndb_cluster_connection_connect_thread(void*);
@@ -80,6 +81,11 @@
int m_run_connect_thread;
NdbMutex *m_event_add_drop_mutex;
Uint64 m_latest_trans_gci;
+
+ NdbMutex* m_new_delete_ndb_mutex;
+ Ndb* m_first_ndb_object;
+ void link_ndb_object(Ndb*);
+ void unlink_ndb_object(Ndb*);
};
#endif
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2455) | jonas | 7 Mar |