-
Couldn't load subscription status.
- Fork 47
Cluster Map Implementation #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
boda26
commented
Oct 27, 2025
- Cluster Map Object Implementation
- Refresh ClusterMap at the start of each fanout operation; fanout operations use targets from ClusterMap object
…nout and use targets from cluster map object Signed-off-by: Miles Song <[email protected]>
|
I think that it would be much more efficient if the engine allow subscription to a notification mechanism which is triggered once the slot assignment is changed. @murphyjacob4 , wdyt? |
vmsdk/src/cluster_map.cc
Outdated
| shard.slots_fingerprint = 0; | ||
| new_map->shards_[master_id] = std::move(shard); | ||
| } else { | ||
| it->second.owned_slots.insert(slot_set.begin(), slot_set.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this list of nodes doesn't match the previous set?
vmsdk/src/cluster_map.cc
Outdated
| it->second.owned_slots.insert(slot_set.begin(), slot_set.end()); | ||
| } | ||
| } | ||
| new_map->is_cluster_map_full_ = assigned_slots.all(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are the fingerprints for each shard being computed?
| if (owned_count > 0) { | ||
| std::string owned_ranges; | ||
| int range_start = -1; | ||
| int range_end = -1; | ||
| for (size_t i = 0; i < k_num_slots; i++) { | ||
| if (map->owned_slots_[i]) { | ||
| if (range_start == -1) { | ||
| range_start = i; | ||
| range_end = i; | ||
| } else if (i == range_end + 1) { | ||
| range_end = i; | ||
| } else { | ||
| if (!owned_ranges.empty()) owned_ranges += ", "; | ||
| owned_ranges += | ||
| std::to_string(range_start) + "-" + std::to_string(range_end); | ||
| range_start = i; | ||
| range_end = i; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not save the slot ranges as they came in originally?
Signed-off-by: Miles Song <[email protected]>
|
Updated ClusterMap Implementation (significant change)
|
|
Todo: create a SocketAddress struct for ip and port |