Anton Agestam created KAFKA-17845:
-------------------------------------
Summary: UpdateRaftVoterResponse has incorrect default value
fallbacks
Key: KAFKA-17845
URL: https://issues.apache.org/jira/browse/KAFKA-17845
Project: Kafka
Issue Type: Bug
Affects Versions: 3.9.0
Reporter: Anton Agestam
This was discovered through property testing for upgrading kio to Kafka
3.9.0-rc2 schema.
We have tests in place to assert that our protocol serializer implementation is
sync with upstream Kafka.
The test discovered a discrepancy between kio and Kafka for this instance:
{code:java}
E instance=UpdateRaftVoterResponse(
E throttle_time=datetime.timedelta(0),
E error_code=<ErrorCode.unknown_server_error: -1>,
E current_leader=CurrentLeader(
E leader_id=-1,
E leader_epoch=-1,
E host='',
E port=0,
E ),
E ), {code}
kio serializes this as `"AAAAAP//AQAO//////////8BAAAAAAA="` while Kafka
serializes it as `"AAAAAP//AA=="` (base 64 encoded bytes).
This is as if the `host` and `port` fields have defaults of empty string and
zero, but they do not.
This looks to me like the behavior for [deserializing a message from a previous
version
|https://github.com/apache/kafka/tree/trunk/clients/src/main/resources/common/message#deserializing-messages]
is incorrectly kicking in here.
I would expect to either see the defaults declared in the schema, or for this
model to not exercise this "omit the nested entity" behavior at all, since all
of the fields of the nested entity do not have default values.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)