Skip to content

fix: use DownloadObject to avoid transfer manager concurrentReader panic#29

Merged
bdchatham merged 1 commit intomainfrom
fix-transfer-manager-panic
Mar 16, 2026
Merged

fix: use DownloadObject to avoid transfer manager concurrentReader panic#29
bdchatham merged 1 commit intomainfrom
fix-transfer-manager-panic

Conversation

@bdchatham
Copy link
Contributor

@bdchatham bdchatham commented Mar 15, 2026

Summary

  • The transfer manager GetObject streaming API uses a concurrentReader that has a bounds-check bug in v0.1.x, causing panics during large S3 snapshot downloads: slice bounds out of range [30775:12064]
  • Switches to DownloadObject (io.WriterAt path) which downloads byte-range chunks in parallel to a temp file, then streams through gzip+tar extraction — same throughput, no concurrentReader involvement
  • Consolidates on a single S3TransferClient interface (just DownloadObject) for snapshot restore; moves S3GetObjectAPI/S3ClientFactory to genesis.go (the only remaining consumer)
  • Upgrades all aws-sdk-go-v2 modules to latest (transfer manager v0.1.7 → v0.1.10)
  • Adds a writeAtBuffer helper for downloading small files (e.g. latest.txt) in-memory via DownloadObject
  • Adds a new test verifying temp file cleanup after restore

Test plan

  • All existing snapshot tests pass with the new mock (DownloadObject-based)
  • New TestSnapshotRestoreCleansUpTempFile validates no leftover temp files
  • golangci-lint and gofmt clean
  • Deploy to brandon cluster and verify replayer node restores snapshot without panic

…r panic

The transfer manager GetObject streaming API (concurrentReader) has a
bounds-check bug in v0.1.x that causes a panic during large S3 downloads.
Switch to DownloadObject (io.WriterAt path) which downloads byte-range
chunks in parallel to a temp file, then streams extraction from disk.

Also upgrades aws-sdk-go-v2 modules to latest and moves S3GetObjectAPI
types to genesis.go (the only remaining consumer).
@bdchatham bdchatham marked this pull request as ready for review March 15, 2026 23:13
@bdchatham bdchatham merged commit 469a035 into main Mar 16, 2026
2 checks passed
@bdchatham bdchatham deleted the fix-transfer-manager-panic branch March 16, 2026 01:24
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