When an instance added to the database proxy becomes unavailable due to an exception, the database proxy will forward SQL statements to another instance for execution or discard SQL statements and generate error information based on SQL statement forwarding policies for instance faults. This document describes the settings and principles of the forwarding policies.
Background
During operation, a database instance may become unavailable due to various exceptions, such as server power outages, restarts, and network interruptions. The TencentDB for MySQL database proxy provides capabilities of SQL statement forwarding upon instance faults to avoid business unavailability due to SQL execution errors when an instance exception occurs.
Prerequisites
Forwarding Policies
The current database proxy supports the following SQL statement forwarding policies for instance faults:
If a read-only instance and a primary instance are faulty, the database proxy will send SELECT statements to a normal instance for execution by default.
If a primary instance is faulty, the database proxy will report an error for the execution of DML or DDL statements.
If a read-only analysis engine under the database proxy is faulty, the database proxy will forward SQL statements to a normal read-only analysis engine for execution.
If all read-only analysis engines under the database proxy are faulty, the system will return an execution error with the error message "no backend server".
Note:
Currently, the above instance fault forwarding policies cannot be modified. By default, the parameter for SQL statement forwarding upon faults of read-only instances or read-write instances is enabled, while the parameter for forwarding upon faults of read-only analysis engines is disabled.
Operation Steps
1. Log in to the MySQL console. In the instance list, select the primary instance for which the database proxy is enabled, and click Instance ID or Manage in the Operation column to access the instance management page. 2. On the Instance Management page, select Database Proxy. Find the access address to be modified under the connection address, and click Adjust Configurations in the corresponding Operation column to go to the Adjust Configurations page. You can view SQL statement forwarding policies for different types of instance faults on this page.