mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb client/mysql.cc: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/rpl_temporary.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/t/rpl_temporary.test: Auto merged sql/item_strfunc.cc: Auto merged sql/sql_show.cc: Auto merged storage/ndb/src/ndbapi/ClusterMgr.cpp: Auto merged storage/ndb/src/ndbapi/ClusterMgr.hpp: Auto merged storage/ndb/src/ndbapi/DictCache.hpp: Auto merged storage/ndb/src/ndbapi/TransporterFacade.hpp: Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp: Auto merged mysql-test/r/information_schema.result: manual merge mysql-test/t/information_schema.test: manual merge sql/ha_ndbcluster.cc: manual merge storage/ndb/include/ndbapi/ndb_cluster_connection.hpp: manual merge storage/ndb/src/ndbapi/DictCache.cpp: manual merge
This commit is contained in:
@@ -110,6 +110,7 @@ public:
|
||||
|
||||
unsigned no_db_nodes();
|
||||
unsigned node_id();
|
||||
unsigned get_connect_count() const;
|
||||
|
||||
void init_get_next_node(Ndb_cluster_connection_node_iter &iter);
|
||||
unsigned int get_next_node(Ndb_cluster_connection_node_iter &iter);
|
||||
|
@@ -70,6 +70,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade):
|
||||
noOfAliveNodes= 0;
|
||||
noOfConnectedNodes= 0;
|
||||
theClusterMgrThread= 0;
|
||||
m_connect_count = 0;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@@ -445,6 +446,10 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){
|
||||
theNode.nfCompleteRep = false;
|
||||
if(noOfAliveNodes == 0)
|
||||
{
|
||||
theFacade.m_globalDictCache.lock();
|
||||
theFacade.m_globalDictCache.invalidate_all();
|
||||
theFacade.m_globalDictCache.unlock();
|
||||
m_connect_count ++;
|
||||
NFCompleteRep rep;
|
||||
for(Uint32 i = 1; i<MAX_NODES; i++){
|
||||
if(theNodes[i].defined && theNodes[i].nfCompleteRep == false){
|
||||
|
@@ -80,6 +80,7 @@ public:
|
||||
bool isClusterAlive() const;
|
||||
void hb_received(NodeId);
|
||||
|
||||
Uint32 m_connect_count;
|
||||
private:
|
||||
Uint32 noOfAliveNodes;
|
||||
Uint32 noOfConnectedNodes;
|
||||
|
@@ -280,6 +280,41 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab)
|
||||
DBUG_RETURN(tab);
|
||||
}
|
||||
|
||||
unsigned
|
||||
GlobalDictCache::get_size()
|
||||
{
|
||||
NdbElement_t<Vector<TableVersion> > * curr = m_tableHash.getNext(0);
|
||||
int sz = 0;
|
||||
while(curr != 0){
|
||||
sz += curr->theData->size();
|
||||
curr = m_tableHash.getNext(curr);
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
|
||||
void
|
||||
GlobalDictCache::invalidate_all()
|
||||
{
|
||||
DBUG_ENTER("GlobalDictCache::invalidate_all");
|
||||
NdbElement_t<Vector<TableVersion> > * curr = m_tableHash.getNext(0);
|
||||
while(curr != 0){
|
||||
Vector<TableVersion> * vers = curr->theData;
|
||||
if (vers->size())
|
||||
{
|
||||
TableVersion * ver = & vers->back();
|
||||
ver->m_impl->m_status = NdbDictionary::Object::Invalid;
|
||||
ver->m_status = DROPPED;
|
||||
if (ver->m_refCount == 0)
|
||||
{
|
||||
delete ver->m_impl;
|
||||
vers->erase(vers->size() - 1);
|
||||
}
|
||||
}
|
||||
curr = m_tableHash.getNext(curr);
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void
|
||||
GlobalDictCache::release(NdbTableImpl * tab, int invalidate)
|
||||
{
|
||||
|
@@ -71,6 +71,9 @@ public:
|
||||
|
||||
void alter_table_rep(const char * name,
|
||||
Uint32 tableId, Uint32 tableVersion, bool altered);
|
||||
|
||||
unsigned get_size();
|
||||
void invalidate_all();
|
||||
public:
|
||||
enum Status {
|
||||
OK = 0,
|
||||
|
@@ -318,6 +318,12 @@ TransporterFacade::unlock_mutex()
|
||||
|
||||
#include "ClusterMgr.hpp"
|
||||
|
||||
inline
|
||||
unsigned Ndb_cluster_connection_impl::get_connect_count() const
|
||||
{
|
||||
return TransporterFacade::instance()->theClusterMgr->m_connect_count;
|
||||
}
|
||||
|
||||
inline
|
||||
bool
|
||||
TransporterFacade::check_send_size(Uint32 node_id, Uint32 send_size)
|
||||
|
@@ -253,6 +253,12 @@ Ndb_cluster_connection::wait_until_ready(int timeout,
|
||||
} while (1);
|
||||
}
|
||||
|
||||
unsigned Ndb_cluster_connection::get_connect_count() const
|
||||
{
|
||||
return m_impl.get_connect_count();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -40,6 +40,7 @@ class Ndb_cluster_connection_impl : public Ndb_cluster_connection
|
||||
void init_get_next_node(Ndb_cluster_connection_node_iter &iter);
|
||||
Uint32 get_next_node(Ndb_cluster_connection_node_iter &iter);
|
||||
|
||||
inline unsigned get_connect_count() const;
|
||||
private:
|
||||
friend class Ndb;
|
||||
friend class NdbImpl;
|
||||
|
Reference in New Issue
Block a user