diff --git a/src/common/replication_other_types.h b/src/common/replication_other_types.h index 74ab01742d..72210b6198 100644 --- a/src/common/replication_other_types.h +++ b/src/common/replication_other_types.h @@ -36,6 +36,7 @@ #include "consensus_types.h" #include "replica_admin_types.h" #include "common/replication_enums.h" +#include "runtime/rpc/dns_resolver.h" #include "runtime/rpc/rpc_address.h" #include "runtime/rpc/rpc_host_port.h" @@ -79,17 +80,24 @@ inline bool is_partition_config_equal(const partition_configuration &pc1, const partition_configuration &pc2) { // secondaries no need to be same order - for (const auto &hp : pc1.hp_secondaries1) { - if (!is_secondary(pc2, hp)) { + std::vector pc1_secondaries; + GET_HOST_PORTS(pc1, secondaries1, pc1_secondaries); + for (const auto &pc1_secondary : pc1_secondaries) { + if (!is_secondary(pc2, pc1_secondary)) { return false; } } + // last_drops is not considered into equality check + host_port pc1_primary; + GET_HOST_PORT(pc1, primary1, pc1_primary); + host_port pc2_primary; + GET_HOST_PORT(pc2, primary1, pc2_primary); + std::vector pc2_secondaries; + GET_HOST_PORTS(pc2, secondaries1, pc2_secondaries); return pc1.ballot == pc2.ballot && pc1.pid == pc2.pid && - pc1.max_replica_count == pc2.max_replica_count && pc1.primary1 == pc2.primary1 && - pc1.hp_primary1 == pc2.hp_primary1 && - pc1.secondaries1.size() == pc2.secondaries1.size() && - pc1.hp_secondaries1.size() == pc2.hp_secondaries1.size() && + pc1.max_replica_count == pc2.max_replica_count && pc1_primary == pc2_primary && + pc1_secondaries.size() == pc2_secondaries.size() && pc1.last_committed_decree == pc2.last_committed_decree; }