Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the inconsistent response behavior with Redis in memory usage command #1539

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Jul 4, 2023

This fixes #1538

@git-hulk git-hulk requested review from torwig and PragmaTwice July 4, 2023 15:29
@mapleFU
Copy link
Member

mapleFU commented Jul 4, 2023

Seems that when key not found or expired, Database::Type(const Slice &user_key, RedisType *type) would return kRedisNone, and get Disk::GetKeySize with kRedisNone would raise not found rather than return Nil?

(It's interesting that "type" fixed it in another patch: 3cea045 )

Copy link
Member

@mapleFU mapleFU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch LGTM. I also checked all place using Database::Type, they're:

  1. Set::Move
  2. List::RPopLPush
  3. CommandDisk::Execute
  4. CommandType::Execute

Seems they have all been handled after this patch

PragmaTwice
PragmaTwice previously approved these changes Jul 4, 2023
@tisonkun
Copy link
Member

tisonkun commented Jul 5, 2023

Merging...

Thanks for the quick fix :D

@tisonkun tisonkun merged commit fbdc8ad into apache:unstable Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running the memory usage command against a non-existent key resulted in an error
6 participants