#At file:///home/jonas/src/telco-7.1/ based on revid:magnus.blaudd@stripped
2930 Jonas Oreland 2009-07-03 [merge]
merge 70 to 71
modified:
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
storage/ndb/include/ndbapi/ndb_cluster_connection.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/mgmsrv/ConfigInfo.cpp
storage/ndb/src/ndbapi/ClusterMgr.cpp
storage/ndb/src/ndbapi/ClusterMgr.hpp
storage/ndb/src/ndbapi/TransporterFacade.cpp
storage/ndb/src/ndbapi/TransporterFacade.hpp
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp
=== modified file 'storage/ndb/include/mgmapi/mgmapi_config_parameters.h'
--- a/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2009-06-01 15:58:26 +0000
+++ b/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2009-07-03 06:34:01 +0000
@@ -233,6 +233,7 @@
#define CFG_MAX_SCAN_BATCH_SIZE 800
#define CFG_BATCH_BYTE_SIZE 801
#define CFG_BATCH_SIZE 802
+#define CFG_AUTO_RECONNECT 803
/**
* Internal
=== modified file 'storage/ndb/include/ndbapi/ndb_cluster_connection.hpp'
--- a/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp 2009-06-13 19:09:35 +0000
+++ b/storage/ndb/include/ndbapi/ndb_cluster_connection.hpp 2009-07-03 06:34:01 +0000
@@ -149,6 +149,13 @@ public:
int get_latest_error() const;
const char *get_latest_error_msg() const;
+ /**
+ * Enable/disable auto-reconnect
+ * @param value 0 = false, 1 = true
+ */
+ void set_auto_reconnect(int value);
+ int get_auto_reconnect() const;
+
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
int get_no_ready();
const char *get_connectstring(char *buf, int buf_sz) const;
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2009-06-01 14:57:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2009-07-03 21:11:59 +0000
@@ -3719,7 +3719,8 @@ int Dblqh::saveAttrInfoInSection(const U
return ZGET_ATTRINBUF_ERROR;
}//if
- regTcPtr->currTupAiLen+= len;
+ if (regTcPtr->m_flags & TcConnectionrec::OP_SAVEATTRINFO)
+ regTcPtr->currTupAiLen += len;
return ZOK;
} // saveAttrInfoInSection
@@ -4347,7 +4348,6 @@ void Dblqh::execLQHKEYREQ(Signal* signal
if (saveAttrInfo)
regTcPtr->m_flags|= TcConnectionrec::OP_SAVEATTRINFO;
-
/* Handle any AttrInfo we received with the LQHKEYREQ */
if (regTcPtr->currReclenAi != 0)
{
@@ -4378,7 +4378,8 @@ void Dblqh::execLQHKEYREQ(Signal* signal
return;
}
- regTcPtr->currTupAiLen= TreclenAiLqhkey;
+ if (saveAttrInfo)
+ regTcPtr->currTupAiLen= TreclenAiLqhkey;
}
}//if
@@ -10580,7 +10581,10 @@ void Dblqh::initScanTc(const ScanFragReq
tcConnectptr.p->m_scan_curr_range_no = 0;
tcConnectptr.p->m_dealloc = 0;
tcConnectptr.p->activeCreat = Fragrecord::AC_NORMAL;
- tcConnectptr.p->m_flags = 0;
+ // set TcConnectionrec::OP_SAVEATTRINFO so that a
+ // "old" scan (short signals) update currTupAiLen which is checked
+ // in scanAttrinfoLab
+ tcConnectptr.p->m_flags = TcConnectionrec::OP_SAVEATTRINFO;
TablerecPtr tTablePtr;
tTablePtr.i = tabptr.p->primaryTableId;
ptrCheckGuard(tTablePtr, ctabrecFileSize, tablerec);
=== modified file 'storage/ndb/src/mgmsrv/ConfigInfo.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2009-06-26 13:33:01 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp 2009-07-03 06:34:01 +0000
@@ -1927,6 +1927,20 @@ const ConfigInfo::ParamInfo ConfigInfo::
STR_VALUE(MAX_INT_RNIL)
},
+ {
+ CFG_AUTO_RECONNECT,
+ "AutoReconnect",
+ "API",
+ "Specifies if an api node should reconnect when fully disconnected from cluster",
+ ConfigInfo::CI_USED,
+ false,
+ ConfigInfo::CI_BOOL,
+ "true",
+ "false",
+ "true"
+ },
+
+
/****************************************************************************
* MGM
***************************************************************************/
=== modified file 'storage/ndb/src/ndbapi/ClusterMgr.cpp'
--- a/storage/ndb/src/ndbapi/ClusterMgr.cpp 2009-06-29 20:56:37 +0000
+++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp 2009-07-03 21:11:59 +0000
@@ -75,6 +75,7 @@ ClusterMgr::ClusterMgr(TransporterFacade
ndbSetOwnVersion();
clusterMgrThreadMutex = NdbMutex_Create();
waitForHBCond= NdbCondition_Create();
+ m_auto_reconnect = -1;
int ret = open(&theFacade, API_CLUSTERMGR);
assert(ret >= 0);
@@ -172,6 +173,17 @@ ClusterMgr::configure(Uint32 nodeId,
delete theArbitMgr;
theArbitMgr= NULL;
}
+
+ Uint32 auto_reconnect=1;
+ iter.get(CFG_AUTO_RECONNECT, &auto_reconnect);
+
+ /**
+ * Keep value it set before connect (overriding config)
+ */
+ if (m_auto_reconnect == -1)
+ {
+ m_auto_reconnect = auto_reconnect;
+ }
}
void
@@ -190,8 +202,9 @@ void
ClusterMgr::doStop( ){
DBUG_ENTER("ClusterMgr::doStop");
Guard g(clusterMgrThreadMutex);
- if(theStop)
+ if(theStop == 1){
DBUG_VOID_RETURN;
+ }
void *status;
theStop = 1;
@@ -732,6 +745,11 @@ ClusterMgr::reportNodeFailed(NodeId node
m_connect_count ++;
m_cluster_state = CS_waiting_for_clean_cache;
}
+
+ if (m_auto_reconnect == 0)
+ {
+ theStop = 2;
+ }
}
theNode.nfCompleteRep = false;
if(noOfAliveNodes == 0)
=== modified file 'storage/ndb/src/ndbapi/ClusterMgr.hpp'
--- a/storage/ndb/src/ndbapi/ClusterMgr.hpp 2009-06-29 20:56:37 +0000
+++ b/storage/ndb/src/ndbapi/ClusterMgr.hpp 2009-07-03 21:11:59 +0000
@@ -83,6 +83,7 @@ public:
Uint32 getNoOfConnectedNodes() const;
void hb_received(NodeId);
+ int m_auto_reconnect;
Uint32 m_connect_count;
private:
Uint32 m_max_api_reg_req_interval;
=== modified file 'storage/ndb/src/ndbapi/TransporterFacade.cpp'
--- a/storage/ndb/src/ndbapi/TransporterFacade.cpp 2009-06-29 20:56:37 +0000
+++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp 2009-07-03 21:11:59 +0000
@@ -1674,7 +1674,6 @@ SignalSender::sendSignal(Uint16 nodeId,
return ss;
}
-
Uint32*
SignalSectionIterator::getNextWords(Uint32& sz)
{
@@ -1942,3 +1941,15 @@ int main(int arg, char** argv)
return 0;
}
#endif
+
+void
+TransporterFacade::set_auto_reconnect(int val)
+{
+ theClusterMgr->m_auto_reconnect = val;
+}
+
+int
+TransporterFacade::get_auto_reconnect() const
+{
+ return theClusterMgr->m_auto_reconnect;
+}
=== modified file 'storage/ndb/src/ndbapi/TransporterFacade.hpp'
--- a/storage/ndb/src/ndbapi/TransporterFacade.hpp 2009-06-29 20:56:37 +0000
+++ b/storage/ndb/src/ndbapi/TransporterFacade.hpp 2009-07-03 21:11:59 +0000
@@ -135,6 +135,8 @@ public:
// heart beat received from a node (e.g. a signal came)
void hb_received(NodeId n);
+ void set_auto_reconnect(int val);
+ int get_auto_reconnect() const;
/* TransporterCallback interface. */
void deliver_signal(SignalHeader * const header,
=== modified file 'storage/ndb/src/ndbapi/ndb_cluster_connection.cpp'
--- a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2009-06-29 20:56:37 +0000
+++ b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2009-07-03 21:11:59 +0000
@@ -897,5 +897,17 @@ Ndb_cluster_connection_impl::getRecvMute
return m_transporter_facade->theMutexPtr;
}
+int
+Ndb_cluster_connection::get_auto_reconnect() const
+{
+ return m_impl.m_transporter_facade->get_auto_reconnect();
+}
+
+void
+Ndb_cluster_connection::set_auto_reconnect(int value)
+{
+ m_impl.m_transporter_facade->set_auto_reconnect(value);
+}
+
template class Vector<Ndb_cluster_connection_impl::Node>;
Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20090703211159-d7d4btfwfqlk3fik.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.1 branch (jonas:2930) | Jonas Oreland | 3 Jul |