Skip to content

Add BlobId v7 with migration destination bit#3206

Merged
j-tyler merged 3 commits intolinkedin:masterfrom
j-tyler:j-tyler/blob-id-v7-2
Apr 1, 2026
Merged

Add BlobId v7 with migration destination bit#3206
j-tyler merged 3 commits intolinkedin:masterfrom
j-tyler:j-tyler/blob-id-v7-2

Conversation

@j-tyler
Copy link
Copy Markdown
Contributor

@j-tyler j-tyler commented Mar 6, 2026

Summary

BlobId v6 has no field to denote backend identity at write time, which makes migration to a new backend infrastucture ambiguous.

Add BlobId v7 and reserve the top flag bit for migration destination (AMBRY/NON_AMBRY) while keeping v6-style compact UUID encoding. Keep pre-v7 behavior unchanged by defaulting migration metadata to UNKNOWN and reject UNKNOWN for v7 constructors/craft APIs.

Also allow router.blobid.current.version=7 and add coverage for router config bounds, v7 serde, craft behavior, and migration destination validation.

Testing Done

Added new tests to cover all changes.

@j-tyler j-tyler marked this pull request as ready for review March 29, 2026 17:43
j-tyler and others added 3 commits March 29, 2026 10:47
BlobId v6 has no field to denote backend identity at write time, which
makes migration to a new backend infrastucture ambiguous.

Add BlobId v7 and reserve the top flag bit for migration destination
(AMBRY/NON_AMBRY) while keeping v6-style compact UUID encoding. Keep
pre-v7 behavior unchanged by defaulting migration metadata to UNKNOWN and
reject UNKNOWN for v7 constructors/craft APIs.

Also allow router.blobid.current.version=7 and add coverage for router
config bounds, v7 serde, craft behavior, and migration destination
validation.
Add Javadoc to each MigrationDestination enum value, clarifying the
role of UNKNOWN as a sentinel for pre-V7 blob IDs. Fix
testUuidBytesArrayMatchesForSameUuid to pass referenceMigrationDestination
to both blob constructors instead of only one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace direct Base64.decodeBase64() call with the existing
Utils.base64DecodeUrlSafe() utility which provides a fast-path
via Java 8's URL decoder with Apache Commons fallback for legacy data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@j-tyler j-tyler force-pushed the j-tyler/blob-id-v7-2 branch from dca47d9 to bc5cf87 Compare March 29, 2026 17:51
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 93.67089% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.86%. Comparing base (52ba813) to head (bc5cf87).
⚠️ Report is 359 commits behind head on master.

Files with missing lines Patch % Lines
...src/main/java/com/github/ambry/commons/BlobId.java 93.58% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3206      +/-   ##
============================================
+ Coverage     64.24%   69.86%   +5.62%     
- Complexity    10398    12843    +2445     
============================================
  Files           840      930      +90     
  Lines         71755    79222    +7467     
  Branches       8611     9477     +866     
============================================
+ Hits          46099    55349    +9250     
+ Misses        23004    20928    -2076     
- Partials       2652     2945     +293     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@justinlin-linkedin justinlin-linkedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@j-tyler j-tyler merged commit ac92da9 into linkedin:master Apr 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants