Commit c59722ad authored by unknown's avatar unknown
Browse files

[PATCH] WL#3704 mgmapi timeouts: clarify multiple mgmd connect timeout semantics

Index: ndb-work/storage/ndb/include/mgmapi/mgmapi.h
===================================================================


storage/ndb/include/mgmapi/mgmapi.h:
  WL#3704 mgmapi timeouts: clarify multiple mgmd connect timeout semantics
storage/ndb/src/mgmapi/mgmapi.cpp:
  WL#3704 mgmapi timeouts: clarify multiple mgmd connect timeout semantics
parent e26da089
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -515,6 +515,18 @@ extern "C" {
  int ndb_mgm_set_connectstring(NdbMgmHandle handle,
				const char *connect_string);

  /**
   * Returns the number of management servers in the connect string
   * (as set by ndb_mgm_set_connectstring()). This can be used
   * to help work out how long the maximum amount of time that
   * ndb_mgm_connect can take.
   *
   * @param   handle         Management handle
   *
   * @return                < 0 on error
   */
  int ndb_mgm_number_of_mgmd_in_connect_string(NdbMgmHandle handle);

  int ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid);
  int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle);
  int ndb_mgm_get_connected_port(NdbMgmHandle handle);
@@ -570,6 +582,11 @@ extern "C" {
   * Connects to a management server. Connectstring is set by
   * ndb_mgm_set_connectstring().
   *
   * The timeout value is for connect to each management server.
   * Use ndb_mgm_number_of_mgmd_in_connect_string to work out
   * the approximate maximum amount of time that could be spent in this
   * function.
   *
   * @param   handle        Management handle.
   * @param   no_retries    Number of retries to connect
   *                        (0 means connect once).
+16 −0
Original line number Diff line number Diff line
@@ -479,6 +479,22 @@ int ndb_mgm_set_timeout(NdbMgmHandle handle, unsigned int timeout_ms)
  return 0;
}

extern "C"
int ndb_mgm_number_of_mgmd_in_connect_string(NdbMgmHandle handle)
{
  int count=0;
  int i;
  LocalConfig &cfg= handle->cfg;

  for (i = 0; i < cfg.ids.size(); i++)
  {
    if (cfg.ids[i].type != MgmId_TCP)
      continue;
    count++;
  }
  return count;
}

/**
 * Connect to a management server
 */