Help Center/ GaussDB(for MySQL)/ Troubleshooting/ Performance Issues/ Read Replica Uses Far More Storage Than the Primary Instance
Updated on 2024-09-05 GMT+08:00

Read Replica Uses Far More Storage Than the Primary Instance

Scenario

The storage usage of a GaussDB(for MySQL) read replica was, for example, 195 GB higher than that of the primary instance.

Troubleshooting

The storage space is calculated as follows: Shared storage space + Space occupied by binlogs + Space occupied by data disks (for storing temporary tables)

Check the transactions running on the read replica.

As shown in the preceding figure, there was a long transaction started a day ago that has not been committed yet. The temporary tables generated by this transaction were not cleared, which took up a lot of storage space.

Solution

  • Method 1: Wait until the transaction is committed. After that, the temporary tables will be automatically cleared, releasing storage space.
  • Method 2: Kill the corresponding session to stop the long transaction.