Skip to content

Commit

Permalink
fix exists
Browse files Browse the repository at this point in the history
  • Loading branch information
wangshaoyi committed Jun 19, 2024
1 parent 8d838fc commit 38fdbaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/storage/src/redis_hashes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ Status Redis::HKeys(const Slice& key, std::vector<std::string>* fields) {
Status Redis::HLen(const Slice& key, int32_t* ret, std::string&& prefetch_meta) {
*ret = 0;
Status s;
std::string meta_value = std::move(prefetch_meta);
std::string meta_value(std::move(prefetch_meta));
if (meta_value.empty()) {
BaseMetaKey base_meta_key(key);
s = db_->Get(default_read_options_, handles_[kMetaCF], base_meta_key.Encode(), &meta_value);
Expand Down
2 changes: 1 addition & 1 deletion src/storage/src/redis_strings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ rocksdb::Status Redis::Exists(const Slice& key) {
case DataType::kStreams:
return XRange(key, arg, id_messages, std::move(meta_value));
case DataType::kStrings:
return s;
return ExpectedStale(meta_value) ? rocksdb::Status::NotFound() : rocksdb::Status::OK();
default:
return rocksdb::Status::NotFound();
}
Expand Down

0 comments on commit 38fdbaa

Please sign in to comment.