Skip to content

Commit

Permalink
cluster: support serde for allocate_id_reply
Browse files Browse the repository at this point in the history
Signed-off-by: Noah Watkins <noah@redpanda.com>
  • Loading branch information
dotnwat committed Jun 7, 2022
1 parent 5445156 commit a411ebe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/v/cluster/tests/serialization_rt_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,4 +524,7 @@ SEASTAR_THREAD_TEST_CASE(serde_reflection_roundtrip) {

roundtrip_test(
cluster::allocate_id_request(model::timeout_clock::duration(234234)));

roundtrip_test(
cluster::allocate_id_reply(23433, cluster::errc::invalid_node_operation));
}
7 changes: 6 additions & 1 deletion src/v/cluster/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@ struct allocate_id_request
auto serde_fields() { return std::tie(timeout); }
};

struct allocate_id_reply {
struct allocate_id_reply
: serde::envelope<allocate_id_reply, serde::version<0>> {
int64_t id;
errc ec;

allocate_id_reply() noexcept = default;

allocate_id_reply(int64_t id, errc ec)
: id(id)
, ec(ec) {}

auto serde_fields() { return std::tie(id, ec); }
};

enum class tx_errc {
Expand Down

0 comments on commit a411ebe

Please sign in to comment.