buzz
buzz copied to clipboard
feat(media): add sharded media object-key paths
Why
Media payload keys are currently flat, so high-volume traffic lacks hash-leading S3 prefix entropy. Existing deployments also need a safe, explicit rollout that preserves old reads and rollback behavior without changing storage behavior merely by upgrading.
What
- moves media payloads to
media/<sha[0:2]>/<sha[2:4]>/<community>/<filename>while leaving Git/CAS namespaces unchanged - adds
BUZZ_MEDIA_MIGRATION_PHASEwith three complete media object-key path policies:legacy-only(default): read and write only legacy paths, preserving existing deployment behaviordual-read-and-write: prefer sharded reads with legacy fallback and write both pathssharded-only: read and write only sharded paths
- defines the existing-deployment rollout as
legacy-only→dual-read-and-write→ backfill →sharded-only - recommends that new deployments start with
sharded-onlybefore their first upload, avoiding any future backfill or legacy cleanup - adds sharded-first/legacy-fallback read telemetry, strict bucket classification, logical billing deduplication, duplicate-layout gauges, and authoritative payload keys in upload records
- includes
buzz-media-layout-backfillandbuzz-media-layout-delete-legacyin both relay image targets, with bounded paging, checkpoints, request-rate limiting, idempotency, destination verification, dry-run, and destructive confirmation - documents new-install and existing-deployment flows and provides Kubernetes Job examples
Validation
cargo test -p buzz-media --all-targets: 119 passed; live-MinIO test ignoredcargo test -p buzz-relay --lib config::tests::: 32 passedcargo test -p buzz-relay --lib storage_sweep: 15 passedcargo clippy -p buzz-media -p buzz-relay --all-targets -- -D warnings: cleancargo fmt --all -- --check, desktop Tauri fmt, andgit diff --check: clean- pre-push hooks after merging current
origin/main: Rust, desktop, Tauri, mobile, and typecheck suites passed - Helm values/test YAML and values schema JSON parse cleanly; Helm CLI is unavailable locally
Generated with Goose