未验证 提交 52149912 编写于 作者: A Axlgrep 提交者: GitHub

Merge pull request #1097 from YichenXie/fix_info_keyspace_off

fix command info keyspace off
......@@ -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();
}
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册