Avoid stale lastUpdate cache during prewarm - #85
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesManifest cache prewarming
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @bxclib2, sorry for the delay, I was heads down on v3. Good analysis, and you found the right culprit. The race: v2 deletes the This is fixed in v3.0.0 by inverting the order: I'm happy to ship this in a v2.3.23 too. Your PR helps (the prewarm stops touching |
Summary
Fixes #84.
This changes post-publish cache prewarming so
MarkUpdateAsCheckedwarms the manifest cache for the update that was just checked, instead of resolving "latest" again throughGetLatestUpdateBundlePathForRuntimeVersion.Why
GetLatestUpdateBundlePathForRuntimeVersionreads and writes thelastUpdatecache. Calling it from the post-publish prewarm path can race with stale Redis state and re-cache the previous update after a new update has already been marked checked.That leaves storage/dashboard showing the new update while
/manifestcontinues to serve the old one until the Redis TTL expires or the key is deleted manually.Changes
PreWarmUpdateManifestCache(update, platform)for warming metadata/manifest cache for a known update.MarkUpdateAsCheckedafter writing.check.PreWarmManifestCache(branch, runtimeVersion, platform)for callers that genuinely want to resolve latest.lastUpdate.Test
go test ./...Summary by CodeRabbit
Bug Fixes
Tests