Skip to content

feat(blob): distribute blob sidecar keys with reversed binary ids#6060

Merged
Xuanwo merged 1 commit intomainfrom
xuanwo/blob-v2-binary-key-distribution
Mar 2, 2026
Merged

feat(blob): distribute blob sidecar keys with reversed binary ids#6060
Xuanwo merged 1 commit intomainfrom
xuanwo/blob-v2-binary-key-distribution

Conversation

@Xuanwo
Copy link
Collaborator

@Xuanwo Xuanwo commented Feb 28, 2026

This PR accepts suggestion from @jackye1995.

data_file_key already randomizes distribution across data files, but sidecars under a single data file still used sequential-looking names. Reversed-bit binary names improve prefix fan-out for this local sequence without introducing compatibility constraints (this version is unreleased).

  • change blob v2 sidecar file naming from hex ({:08x}) to binary ({:032b})
  • derive the file name from blob_id.reverse_bits() so early sequential IDs spread quickly across object-store key prefixes

Parts of this PR were drafted with assistance from Codex (with gpt-5.3-codex) and fully reviewed and edited by me. I take full responsibility for all changes.

@github-actions github-actions bot added the enhancement New feature or request label Feb 28, 2026
@github-actions
Copy link
Contributor

PR Review: feat(blob): distribute blob sidecar keys with reversed binary ids

No P0 or P1 issues found. This is a clean, well-scoped change.

The approach is sound: reverse_bits() on sequential blob IDs gives good prefix fan-out in binary representation, and the PR correctly notes that this is unreleased so there are no backwards-compatibility concerns.

One minor observation (not blocking):

  • The starts_with("data") guard at cleanup.rs:464 is now subsumed by the stricter matches!(data_dir, Some(dir) if dir.as_ref() == "data") check. The matches! version is strictly better since starts_with("data") would also match hypothetical directories like "database/". You could consider removing the starts_with guard to avoid redundancy, but keeping both as defense-in-depth is also fine.

LGTM.

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Xuanwo Xuanwo merged commit 9147fbd into main Mar 2, 2026
32 checks passed
@Xuanwo Xuanwo deleted the xuanwo/blob-v2-binary-key-distribution branch March 2, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants