fix(ingest): send Content-Length on S3 PUTs so the WAL heartbeat lands - #936
Conversation
hyper omits Content-Length: 0 for an empty body and S3 answers that PUT with 411 MissingContentLength. The owner heartbeat is an empty PUT, so it has failed every minute since the S3 tier reached prod: no owner object ever existed, no dead task was ever seen as stale, and every shipped segment sat unclaimed until the 7-day lifecycle deleted it. The fake S3 now refuses a PUT without Content-Length, as S3 does, and a new test covers heartbeat -> stale owner discovery.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds explicit ChangesS3 and WAL heartbeat
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The change correctly supplies Content-Length for heartbeat PUTs and tests owner creation and stale detection. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 Clippy (1.98.0)Clippy execution failed Comment |
What
The WAL owner heartbeat is an empty-body S3 PUT. hyper does not write
Content-Length: 0for an empty body, and S3 rejects that request with411 MissingContentLength. Every task has logged "Failed to refresh the WAL owner heartbeat" once a minute since the S3 tier reached prod on 2026-09-04.Consequence: no
owners/<uuid>object ever existed, sostale_ownerswas always empty,recover_orphansnever claimed anything, and segments shipped by a dying task sat undersegments/<dead-owner>/until the 7-day lifecycle deleted them. The 2026-09-18 05:47 task deaths lost their backlog this way.Fix
S3Client::putsetscontent-lengthexplicitly (signed with the rest of the headers).Content-Lengthwith 411, like S3 does. That is why the suite was green.a_heartbeat_lands_and_makes_its_owner_claimable_once_stale. I confirmed it fails without the fix.Why now
This is the first step of moving the gateway to EC2 with its WAL on instance-store NVMe. Instance store is wiped when an instance is replaced, so the S3 tier has to work before the WAL moves there.
Verify after deploy
wal/v1/owners/in the WAL bucket holds one object per running task.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit