Skip to content

Conversation

@dlenski
Copy link
Contributor

@dlenski dlenski commented Apr 29, 2024

This PR is a pared-down version of #245, which only introduces support for the the server-initiated instant failover mechanism and does not address any of the pre-existing TLS issues which were discovered or highlighted during its development.

Upstream developers chose a different approach (see MariaDB/server#1472 and #137) for MDEV-15935 ("connection redirection").

I maintain that a simple and obligatory server-directed failover mechanism will be a very useful feature for many users, so I'm reintroducing it here under the alternative name of "instant failover."


This is the client counterpart of MariaDB/server#3224, which provides an initial server-initiated mechanism for instantly redirecting new client connections to a failover server.

It modifies the Connector/C library, so that if the server responds to our initial connection with an error packet having
error number ER_INSTANT_FAILOVER, and an error string formatted as |Human-readable message|host[:port], the client will redirect its connection accordingly.

This redirection is performed in mthd_my_real_connect, which appears to be the most appropriate location given that it already contains code for retrying/repeating a new server connection.

dlenski added 3 commits April 29, 2024 15:37
If the server responds to our initial connection with an error packet having error number `ER_INSTANT_FAILOVER`, and an error string formatted as `|Human-readable message|host[:port]`, then redirect accordingly. This redirection is performed in `mthd_my_real_connect`, which appears to be the most appropriate location given that it already contains code for retrying/repeating a new server connection. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
This adds a new boolean option, `follow-instant-failovers` (ENABLED by default), to allow the client to disable server-initiated instant failover and simply return an error message. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
Set the limit to 8 for now. This will prevent the client from getting stuck in redirect loops. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
@vuvova
Copy link
Member

vuvova commented Feb 23, 2025

We already have a failover mechanism, we aren't going to do another one

@vuvova vuvova closed this Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants