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

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

    In a read/write splitting architecture, a replication delay exists during data replication 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 Session consistency.

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

    No, data cannot be read immediately after it is written into PolarDB. A delay of a few milliseconds occurs when you read data by using an endpoint that has read/write splitting 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 an endpoint and port number.

  • Why do read-only nodes have low loads 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 try the following solutions:
    • For stress testing that uses Sysbench, add --oltp-skip-trx=on to your code if Sysbench 0.5 is used or --skip-trx=on if Sysbench 1.0 is used. This way, you do not need to execute the BEGIN and COMMIT statements.
    • In actual usage, a large number of transactions can cause heavy loads on the primary node. In this case, you can enable the transaction splitting feature to reduce the loads on the primary node. For more information, see Transaction splitting.
  • Why does a node receive more requests than others?

    Requests are distributed to each node based on loads. The nodes with lighter loads 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.