forked from apache/kafka
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KAFKA-18199; Fix size calculation for nullable tagged structs (apache…
…#18127) When a struct field is tagged and nullable, it is serialized as { varint tag; varint dataLength; nullable data }, where nullable is serialized as { varint isNotNull; if (isNotNull) struct s; }. The length field includes the is-not-null varint. This patch fixes a bug in serialization where the written value of the length field and the value used to compute the size of the length field differs by 1. In practice this has no impact unless the serialized length of the struct is 127 bytes, since the varint encodings of 127 and 128 have different lengths (0x7f vs 0x80 01). Reviewers: David Jacot <[email protected]>
- Loading branch information
1 parent
770d64d
commit b94defa
Showing
3 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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