执行大hash迭代删key操作,导致tendis节点很快挂掉,且tendis掉线看不到相关日志
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.2k
- Forks
- 343
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 4
Description
def clear_data(redis_key, count=1000, days=7):
timestamp = time.time()
time_date = days * 24 * 3600
for k, v in redis_client.hscan_iter(redis_key, None, count):
data = json.loads(v)
cache_time = data['cache_time']
if int(timestamp) - int(cache_time) > time_date:
redis_client.hdel(redis_key, k)
time.sleep(0.0001)
time.sleep(0.0001)
以下是该节点的相关配置:
port 端口
bind IP
loglevel notice
cluster-enabled yes
logdir ./home/log
dumpdir ./home/dump
dir ./home/db
pidfile ./home/tendisplus.pid
slowlog ./home/log/slowlog
rocks.blockcachemb 2048
rocks.blockcache_strict_capacity_limit false
netiothreadnum 4
executorThreadNum 6
binlog清理相关参数
minbinlogkeepsec 3600
truncateBinlogIntervalMs 1000
truncateBinlogNum 500000
rename-command keys keys_cyt
rename-command flushdb flushdb_cyt
rename-command flushall flushall_cyt
requirepass 密码
masterauth 密码
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with the provided clear_data function, especially hscan_iter, repeated hdel calls, and the sleep intervals. Compare the node behavior with the listed cluster, RocksDB, logging, and binlog settings; done means identifying why the Tendis node exits and why the relevant logs are unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python, redis
- Domain
- backend, databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100