Skip to content

Commit

Permalink
c/st: self_test_result rpc: move {start,end}_time to end of layout
Browse files Browse the repository at this point in the history
Effectively turning the original change into an append and obviating
the need for a compat version bump.

It's not immediately clear why the struct was laid out this way in
the first place. A reasonable guess is some balance of:

- The original ordering makes good sense for the aggregate in-memory
- It's an rpc format and not intended for on-disk persistence

Still, the compat version change means that if a self test goes off
during an upgrade across the compat boundary, that rpc will fail.
Adjusting the layout via envelope::serde_fields means that we can
maintain the nice field order semantics in the aggregate while
ensuring that the diff looks like a field append from serde's view.
  • Loading branch information
oleiman committed Jul 18, 2024
1 parent 1f1f756 commit 3c38672
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/v/cluster/self_test_rpc_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ struct cloudcheck_opts

struct self_test_result
: serde::
envelope<self_test_result, serde::version<1>, serde::compat_version<1>> {
envelope<self_test_result, serde::version<1>, serde::compat_version<0>> {
double p50{0};
double p90{0};
double p99{0};
Expand Down Expand Up @@ -289,6 +289,27 @@ struct self_test_result
r.error ? *r.error : "<no_value>");
return o;
}

auto serde_fields() {
return std::tie(
p50,
p90,
p99,
p999,
max,
rps,
bps,
timeouts,
test_id,
name,
info,
test_type,
duration,
warning,
error,
start_time,
end_time);
}
};

struct empty_request
Expand Down

0 comments on commit 3c38672

Please sign in to comment.