Skip to content

Commit

Permalink
fix command info keyspace off
Browse files Browse the repository at this point in the history
  • Loading branch information
RunningXie committed Oct 24, 2021
1 parent a825c9d commit 4937e36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pika_partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ Status Partition::GetKeyNum(std::vector<blackwidow::KeyInfo>* key_info) {
key_scan_info_.duration = -2; // duration -2 mean the task in waiting status,
// has not been scheduled for exec
rocksdb::Status s = db_->GetKeyNum(key_info);
key_scan_info_.key_scaning_ = false;
if (!s.ok()) {
return Status::Corruption(s.ToString());
}
key_scan_info_.key_infos = *key_info;
key_scan_info_.duration = time(NULL) - key_scan_info_.start_time;
key_scan_info_.key_scaning_ = false;
return Status::OK();
}
3 changes: 3 additions & 0 deletions src/pika_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ void Table::RunKeyScan() {
void Table::StopKeyScan() {
slash::RWLock rwl(&partitions_rw_, false);
slash::MutexLock ml(&key_scan_protector_);
if (!key_scan_info_.key_scaning_) {
return;
}
for (const auto& item : partitions_) {
item.second->db()->StopScanKeyNum();
}
Expand Down

0 comments on commit 4937e36

Please sign in to comment.