This topic provides answers to frequently asked questions (FAQ) about PolarProxy provided by PolarDB.

Read/write splitting

  • Why am I unable to retrieve a record immediately after I insert the record?

    In a read/write splitting architecture, a delay occurs when data is being replicated among the primary node and read-only nodes. PolarDB supports session consistency to ensure that you can query updates within a session. You can retrieve the inserted record after the replication is complete. For more information, see the "Session consistency" section in Consistency levels.

  • Can data be read immediately after it is written into PolarDB?

    No, data cannot be read immediately after the data is written into PolarDB. A delay of a few milliseconds occurs when you read data by using an endpoint for which read/write splitting is enabled, even if the loads on the primary node and read-only nodes of an PolarDB cluster are not heavy. To eliminate this delay, you can use the primary endpoint to connect to the PolarDB cluster. This way, read and write requests are sent to the primary node. For more information about how to view the primary endpoint, see View the endpoint and port.

  • Why do low loads exist on read-only nodes when the loads on the primary node are high?
    By default, requests in transactions are routed only to the primary node. To balance loads across the primary and read-only nodes, you can use the following solutions:
    • When you perform stress tests by using Sysbench, specify --oltp-skip-trx=on in the code if the version of Sysbench is 0.5 or --skip-trx=on if the version of Sysbench is 1.0. This way, you do not need to execute the BEGIN and COMMIT statements.
    • If a large number of transactions cause heavy loads on the primary node, you can enable the transaction splitting feature to reduce the loads on the primary node. For more information, see Transaction splitting.
  • Why does a specific node receive more requests than other nodes?

    Requests are distributed to each node based on loads. The nodes on which lighter loads exist receive more requests.

  • Does a new read-only node automatically receive read requests?

    This depends on whether a session that supports read/write splitting is created after you add a read-only node. If yes, requests are automatically forwarded to the read-only node. If no, read requests are not forwarded to the read-only node. In this case, you can close a connection and then reconnect to your cluster. This way, read requests sent over the connection are forwarded to the read-only node. For example, you can restart your application to establish a new connection.

Cluster endpoints

  • What is the maximum number of single-node cluster endpoints that I can create in a cluster?

    You can create up to three custom cluster endpoints for a cluster. The custom cluster endpoints can be single-node cluster endpoints. For more information about how to create a single-node cluster endpoint, see Create a custom cluster endpoint.

    Warning If you create a single-node cluster endpoint for a read-only node and the read-only node fails to run as expected, the single-node cluster endpoint may be unavailable for up to 1 hour. We recommend that you do not create single-node cluster endpoints in your production environment.
  • If a single-node cluster endpoint is created for a read-only node, can the read-only node be used as the new primary node after a failover?

    The read-only node for which a single-node cluster endpoint is created cannot be automatically used as the new primary node after a failover. However, you can manually promote the read-only node as the new primary node. For more information, see Perform a switchover.

  • What is the maximum number of cluster endpoints that can be created for a cluster?

    A cluster can contain a maximum of four cluster endpoints. One cluster endpoint is the default cluster endpoint and the other endpoints are custom cluster endpoints.

  • Can I modify a cluster endpoint?

    Yes, you can modify the default cluster endpoint and custom cluster endpoints. For more information, see Create a custom cluster endpoint.

  • Can I delete a cluster endpoint?

    Yes, you can delete only custom cluster endpoints. You cannot delete the default cluster endpoint. For more information, see Create a custom cluster endpoint.