You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "greatsharp (via GitHub)" <gi...@apache.org> on 2025/03/25 07:46:08 UTC
[I] should clear the migrate info in default case in special case [kvrocks-controller]
greatsharp opened a new issue, #295:
URL: https://github.com/apache/kvrocks-controller/issues/295
https://github.com/apache/kvrocks-controller/blob/e889f364dcd005329edd5ea4071d19b40e9aa13b/controller/cluster.go#L332C1-L333C99
when shard failover, the new master will return empty migration info. it is empty too when kvrocks process reboot.
In these case, controller should clear the old migration info, then user can retry.
https://github.com/apache/kvrocks/blob/d6ea22a69fd86ddb0fedd297a550ce02433d4f83/src/cluster/slot_migrate.cc#L1216C1-L1248C2
`void SlotMigrator::GetMigrationInfo(std::string *info) const {
info->clear();
**_if (!slot_range_.load().IsValid() && !forbidden_slot_range_.load().IsValid() &&
!migrate_failed_slot_range_.load().IsValid()) {
return;
}_**
SlotRange slot_range;
std::string task_state;
switch (migration_state_.load()) {
case MigrationState::kNone:
task_state = "none";
break;
case MigrationState::kStarted:
task_state = "start";
slot_range = slot_range_;
break;
case MigrationState::kSuccess:
task_state = "success";
slot_range = forbidden_slot_range_;
break;
case MigrationState::kFailed:
task_state = "fail";
slot_range = migrate_failed_slot_range_;
break;
default:
break;
}
*info = fmt::format("migrating_slot(s): {}\r\ndestination_node: {}\r\nmigrating_state: {}\r\n", slot_range.String(),
dst_node_, task_state);
}`
--
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: issues-unsubscribe@kvrocks.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] should clear the migrate info in default case [kvrocks-controller]
Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on issue #295:
URL: https://github.com/apache/kvrocks-controller/issues/295#issuecomment-2757129670
@greatsharp You're right, could you please submit a PR to resolve this?
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] should clear the migrate info in default case [kvrocks-controller]
Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk closed issue #295: should clear the migrate info in default case
URL: https://github.com/apache/kvrocks-controller/issues/295
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] should clear the migrate info in default case [kvrocks-controller]
Posted by "greatsharp (via GitHub)" <gi...@apache.org>.
greatsharp commented on issue #295:
URL: https://github.com/apache/kvrocks-controller/issues/295#issuecomment-2759906799
> [@greatsharp](https://github.com/greatsharp) You're right, could you please submit a PR to resolve this?
ok, wait for a moment
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] should clear the migrate info in default case [kvrocks-controller]
Posted by "greatsharp (via GitHub)" <gi...@apache.org>.
greatsharp commented on issue #295:
URL: https://github.com/apache/kvrocks-controller/issues/295#issuecomment-2756965865
BTW, I checked the "CLUSTERX SETNODES" and "CLUSTERX SETSLOT" logic in kvrocks, "CLUSTERX SETNODES" cmd can cover the usage of "CLUSTERX SETNODES" cmd, may be we need to do c.clusterStore.UpdateCluster only, no need to SetSlot in "success" switch case.
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org