Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom_wal_dir: Refactoring custom WAL directory setup #425

Merged
merged 3 commits into from
Jul 20, 2023

Conversation

vitabaks
Copy link
Owner

@vitabaks vitabaks commented Jul 20, 2023

This PR includes a refactoring of the Ansible playbook that manages PostgreSQL's WAL directory, as well as an update to the Patroni configuration template.

Main Changes:

  1. Refactoring the Ansible playbook for managing Postgresql WAL:
  • Defined the name of the base WAL directory at the start of the script. This improves readability and simplifies the handling of the variable later in the script.
  • Updated the WAL synchronization block. Now, it first ensures the custom WAL directory exists and is empty. Execute CHECKPOINT before stopping PostgreSQL.
  • Modified the order of certain actions to enhance script reliability.
  1. Updating the Patroni configuration template:
  • Removed the PostgreSQL version check and the condition for defining waldir in the template.
  • Added a new option In 'basebackup' variable which allows users to specify 'waldir' setting. By default, this option is disabled.
  1. Additional tag added for point-in-time recovery operations:
  • An extra tag point_in_time_recovery has been introduced for tasks in custom_wall_dir.yml. This tag allows the execution of these tasks specifically after restore from backup to ensure that a symlink to a separate WAL directory set up after the recovery.
  1. Added molecule test for custom PostgreSQL data and WAL directory.
  • It makes sense when custom paths are set in the variables postgresql_data_dir and postgresql_wal_dir
  • This test verifies that our setup can accommodate non-standard directory paths and supports relocating the WAL directory to a separate disk (using a symlink).

These changes will make the playbook more robust and user-friendly for configuration and maintenance.

@vitabaks vitabaks self-assigned this Jul 20, 2023
@vitabaks vitabaks merged commit f0056bc into master Jul 20, 2023
@vitabaks vitabaks deleted the custom_wal_dir branch July 21, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant