This PR introduces several important changes to the process of upgrading Postgres to the new major version:
Move the execution of the statistics task to directly follow the PostgreSQL upgrade process, specifically after the pg_upgrade execution but before conducting post-upgrade checks and updating extensions.
By shifting the statistics collection earlier, we aim to minimize post-upgrade performance dips and maintain system efficiency. This move aligns with best practices for database management and upgrades.
Move "Wait for the analyze to complete" and "Stop pg_terminator script" to Post-Upgrade tasks.
This will allow you to continue performing the remaining tasks of the POST-UPGRADE stage instead of waiting for the statistics collection to be completed. Now we check the status of statistics collection after completing all tasks related to the update.
Monitor and terminate the long-running transactions during statistics collection
This task is designed to terminate active queries exceeding a specified duration (in seconds) during the collection of statistics, as defined by the 'vacuumdb_analyze_terminate_threshold' variable. If this variable is set to a value greater than 0 (default is '0'), the pg_terminator script automatically cancels transactions exceeding this duration.
This preventative measure helps avoid partial performance degradation of the database during the period when statistics are yet to be fully collected. It ensures the database server resources are not overwhelmed and the number of available connections is not saturated, maintaining efficient database operation
This PR introduces several important changes to the process of upgrading Postgres to the new major version:
statistics
task to directly follow the PostgreSQL upgrade process, specifically after thepg_upgrade
execution but before conducting post-upgrade checks and updating extensions.vacuumdb_analyze_terminate_threshold
' variable. If this variable is set to a value greater than 0 (default is '0'), the pg_terminator script automatically cancels transactions exceeding this duration.