Bug #106751 Connect timeout too long towards MGMD nodes
Submitted: 16 Mar 2022 17:25 Modified: 21 Feb 16:36
Reporter: Mikael Ronström Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:8.0.28 OS:Any
Assigned to: CPU Architecture:Any

[16 Mar 2022 17:25] Mikael Ronström
Description:
If a hostname in config.ini for a MGM Server is a existing
IP address, but no computer is using the IP, the connect towards
this IP address will timeout.

In the mgmapi.cpp this timeout is set to the generic timeout
for any MGM API handling which is 60 seconds. However this timeout
is also used by thread that connects to TCP servers. This means that
every time a connect is attempted towards this node the thread will
block for 60 seconds.

Other API nodes use a connect timeout of 3 seconds which is more reasonable.

How to repeat:
Create a config with a correct IP address not used by any computer.
Use this IP for a second MGM Server.

Suggested fix:
Introduce new variable connect_timeout in mgmapi data structure and set this
by default to 3000 milliseconds. Ensure that the MGM API call to set
connect timeout use this variable as well.
[17 Mar 2022 5:37] MySQL Verification Team
Hello Mikael,

Thank you for the report and feedback.

Sincerely,
Umesh
[21 Feb 16:36] Jon Stephens
Documented fix as follows in the NDB 8.0.37 and 8.4.0 changelogs as follows:

    When a hostname in config.ini for a management server uses an
    existing IP address, but no host computer is actually using the
    address, the connection attempt times out. The length of this
    timeout was set in mgmapi.cpp to the generic timeout for all MGM
    API handling, which is 60 seconds, but since this timeout is
    (also) used by threads connecting to TCP servers, every time a
    connection to this node was attempted, the thread blocked for 60
    seconds.
  
    Now a connection timeout of 3 seconds is used instead; this is
    in line with that used by other API nodes.
  
    As part of the work done for this fix, the
    ndb_mgm_set_connect_timeout() MGM API function, present but
    undocumented and unsupported in previous NDB releases, is now
    supported, and sets the default timeout used for
    ndb_mgm_connect().

Closed.
[21 Feb 16:37] Jon Stephens
Also updated related info in the MGM API documentation.