feat(media): add configurable sharded writes - #4017
Closed
bradseiler wants to merge 2 commits into
Closed
Conversation
bradseiler
force-pushed
the
seiler/media-upload-record-keys
branch
from
July 31, 2026 23:43
aae4515 to
106166b
Compare
added 2 commits
July 31, 2026 19:43
Co-authored-by: npub128x7j3pwgm4vs8yra3c42fcgcwcvh94g3luwzkqa376du2q6l0esqcrwch <51cde9442e46eac81c83ec71552708c3b0cb96a88ff8e1581d8fb4de281afbf3@buzz.block.builderlab.xyz> Signed-off-by: npub128x7j3pwgm4vs8yra3c42fcgcwcvh94g3luwzkqa376du2q6l0esqcrwch <51cde9442e46eac81c83ec71552708c3b0cb96a88ff8e1581d8fb4de281afbf3@buzz.block.builderlab.xyz>
Keep self-hosted upgrades on legacy writes by default, expose the write-layout gate through Helm and Compose, and document the explicit legacy-to-dual-to-sharded migration sequence. Co-authored-by: npub128x7j3pwgm4vs8yra3c42fcgcwcvh94g3luwzkqa376du2q6l0esqcrwch <51cde9442e46eac81c83ec71552708c3b0cb96a88ff8e1581d8fb4de281afbf3@buzz.block.builderlab.xyz> Signed-off-by: npub128x7j3pwgm4vs8yra3c42fcgcwcvh94g3luwzkqa376du2q6l0esqcrwch <51cde9442e46eac81c83ec71552708c3b0cb96a88ff8e1581d8fb4de281afbf3@buzz.block.builderlab.xyz>
bradseiler
force-pushed
the
seiler/media-sharded-writes
branch
from
July 31, 2026 23:47
90b6980 to
6e231f7
Compare
Author
|
Superseded by consolidated PR #4533, which includes the full phased read/write policy and Kubernetes-runnable backfill and legacy-deletion tools. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
BUZZ_MEDIA_KEY_LAYOUT=legacy|dual|shardedand route image, file, video, and thumbnail writes through the hash-leading community layout.The upgrade-safe default remains
legacy: existing and self-hosted deployments continue flat-only writes and do not start double-writing merely by upgrading. The ENV setting is exposed in the root and production Compose examples and as Helmrelay.mediaKeyLayout; the chart validates all three stages. The Helm documentation now gives the explicitlegacy → dual → shardedmigration and rollback constraints.Dual mode writes the sharded primary before the flat rollback copy, and sidecars publish only after both succeed.
Related issue
Stacked on #4016 and #4015; requested in the linked Buzz channel thread.
Testing
bin/cargo test -p buzz-media(115 passed, 1 live-MinIO test ignored)bin/cargo test -p buzz-relay --lib storage_sweep::tests(15 passed)bin/cargo clippy -p buzz-media -p buzz-relay --all-targets -- -D warningsbin/cargo fmt --checkRollout
BUZZ_MEDIA_KEY_LAYOUTunset orlegacy; all writes remain flat while compatibility readers deploy everywhere.dual, monitor read-resolution/fallback and duplicate-layout metrics, and backfill/reconcile.sharded.Never roll a sharded-only writer back to a pre-#4015 binary. Returning
sharded → dualdoes not itself recreate missing flat copies; verify backfill before relying on an old-version rollback.