1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00

fix: prevent starting migrations from replica (#3985)

This commit is contained in:
Borys 2024-10-25 08:41:26 +03:00 committed by GitHub
parent 79963f9a10
commit 0a62f6b6ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,9 @@ shared_ptr<ClusterConfig> ClusterConfig::CreateFromConfig(string_view my_id,
[&](const ClusterNodeInfo& node) { return node.id == my_id; });
if (owned_by_me) {
result->my_slots_.Set(shard.slot_ranges, true);
result->my_outgoing_migrations_ = shard.migrations;
if (shard.master.id == my_id) {
result->my_outgoing_migrations_ = shard.migrations;
}
} else {
for (const auto& m : shard.migrations) {
if (my_id == m.node_info.id) {