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

feat: support cmd persist #214

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

happy-v587
Copy link
Contributor

issue: #30

@github-actions github-actions bot added the ✏️ Feature New feature or request label Mar 17, 2024
src/cmd_keys.cc Outdated
if (res != -1) {
client->AppendInteger(res);
if (res > -1) {
client->AppendInteger(res == 0 ? 0 : 1);
Copy link
Contributor Author

@happy-v587 happy-v587 Mar 17, 2024

Choose a reason for hiding this comment

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

res有可能大于1,但redis不会出现。如果我们返回值大于1,会导致go-redis处理结果不正确。
image

返回值可能大于1的原因是因为我们支持同名key存储到不同datatype导致。

Copy link
Collaborator

Choose a reason for hiding this comment

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

目前Pikiwidb是不兼容的,因为允许同名key的原因,但是最近群里在讨论如何静止同名key存在,到时候就不会有这个问题了。
因此个人建议:1.增加注释,在相关pr合入后方便理解这块的代码。2.直接返回,在相关pr合并后应该就没有兼容性的问题了。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

多谢评审。既然已经开始讨论同名key禁止问题的处理,那么就保持现状吧,我将改动回滚。因为persist也存在这个问题,我将其保持一致。

@AlexStocks AlexStocks merged commit 6c6eb71 into OpenAtomFoundation:unstable Mar 18, 2024
5 checks passed
@happy-v587 happy-v587 deleted the feat-persist branch March 18, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✏️ Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants