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

feat: add parameter pg_fs_wal (G) to changing pg_wal dir #530

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

waitingsong
Copy link
Contributor

@waitingsong waitingsong commented Mar 9, 2025

new pg_wal style is <pg_fs_wal>/<pg_cluster>-<pg_version>/pg_wal when pg_fs_wal defined

pg_fs_wal validatiton: pg_fs_wal must start with '/' and not contain spaces

modify pg_wal of current pg_cluster:

  1. edit and save pigsty.yml by setting the global pg_wal
  2. run command ./pgsql.yml - <cls> -t pg_wal

tested scenarios:

  • pig sty install
    • pg_fs_wal undefined
    • pg_fs_wal defined
  • bin/pgsql-add <pg_cluster>
    • pg_fs_wal undefined
    • pg_fs_wal defined
  • bin/pgsql-add <pg_cluster> <ip>
  • ./pgsql.yml -t pg_wal after full installation
    • set pg_fs_wal=/wal
    • set pg_fs_wal=/wal2 (from /wal)
    • remove pg_fs_wal (from /wal2)
  • multiple call ./pgsql.yml -t pg_wal
    • keep pg_fs_wal undefined or blank
    • keep pg_fs_wal=/wal

pg-backup full will be executed automatically if pg_fs_wal changed and apply this settings:

  • full installation with valid pg_fs_wal (no backup operation if pg_fs_wal undefined or blank)
  • pg_fs_wal changed after installation
    • undefined or empty to /wal
    • /wal to /wal2
    • /wal2 to undefined or empty

@waitingsong waitingsong force-pushed the pg_fs_wal branch 3 times, most recently from 3c21019 to d820dcd Compare March 9, 2025 14:58
@waitingsong waitingsong changed the title feat: add parameter pg_fs_wal (G|C) to changing pg_wal dir feat: add parameter pg_fs_wal (G) to changing pg_wal dir Mar 9, 2025
@waitingsong waitingsong force-pushed the pg_fs_wal branch 4 times, most recently from de2d0ff to 2354546 Compare March 9, 2025 15:42
@waitingsong waitingsong changed the title feat: add parameter pg_fs_wal (G) to changing pg_wal dir WIP feat: add parameter pg_fs_wal (G) to changing pg_wal dir Mar 9, 2025
@waitingsong waitingsong changed the title WIP feat: add parameter pg_fs_wal (G) to changing pg_wal dir feat: add parameter pg_fs_wal (G) to changing pg_wal dir Mar 9, 2025
@waitingsong waitingsong force-pushed the pg_fs_wal branch 13 times, most recently from 1db0301 to 723bc4f Compare March 13, 2025 11:09
@waitingsong waitingsong changed the title feat: add parameter pg_fs_wal (G) to changing pg_wal dir WIP feat: add parameter pg_fs_wal (G) to changing pg_wal dir Mar 13, 2025
@waitingsong waitingsong force-pushed the pg_fs_wal branch 4 times, most recently from 1cae2b0 to 8ec46f2 Compare March 14, 2025 07:36
@waitingsong waitingsong changed the title WIP feat: add parameter pg_fs_wal (G) to changing pg_wal dir feat: add parameter pg_fs_wal (G) to changing pg_wal dir Mar 14, 2025
@waitingsong waitingsong changed the title feat: add parameter pg_fs_wal (G) to changing pg_wal dir WIP feat: add parameter pg_fs_wal (G) to changing pg_wal dir Mar 15, 2025
@Vonng
Copy link
Member

Vonng commented Mar 17, 2025

this one is quite big, may take some time to validate

@waitingsong
Copy link
Contributor Author

waitingsong commented Mar 17, 2025

this one is quite big, may take some time to validate

2f3aaea is same as f28c2cc of PR

@waitingsong waitingsong changed the title WIP feat: add parameter pg_fs_wal (G) to changing pg_wal dir feat: add parameter pg_fs_wal (G) to changing pg_wal dir Mar 17, 2025
- check_pg_ready
- is_patroni_paused
- start postgres
- start and stop postgres gracefully
- patroni pause|resume gracefully
new pg_wal style is `<pg_fs_wal>/<pg_cluster>-<pg_version>/pg_wal` when pg_fs_wal defined

pg_fs_wal validatiton: pg_fs_wal must start with '/' and not contain spaces

modify pg_wal of current pg_cluster:
1. edit and save pigsty.yml by setting the global `pg_wal`
2. run command `./pgsql.yml -l <cls> -t pg_wal`

tested scenarios:
- `pig sty install`
  - pg_fs_wal undefined
  - pg_fs_wal defined
- `bin/pgsql-add pg-a`
  - pg_fs_wal undefined
  - pg_fs_wal defined
- `./pgsql.yml -t pg_wal`
  - set pg_fs_wal=/wal
  - set pg_fs_wal=/wal2 (from /wal)
  - remove pg_fs_wal (from /wal2)
- multiple call `./pgsql.yml -t pg_wal`
  - keep pg_fs_wal undefined or blank
  - keep pg_fs_wal=/wal

`pg-backup full` will be executed automatically if pg_fs_wal changed and apply this settings:
- full installation with valid pg_fs_wal (no backup operation if pg_fs_wal undefined or blank)
- pg_fs_wal changed after installation
  - undefined or empty to `/wal`
  - `/wal` to `/wal2`
  - `/wal2` to undefined or empty
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.

2 participants