fix: ensure ZADD keeps the last score for duplicate members in a single command to align with Redis behavior#3137
Conversation
…mmand to align with Redis behavior
|
Warning Rate limit exceeded@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 7 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…le command to align with Redis behavior (OpenAtomFoundation#3137) * ensure ZADD keeps the last score for duplicate members in a single command to align with Redis behavior --------- Co-authored-by: wuxianrong <[email protected]>
修复bug #3078 : 修正 pika 中 zadd 命令在单行多次添加同一 member 时与 Redis 行为不一致的问题
问题重现
执行zadd key score1 member1 score2 member1返回score1的原因
在 src/storage/src/redis_zsets.cc 文件中,RedisZSets::ZAdd 函数存在问题:源代码在这里是从前往后读取score_members数组的,导致与src/pika_cache.cc中的PikaCache::ZAddIfKeyExist函数的从后往前读取score_members数组冲突,程序未能读取到正确的缓存数据。
修改文件部分