Skip to content

Commit

Permalink
c/controller_api: add more information to backend_operation
Browse files Browse the repository at this point in the history
Added revision, last error and retry count to backend operation. The
information will be used to track partition reconfiguration progress.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
  • Loading branch information
mmaslankaprv committed Apr 25, 2023
1 parent 8f83991 commit 8e01dd0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/v/cluster/controller_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ controller_api::get_reconciliation_state(model::ntp ntp) {
.source_shard = shard,
.p_as = std::move(m.delta.new_assignment),
.type = m.delta.type,
.current_retry = m.retries,
.last_operation_result = m.last_error,
.revision_of_operation = model::revision_id(m.delta.offset),
};
});
}
Expand Down
17 changes: 15 additions & 2 deletions src/v/cluster/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2097,16 +2097,29 @@ struct delete_acls_reply

struct backend_operation
: serde::
envelope<backend_operation, serde::version<0>, serde::compat_version<0>> {
envelope<backend_operation, serde::version<1>, serde::compat_version<0>> {
ss::shard_id source_shard;
partition_assignment p_as;
topic_table_delta::op_type type;

uint64_t current_retry;
cluster::errc last_operation_result;
model::revision_id revision_of_operation;

friend std::ostream& operator<<(std::ostream&, const backend_operation&);

friend bool operator==(const backend_operation&, const backend_operation&)
= default;

auto serde_fields() { return std::tie(source_shard, p_as, type); }
auto serde_fields() {
return std::tie(
source_shard,
p_as,
type,
current_retry,
last_operation_result,
revision_of_operation);
}
};

struct create_data_policy_cmd_data
Expand Down

0 comments on commit 8e01dd0

Please sign in to comment.