git-hulk commented on code in PR #2389:
URL: https://github.com/apache/kvrocks/pull/2389#discussion_r1676761971
##########
src/cluster/slot_migrate.cc:
##########
@@ -346,6 +351,7 @@ Status SlotMigrator::sendSnapshotByCmd() {
auto iter =
util::UniqueIterator(storage_->GetDB()->NewIterator(read_options, cf_handle));
// Seek to the beginning of keys start with 'prefix' and iterate all these
keys
+ auto current_slot = slot_range.start;
Review Comment:
Seems this assignment can be removed.
##########
src/cluster/slot_migrate.cc:
##########
@@ -74,20 +74,20 @@ SlotMigrator::SlotMigrator(Server *srv)
}
}
-Status SlotMigrator::PerformSlotMigration(const std::string &node_id,
std::string &dst_ip, int dst_port, int slot_id,
- SyncMigrateContext *blocking_ctx) {
+Status SlotMigrator::PerformSlotRangeMigration(const std::string &node_id,
std::string &dst_ip, int dst_port,
+ const SlotRange &slot_range,
SyncMigrateContext *blocking_ctx) {
+ // TODO: concurrent migration, multiple migration jobs
// Only one slot migration job at the same time
- int16_t no_slot = -1;
- if (!migrating_slot_.compare_exchange_strong(no_slot,
static_cast<int16_t>(slot_id))) {
- return {Status::NotOK, "There is already a migrating slot"};
+ SlotRange no_slot_range = {-1, -1};
Review Comment:
no_slot_range => empty_slot_range
--
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]