Skip to content

fix(init-bedrock): overwrite a leftover snapshot archive on retry - #99

Open
furkan3152 wants to merge 2 commits into
inkonchain:mainfrom
furkan3152:fix/snapshot-redownload
Open

furkan3152 wants to merge 2 commits into
inkonchain:mainfrom
furkan3152:fix/snapshot-redownload

Conversation

@furkan3152

Copy link
Copy Markdown

If bedrock-init fails after the snapshot is fully downloaded (a checksum mismatch, or extraction interrupted by docker compose down), /downloads/snapshot.tar.zst stays in the snapshot_downloads volume. On the next run, aria2c's default auto-file-renaming saves the new download as snapshot.tar.1.zst, and the script goes on to verify and extract the stale snapshot.tar.zst. Once a newer daily snapshot is out, the retry can never pass the checksum (so the README's "retry later" doesn't work without down -v), and each attempt leaves another 250–400 GB archive behind.

This passes --allow-overwrite=true --auto-file-renaming=false to aria2c so the retry replaces the stale file. Downloads that still have a .aria2 control file resume as before.

Reproduced locally with aria2c against the repo's download and verify_sha256_checksum: before, the second run logs File already exists. Renamed to snapshot.tar.1.zst and then SHA256 verification failed; after, the retry downloads in place and the checksum passes. bash -n and shellcheck are clean.

When bedrock-init fails after the archive is on disk (checksum mismatch,
interrupted extraction), the snapshot_downloads volume keeps
/downloads/snapshot.tar.zst. On the next run aria2c's default
auto-file-renaming saves the new download as snapshot.tar.1.zst, and the
script then verifies and extracts the stale snapshot.tar.zst instead.
Once a newer daily snapshot is published the retry can never pass the
checksum, and each attempt leaves another full-size archive behind.

Let aria2c overwrite the target file. Downloads that still have their
.aria2 control file are resumed as before.
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