Skip to content

Patch postgresql-setup.sh #1981

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Patch postgresql-setup.sh #1981

wants to merge 1 commit into from

Conversation

rdlrt
Copy link
Contributor

@rdlrt rdlrt commented Jun 13, 2025

Description

Last update to this script accidentally seemed to have deleted an additional line that it wasnt supposed to. This resulted in lstate file not being restored in ledger-state directory, thereby - forcing a replay every time restore was done.

Checklist

  • Commit sequence broadly makes sense
  • Commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Any changes are noted in the changelog
  • Code is formatted with fourmolu on version 0.10.1.0 (which can be run with scripts/fourmolize.sh)
  • Self-reviewed the diff

@rdlrt rdlrt requested a review from a team as a code owner June 13, 2025 07:29
@@ -192,6 +192,7 @@ function restore_snapshot {
tar xvf "$1" --directory "$tmp_dir"
if test -d "${tmp_dir}/db/" ; then
# New pg_dump format
lstate_gz_file=$(find "${tmp_dir}/" -iname "*.lstate.gz")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right? Would tar xvf "$1" --directory "$tmp_dir" put the archive in $tmp_dir?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an existing line in the script, not part of the proposed changes but yes, tar with --directory parameter would step into $tmp_dir folder before commencing the extraction.

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.

3 participants