caipengbo commented on code in PR #1414:
URL:
https://github.com/apache/incubator-kvrocks/pull/1414#discussion_r1185656370
##########
src/cluster/cluster.cc:
##########
@@ -93,32 +83,27 @@ Status Cluster::SetNodeId(const std::string &node_id) {
return Status::OK();
}
-// Set the slot to the node if new version is current version +1. It is useful
-// when we scale cluster avoid too many big messages, since we only update one
-// slot distribution and there are 16384 slot in our design.
-//
+// Set the slots to the node if new version is current version +1. It is useful
+// when we scale cluster avoid too many big messages. By th way,there are
16384 slots
+// in our design.
// The reason why the new version MUST be +1 of current version is that,
// the command changes topology based on specific topology (also means specific
// version), we must guarantee current topology is exactly expected, otherwise,
// this update may make topology corrupt, so base topology version is very
important.
// This is different with CLUSTERX SETNODES commands because it uses new
version
// topology to cover current version, it allows kvrocks nodes lost some
topology
// updates since of network failure, it is state instead of operation.
-Status Cluster::SetSlot(int slot, const std::string &node_id, int64_t
new_version) {
- // Parameters check
+Status Cluster::SetSlotRanges(const std::vector<std::pair<int, int>>
&slot_ranges, const std::string &node_id,
Review Comment:
Personally, I think it's better to use alias declaration(Like `using
SlotRange = std::pair<int, int>` ) or struct, because I see `std::pair<int,
int>` appear 6 times.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]