-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix:Type Command Expired Key Consistency #3132
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1514,6 +1514,16 @@ Status Storage::GetType(const std::string& key, enum DataType& type) { | |
| return Status::OK(); | ||
| } | ||
|
|
||
| Status Storage::Type(const std::string& key, std::vector<std::string>& types) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里为什么要新增加一个Type,不可以直接用之前的GetType接口吗
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 因为 rocksdb::Status Type() 这个接口在头文件里一直存在,并且已经被大量外部模块(如 pika_migrate、pika_cache、rsync_client 等)调用,它返回的是 Redis 协议要求的字符串类型(如 “string” / “hash”),而旧的 GetType()函数 只返回内部枚举 DataType。
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 防御性编程,先删去了。 |
||
| types.clear(); | ||
| DataType type; | ||
| Status s = GetType(key, type); | ||
| if (s.ok()) { | ||
| types.push_back(DataTypeToString(type)); | ||
| } | ||
| return s; | ||
| } | ||
|
|
||
| Status Storage::Keys(const DataType& data_type, const std::string& pattern, std::vector<std::string>* keys) { | ||
| keys->clear(); | ||
| std::vector<DataType> types; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释修改成英文
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done