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:cache bug && add cache test #2225

Merged
merged 13 commits into from
Dec 25, 2023

Conversation

chejinge
Copy link
Collaborator

@chejinge chejinge commented Dec 20, 2023

#2204
#2231

主要修复cache zset及 string类型多type考虑不周的一些bug

zset暂时不走cache的那些命令的原因是 pika 做了开闭区间的判断,而redis这个版本没有,需要对rediscache版本升级后使用

修复bug包括:
1.暂时对 zset命令 ZRangebylexCmd、ZRevrangebylexCmd、ZLexcountCmd停止使用cache,避免出现开闭区间不兼容问题,待rediscache升级至支持版本后更新

2.修复mget类型数据未对TTL赋值,可能导致原key的TTL被覆盖的问题,同时,本次修改 mget每次获取一个key的时候可以从cache中查,如果是多个key需要从db中读取,因为没有办法保证每一个key都在cache中,可能会查出的数据不完整。

3.修复 zrange命令因为跳表转换为ziplist导致数据格式不兼容 多次zrange 的结果不一致 的问题

4.修复 exists expire pexpire expireat pexpireat ttl pttl persist type 多种 数据结构只操作一种的问题

5.exists只访问一个key 的时候操作cache,访问多个 key的时候操作db,因为不确定所有的key都在cache中。

6.修复blopop命令 因为使用错误status导致 返回值异常问题,bit类型数据暂时先不用cache后面统一修改

7.修复锁使用范围不对的问题 PikaCacheLoadThread::LoadKey pstd::lock::ScopeRecordLock record_lock(slot->LockMgr(), key);

8 HGETall hvals当前redis版本与pika参数不兼容待升级版本后继续修复

9 修复DoCommand访问Rocksdb时,需要对key进行加锁,保证操作rocksdb和cache是原子的

@github-actions github-actions bot added the ☢️ Bug Something isn't working label Dec 20, 2023
@chejinge chejinge changed the title fix:cache bug fix:cache bug && add cache test Dec 20, 2023
@github-actions github-actions bot added ✏️ Feature New feature or request 🧹 Updates This will not be worked on labels Dec 21, 2023
@AlexStocks AlexStocks merged commit 04491d2 into OpenAtomFoundation:unstable Dec 25, 2023
15 checks passed
@chejinge chejinge deleted the fix_cache_bug branch January 29, 2024 07:12
bigdaronlee163 pushed a commit to bigdaronlee163/pika that referenced this pull request Jun 8, 2024
* fix:cache bug

* add cache test

* fix hash

* fix

* fix init ttl

* fix init

* change lock

* fix mget with ttl

* fix mget && add cache test

* delete log

* fix bitpop

* fix flag

* fix bitpop

---------

Co-authored-by: chejinge <[email protected]>
cheniujh pushed a commit to cheniujh/pika that referenced this pull request Sep 24, 2024
* fix:cache bug

* add cache test

* fix hash

* fix

* fix init ttl

* fix init

* change lock

* fix mget with ttl

* fix mget && add cache test

* delete log

* fix bitpop

* fix flag

* fix bitpop

---------

Co-authored-by: chejinge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.5.3 ☢️ Bug Something isn't working ✏️ Feature New feature or request 🧹 Updates This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants