-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][client] PIP-420: Update the schema ID format #24798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
poorbarcode
approved these changes
Sep 29, 2025
BewareMyPower
approved these changes
Sep 29, 2025
RobertIndie
approved these changes
Sep 29, 2025
Demogorgon314
approved these changes
Sep 29, 2025
codelipenghui
approved these changes
Sep 29, 2025
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #24798 +/- ##
=============================================
+ Coverage 38.36% 74.27% +35.91%
- Complexity 13171 33799 +20628
=============================================
Files 1854 1913 +59
Lines 144870 149163 +4293
Branches 16808 17303 +495
=============================================
+ Hits 55574 110796 +55222
+ Misses 81752 29533 -52219
- Partials 7544 8834 +1290
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lhotari
pushed a commit
that referenced
this pull request
Oct 10, 2025
(cherry picked from commit 9cc15dd)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cherry-picked/branch-4.1
doc-not-needed
Your PR changes do not impact docs
PIP
ready-to-test
release/4.1.2
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.
Motivation
Currently, the Schema ID has two different formats:
This will cause a problem; if users want to use the schema ID in message metadata, they can't distinguish the value schema ID from the key-value schema ID.
Modification
Add a different magic header for the value schema ID and key-value schema ID
value schema ID
magic_byte(-1) + valueSchemaId
key-value schema ID
magic_byte(-2) + keySchemaIdLength(4 bytes) + keySchemaId + valueSchemaIdLength(4 bytes) + valueSchemaId
Breaking change
There is a potential breaking change due to the newly added magic header, but it does not affect the Kafka schema, because the newly added magic header is a negative value, and the most significant bit of binary data is 1.
For the Kafka schema, the current schema ID stored in Pulsar message metadata has two possibilities.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-complete