FAQ about global consistency (high-performance mode)
This topic answers frequently asked questions about using global consistency (high-performance mode).
After I enable global consistency (high-performance mode), how do I disable global consistency reads for queries that do not require them?
After you enable global consistency (high-performance mode) on the target endpoint, global consistency reads are enabled by default for new connections established through that endpoint. If some queries do not require this feature, run the following command to disable global consistency reads for the current connection:
SET SESSION innodb_polar_scc = OFFIf the version requirements for per-endpoint configuration are met, enabling or disabling global consistency (high-performance mode) on an endpoint takes effect on that endpoint. Otherwise, the feature is configured at the cluster level and applies to new connections established through all endpoints. The preceding SET Session innodb_polar_scc = OFF command disables global consistency reads only for the current connection. It does not disable the feature for the current endpoint or the entire cluster. For the version requirements and scope of per-endpoint configuration, see What is global consistency (high-performance mode).
To disable global consistency (high-performance mode) for the current connection, the cluster version must meet one of the following requirements:
PolarDB for MySQL 8.0.2 with revision version 8.0.2.2.16 or later.
PolarDB for MySQL 8.0.1 with revision version 8.0.1.1.33 or later.
PolarDB for MySQL 5.7 with revision version 5.7.1.0.28 or later.
How do I set the global consistency read timeout?
Log in to the PolarDB console。 Set the loose_innodb_polar_scc_wait_timeout parameter to configure the global consistency read timeout. If a timeout occurs, the client receives the following error message:
Wait replication complete timeout, please retryFor clusters with a high or unstable write load, set the
loose_innodb_polar_scc_wait_timeoutparameter to a larger value.For clusters that run one of the following versions, establish new connections for the change to take effect. Existing connections retain their original values:
PolarDB for MySQL 8.0.2 with revision version 8.0.2.2.29 or later.
PolarDB for MySQL 8.0.1 with revision version 8.0.1.1.48 or later.
PolarDB for MySQL 5.7 with revision version 5.7.1.0.38 or later.
What is the forwarding mechanism for global consistency read timeouts?
For PolarDB for MySQL 5.7, the forwarding mechanism works as follows after you enable global consistency (high-performance mode):
If a global consistency wait timeout occurs for a query routed to an RO node through a cluster endpoint, the database proxy automatically forwards the query to an RW node for processing. The client receives no error message.
If a global consistency wait timeout occurs for a query routed to an RO node through a read-only endpoint with no RW node attached, the query is not forwarded to an RW node for processing.
For PolarDB for MySQL 8.0, the forwarding mechanism works as follows after you enable global consistency (high-performance mode):
If the database proxy version is 2.8.36 or later:
If a global consistency wait timeout occurs for a query routed to an RO node through a cluster endpoint, the database proxy automatically forwards the query to an RW node for processing. The client receives no error message.
If a global consistency wait timeout occurs for a query routed to an RO node through a read-only endpoint with no RW node attached, the query is not forwarded to an RW node for processing.
If the database proxy version is earlier than 2.8.36:
After you enable global consistency (high-performance mode), requests routed to an RO node through any endpoint are not forwarded to an RW node for processing if a global consistency wait timeout occurs.
You can enable RDMA-based log shipment to reduce read latency on RO nodes, or adjust the global consistency read timeout by using the
loose_innodb_polar_scc_wait_timeoutparameter.
How do I fall back to non-consistent reads after a global consistency read timeout?
Log in to the PolarDB console。 Set the loose_innodb_polar_scc_timeout_degrade parameter to ON. If a global consistency read timeout occurs, queries automatically fall back to non-consistent reads, and the client receives no error message.
For clusters that run one of the following versions, establish new connections for the change to take effect. Existing connections retain their original values:
PolarDB for MySQL 8.0.2 with revision version 8.0.2.2.29 or later.
PolarDB for MySQL 8.0.1 with revision version 8.0.1.1.48 or later.
PolarDB for MySQL 5.7 with revision version 5.7.1.0.38 or later.
How do I avoid read latency when the write load is low?
Log in to the PolarDB console。 Set the high-performance parameter innodb_flush_log_at_trx_commit to 1 to avoid read latency when the write load is low.