Manual Switch Behavior Tuning in the Tungsten Connector

In this blog post, we talk about how existing client connections are handled by the Tungsten Connector when a manual master role switch is invoked and how to adjust that behavior.

When a graceful switch is invoked via cctrl or the Tungsten Dashboard, by default the Connector will wait for five (5) seconds to allow in-flight activities to complete before forcibly disconnecting all active connections from the application side, no matter what type of query was in use.

If connections still exist after the timeout interval, they are forcibly closed, and the application will get back an error.

This configuration setting ONLY applies to a manual switch. During a failover caused by loss of MySQL availability, there is no wait and all connections are force-closed immediately.

This timeout is adjusted via the tpm option --connector-disconnect-timeout (connector-disconnect-timeout inside INI files).

If you increase this value, you delay the manual switch!

ONLY change this if you accept the fact that the manual switch process will last at least as long as this setting in seconds.

Please note that updating these values require a connector restart (usually happens automatically via tpm update) for the changes to be recognized. This wil disconnect all existing client application sessions.

Do not set this value to zero (0) or there will be no attempt to disconnect at all.

If you wish to disable the wait entirely, set --property=waitForDisconnect=false in your configuration on the connector nodes and run tpm update.

For example, to change the delay to 10 seconds instead of the default 5 seconds:

shell> ./tools/tpm configure alpha --connector-disconnect-timeout=10
shell> ./tools/tpm update

You may grep for the setting waitForDisconnectTimeout located in cluster-home/conf/ to confirm the change has been applied.

Click here for the documentation page: Adjusting the Client Disconnect Delay During Manual Switch

In future articles, we will continue to cover more advanced subjects of interest!

Questions? Contact Continuent

About the Author

Eric M. Stone
COO and VP of Product Management

Eric is a veteran of fast-paced, large-scale enterprise environments with 35 years of Information Technology experience. With a focus on HA/DR, from building data centers and trading floors to world-wide deployments, Eric has architected, coded, deployed and administered systems for a wide variety of disparate customers, from Fortune 500 financial institutions to SMB’s.

Add new comment