Help Center > > Developer Guide> WDR Performance Analysis> Performance View Snapshot> Managing the Snapshot Thread

Managing the Snapshot Thread

Updated at: Sep 17, 2021 GMT+08:00

You can view the working status of the snapshot thread in the PG_STAT_ACTIVITY or PGXC_STAT_ACTIVITY view.

  • When no snapshot is created, the snapshot thread is in the idle state.
    select application_name,backend_start,state_change,state,query from pg_stat_activity where application_name='WDRSnapshot';
    application_name |         backend_start         |         state_change          | state | query
    ------------------+-------------------------------+-------------------------------+-------+-------
    WDRSnapshot      | 2021-02-25 11:23:34.131612+08 | 2021-03-01 10:13:10.599428+08 | idle  |
    (1 row)
  • When a snapshot is being created, the snapshot thread enters the active state, and the query field displays the ongoing operation.
    select application_name,backend_start,state_change,state,query from pg_stat_activity where application_name='WDRSnapshot';
    application_name |         backend_start         |         state_change          | state  |          query
    ------------------+-------------------------------+-------------------------------+--------+-------------------------
    WDRSnapshot      | 2021-02-25 11:23:34.131612+08 | 2021-03-01 10:15:04.675727+08 | active | Creating WDR snapshots.
    (1 row)

    If a snapshot is being cleared, "Clearing outdated snapshots." is displayed in the query field. When the snapshot space is reclaimed, "Vacuum full snapshot tables." is displayed in the query field.

    The snapshot thread is started only on the CN when the process is started. Similar to other backend threads, Postmaster performs routine maintenance and management. If the snapshot thread exits or is killed, Postmaster restarts it.

    Before creating a snapshot, the system checks the cluster status. If the cluster is being scaled in or out or is being upgraded, the snapshot thread creates a snapshot after related operations are complete. To ensure the integrity of snapshot data, the cluster status is not checked during snapshot creation. If snapshot creation takes a long time and affects operations such as scaling, you can execute the kill_snapshot() function to stop the snapshot thread. In this way, snapshot creation is stopped and related resources are released.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel