locator: topology: Fix move assignment

Defaulted assignment doesn't update node::_topology.
This commit is contained in:
Tomasz Grabiec
2023-04-20 23:38:21 +02:00
parent 6ed841b8d7
commit 0ec700cd00
3 changed files with 38 additions and 1 deletions

View File

@@ -99,6 +99,14 @@ topology::topology(topology&& o) noexcept
}
}
topology& topology::operator=(topology&& o) noexcept {
if (this != &o) {
this->~topology();
new (this) topology(std::move(o));
}
return *this;
}
future<topology> topology::clone_gently() const {
topology ret(_cfg);
tlogger.debug("topology[{}]: clone_gently to {} from shard {}", fmt::ptr(this), fmt::ptr(&ret), _shard);

View File

@@ -111,11 +111,13 @@ public:
inet_address this_endpoint;
endpoint_dc_rack local_dc_rack;
bool disable_proximity_sorting = false;
bool operator==(const config&) const = default;
};
topology(config cfg);
topology(topology&&) noexcept;
topology& operator=(topology&&) = default;
topology& operator=(topology&&) noexcept;
future<topology> clone_gently() const;
future<> clear_gently() noexcept;