diff --git a/src/storage/compact_filter.cc b/src/storage/compact_filter.cc index 91c6751a0a8..5353608eea9 100644 --- a/src/storage/compact_filter.cc +++ b/src/storage/compact_filter.cc @@ -91,7 +91,7 @@ bool SubKeyFilter::IsMetadataExpired(const InternalKey &ikey, const Metadata &me // `util::GetTimeStampMS() - 300000` means extending 5 minutes for expired items, // to prevent them from being recycled once they reach the expiration time. uint64_t lazy_expired_ts = util::GetTimeStampMS() - 300000; - return metadata.Type() == kRedisString // metadata key was overwrite by set command + return metadata.IsSingleKVType() // metadata key was overwrite by set command || metadata.ExpireAt(lazy_expired_ts) || ikey.GetVersion() != metadata.version; } diff --git a/src/storage/iterator.cc b/src/storage/iterator.cc index 12238ceafc2..58e283b165c 100644 --- a/src/storage/iterator.cc +++ b/src/storage/iterator.cc @@ -103,9 +103,8 @@ std::unique_ptr DBIterator::GetSubKeyIterator() const { return nullptr; } - // The string/json type doesn't have sub keys RedisType type = metadata_.Type(); - if (type == kRedisNone || type == kRedisString || type == kRedisJson) { + if (type == kRedisNone || metadata_.IsSingleKVType()) { return nullptr; }