dashjay commented on code in PR #3346:
URL: https://github.com/apache/kvrocks/pull/3346#discussion_r2730134601
##########
src/storage/redis_db.cc:
##########
@@ -584,6 +585,16 @@ rocksdb::Status SubKeyScanner::Scan(engine::Context &ctx,
RedisType type, const
break;
}
InternalKey ikey(iter->key(), storage_->IsSlotIdEncoded());
+ if (type == kRedisHash) {
+ uint64_t expire_at = NoExpireTime;
+ s = GetSubKeyExpireTimestampMS(ctx, user_key, ikey.GetSubKey(),
metadata.version, &expire_at);
+ if (!s.ok() && !s.IsNotFound()) {
+ return s;
+ }
+ if (expire_at != NoExpireTime && expire_at < util::GetTimeStampMS()) {
Review Comment:
a lot expire key in hash may block scanner here
##########
src/storage/redis_db.cc:
##########
@@ -584,6 +585,16 @@ rocksdb::Status SubKeyScanner::Scan(engine::Context &ctx,
RedisType type, const
break;
}
InternalKey ikey(iter->key(), storage_->IsSlotIdEncoded());
+ if (type == kRedisHash) {
+ uint64_t expire_at = NoExpireTime;
+ s = GetSubKeyExpireTimestampMS(ctx, user_key, ikey.GetSubKey(),
metadata.version, &expire_at);
+ if (!s.ok() && !s.IsNotFound()) {
+ return s;
+ }
+ if (expire_at != NoExpireTime && expire_at < util::GetTimeStampMS()) {
Review Comment:
a lot expired key in hash may block scanner here
--
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]