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

fix: enforce postgres.auto.conf to rw before run rewind #3728

Merged
merged 3 commits into from Jan 29, 2024
Merged

Conversation

litaocdl
Copy link
Contributor

@litaocdl litaocdl commented Jan 25, 2024

pg_rewind needs to be able to write to all the files in the PostgreSQL data
directory. For this reason, we always set postgresql.auto.conf mode to 600
before running it.

After the PostgreSQL data directory is ready to be used, we revert the
permission to be coherent with what the user specified in the enableAlterSystem
configuration parameter.

Closes: #3698

Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

Copy link
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@litaocdl litaocdl marked this pull request as draft January 26, 2024 03:33
@litaocdl
Copy link
Contributor Author

@litaocdl litaocdl changed the title fix: change postgres.auto.conf to 0600 before run rewind fix: enforce postgres.auto.conf to rw before run rewind Jan 26, 2024
@litaocdl litaocdl marked this pull request as ready for review January 26, 2024 06:57
@mnencia
Copy link
Member

mnencia commented Jan 26, 2024

@mnencia
Copy link
Member

mnencia commented Jan 26, 2024

Copy link
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

@mnencia
Copy link
Member

mnencia commented Jan 26, 2024

/ok-to-merge E2E green

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jan 26, 2024
litaocdl and others added 2 commits January 27, 2024 17:58
Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
@leonardoce leonardoce self-assigned this Jan 29, 2024
Copy link
Contributor

Build Error! No Linked Issue found. Please link an issue or mention it in the body using #<issue_id>

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
@leonardoce
Copy link
Contributor

@leonardoce
Copy link
Contributor

/ok-to-merge E2E green

@leonardoce leonardoce merged commit 9ff7942 into main Jan 29, 2024
30 checks passed
@leonardoce leonardoce deleted the dev/cnp-4491 branch January 29, 2024 12:39
cnpg-bot pushed a commit that referenced this pull request Jan 29, 2024
pg_rewind needs to be able to write all the files in the PostgreSQL
data directory. For this reason, we always set `postgresql.auto.conf` mode to
600 before running it.

After the PostgreSQL data directory is ready to be used, we revert the
permission to be coherent with what the user specified in the
`enableAlterSystem` configuration parameter.

Closes: #3698

Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
(cherry picked from commit 9ff7942)
cnpg-bot pushed a commit that referenced this pull request Jan 29, 2024
pg_rewind needs to be able to write all the files in the PostgreSQL
data directory. For this reason, we always set `postgresql.auto.conf` mode to
600 before running it.

After the PostgreSQL data directory is ready to be used, we revert the
permission to be coherent with what the user specified in the
`enableAlterSystem` configuration parameter.

Closes: #3698

Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
(cherry picked from commit 9ff7942)
cnpg-bot pushed a commit that referenced this pull request Jan 29, 2024
pg_rewind needs to be able to write all the files in the PostgreSQL
data directory. For this reason, we always set `postgresql.auto.conf` mode to
600 before running it.

After the PostgreSQL data directory is ready to be used, we revert the
permission to be coherent with what the user specified in the
`enableAlterSystem` configuration parameter.

Closes: #3698

Signed-off-by: Tao Li <tao.li@enterprisedb.com>
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
(cherry picked from commit 9ff7942)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-requested ◀️ This pull request should be backported to all supported releases ok to merge 👌 This PR can be merged release-1.20 release-1.21 release-1.22
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: pg_rewind: error: restore_command is not set in the target cluster
4 participants