Skip to content

Commit

Permalink
Merge pull request redpanda-data#5158 from mmaslankaprv/interrupting-…
Browse files Browse the repository at this point in the history
…partition-movement

Implemented partition movement interruption
  • Loading branch information
mmaslankaprv committed Jul 4, 2022
2 parents 4973a02 + 52fd431 commit 197b12f
Show file tree
Hide file tree
Showing 38 changed files with 1,899 additions and 496 deletions.
20 changes: 19 additions & 1 deletion src/v/cluster/cluster_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,27 @@ inline bool has_non_replicable_op_type(const topic_table_delta& d) {
case op_t::update:
case op_t::update_finished:
case op_t::update_properties:
case op_t::cancel_update:
case op_t::force_abort_update:
return false;
}
__builtin_unreachable();
}

/**
* Subtracts second replica set from the first one. Result contains only brokers
* shards that are present in first replica set but not in the second one.
*/
inline std::vector<model::broker_shard> subtract_replica_sets(
const std::vector<model::broker_shard>& lhs,
const std::vector<model::broker_shard>& rhs) {
std::vector<model::broker_shard> ret;
std::copy_if(
lhs.begin(),
lhs.end(),
std::back_inserter(ret),
[&rhs](const model::broker_shard& bs) {
return std::find(rhs.begin(), rhs.end(), bs) == rhs.end();
});
return ret;
}
} // namespace cluster