Skip to content

Commit

Permalink
k/group: do not serialize key iobuf as iobuf
Browse files Browse the repository at this point in the history
When serialized a key is already an iobuf. Wrapping it with another
serialization layer is incorrect as it introduces additional size field
in the binary format that deserializer doesn't expect.

Signed-off-by: Michal Maslanka <michal@vectorized.io>
  • Loading branch information
mmaslankaprv committed Jun 1, 2022
1 parent d32ac70 commit 412dbcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/v/kafka/server/group.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2393,7 +2393,7 @@ void add_offset_tombstone_record(
.partition = tp.partition,
};
auto kv = serializer.to_kv(offset_metadata_kv{.key = std::move(key)});
builder.add_raw_kv(reflection::to_iobuf(std::move(kv.key)), std::nullopt);
builder.add_raw_kv(std::move(kv.key), std::nullopt);
}

void add_group_tombstone_record(
Expand All @@ -2404,7 +2404,7 @@ void add_group_tombstone_record(
.group_id = group,
};
auto kv = serializer.to_kv(group_metadata_kv{.key = std::move(key)});
builder.add_raw_kv(reflection::to_iobuf(std::move(kv.key)), std::nullopt);
builder.add_raw_kv(std::move(kv.key), std::nullopt);
}
} // namespace

Expand Down

0 comments on commit 412dbcd

Please sign in to comment.