PokIsemaine commented on code in PR #2389:
URL: https://github.com/apache/kvrocks/pull/2389#discussion_r1676770850
##########
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:
This also informs the following error handling, considering the case where
the first iter fails and does not update the `current_slot`.
```
```
if (auto s = iter->status(); !s.ok()) {
auto err_str = s.ToString();
LOG(ERROR) << "[migrate] Failed to iterate keys of slot " <<
current_slot << ": " << err_str;
return {Status::NotOK, fmt::format("failed to iterate keys of slot {}:
{}", current_slot, err_str)};
}
```
```
##########
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:
This also informs the following error handling, considering the case where
the first iter fails and does not update the `current_slot`.
```
if (auto s = iter->status(); !s.ok()) {
auto err_str = s.ToString();
LOG(ERROR) << "[migrate] Failed to iterate keys of slot " <<
current_slot << ": " << err_str;
return {Status::NotOK, fmt::format("failed to iterate keys of slot {}:
{}", current_slot, err_str)};
}
```
--
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]