Example #1
0
inline
NdbOut &
operator<<(NdbOut& ndbout, const NodeInfo & info){
  ndbout << "[NodeInfo: ";
  switch(info.m_type){
  case NodeInfo::DB:
    ndbout << "DB";
    break;
  case NodeInfo::API:
    ndbout << "API";
    break;
  case NodeInfo::MGM:
    ndbout << "MGM";
    break;
  case NodeInfo::INVALID:
    ndbout << "INVALID";
    break;
  default:
    ndbout << "<Unknown: " << info.m_type << ">";
    break;
  }

  ndbout << " ndb version: " << NdbVersion(info.m_version)
	 << " mysql version: " << NdbVersion(info.m_mysql_version)
	 << " connect count: " << info.m_connectCount
	 << "]";
  return ndbout;
}
Example #2
0
/**
 * recalcMinDbVersion
 *
 * This method is called whenever the 'minimum DB node
 * version' data for the connected DB nodes changes
 * It calculates the minimum version of all the connected
 * DB nodes.
 * This information is cached by Ndb object instances.
 * This information is useful when implementing API compatibility
 * with older DB nodes
 */
void
ClusterMgr::recalcMinDbVersion()
{
    Uint32 newMinDbVersion = ~ (Uint32) 0;

    for (Uint32 i = 0; i < MAX_NODES; i++)
    {
        trp_node& node = theNodes[i];

        if (node.is_connected() &&
                node.is_confirmed() &&
                node.m_info.getType() == NodeInfo::DB)
        {
            /* Include this node in the set of nodes used to
             * compute the lowest current DB node version
             */
            assert(node.m_info.m_version);

            if (node.minDbVersion < newMinDbVersion)
            {
                newMinDbVersion = node.minDbVersion;
            }
        }
    }

    /* Now update global min Db version if we have one.
     * Otherwise set it to 0
     */
    newMinDbVersion = (newMinDbVersion == ~ (Uint32) 0) ?
                      0 :
                      newMinDbVersion;

//#ifdef DEBUG_MINVER

#ifdef DEBUG_MINVER
    if (newMinDbVersion != minDbVersion)
    {
        ndbout << "Previous min Db node version was "
               << NdbVersion(minDbVersion)
               << " new min is "
               << NdbVersion(newMinDbVersion)
               << endl;
    }
    else
    {
        ndbout << "MinDbVersion recalculated, but is same : "
               << NdbVersion(minDbVersion)
               << endl;
    }
#endif

    minDbVersion = newMinDbVersion;
}