Skip to content

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

Merged
leonardoce merged 3 commits into
mainfrom
dev/cnp-4491
Jan 29, 2024
Merged

leonardoce merged 3 commits into
mainfrom
dev/cnp-4491

Conversation

@litaocdl

@litaocdl litaocdl commented Jan 25, 2024 •

Copy link
Copy Markdown
Collaborator

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

@github-actions github-actions Bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.20 labels Jan 25, 2024
@github-actions

Copy link
Copy Markdown
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

@github-actions

Copy link
Copy Markdown
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
Copy Markdown
Collaborator 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

mnencia commented Jan 26, 2024

Copy link
Copy Markdown
Member

@mnencia

mnencia commented Jan 26, 2024

Copy link
Copy Markdown
Member

@github-actions

Copy link
Copy Markdown
Contributor

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

@mnencia

mnencia commented Jan 26, 2024

Copy link
Copy Markdown
Member

/ok-to-merge E2E green

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jan 26, 2024
@leonardoce leonardoce self-assigned this Jan 29, 2024
@github-actions

Copy link
Copy Markdown
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 <[email protected]>
@leonardoce

Copy link
Copy Markdown
Contributor

@leonardoce

Copy link
Copy Markdown
Contributor

/ok-to-merge E2E green

@leonardoce
leonardoce merged commit 9ff7942 into main Jan 29, 2024
@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 <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
(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 <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
(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 <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
(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

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