Skip to content

Releases: HDT3213/rdb

v1.3.2

19 Apr 11:59

Choose a tag to compare

🔥 Hot Key Analysis (-c hotkey) | Hot Key 分析

New hotkey command to find the hottest N keys by LFU frequency from an RDB file.

新增 hotkey 命令,支持从 RDB 文件中按 LFU 频率查找最热的 N 个 Key。

Prerequisites: The Redis instance must be configured with LFU eviction policy (maxmemory-policy allkeys-lfu or volatile-lfu). Otherwise the RDB file does not contain LFU frequency data and the output will be empty.

前提条件:Redis 实例需配置 LFU 淘汰策略(maxmemory-policy allkeys-lfuvolatile-lfu),否则 RDB 中不包含 LFU 频率数据,输出将为空。

rdb -c hotkey -n 50 -o hotkey.csv dump.rdb

Output CSV columns: database, key, type, size, size_readable, freq.

输出 CSV 格式包含:database, key, type, size, size_readable, freq

📊 Separator-based Prefix Analysis (Streaming / Constant Memory) | 基于分隔符的前缀分析(流式/常量内存模式)

New -prefix-sep flag provides a flat-map-based streaming analysis mode for the prefix command. Compared to the original radix tree implementation, this mode uses constant memory regardless of the number of keys, making it suitable for very large RDB files.

新增 -prefix-sep 参数,为 prefix 命令提供基于 flat map 的流式分析模式。相比原有的 radix tree 实现,该模式内存使用量恒定,不随 Key 数量增长,适用于超大 RDB 文件分析。

# Single separator | 单分隔符
rdb -c prefix -prefix-sep : -n 10 -max-depth 3 -o prefix.csv dump.rdb

# Multiple separators (normalized to the first one) | 多分隔符(会统一归一化到第一个分隔符)
rdb -c prefix -prefix-sep : -prefix-sep . -n 10 -o prefix.csv dump.rdb

🗄️ Valkey 9+ (RDB 80) Compatibility | Valkey 9+ (RDB 80) 兼容性支持

  • Support parsing Valkey 9+ RDB files (magic number VALKEY, RDB version 80)

  • Support Valkey-specific typeHash2 encoding (Hash with field-level expiration)

  • Support opCode SlotInfo (244) — Valkey slot metadata, safely skipped during parsing

  • Support opCode SlotImport (243) — Valkey slot import state, safely skipped during parsing

  • Encoder support for writing Valkey Hash2 format

  • 支持解析 Valkey 9+ 的 RDB 文件(magic number VALKEY, RDB version 80)

  • 支持解析 Valkey 特有的 typeHash2 编码(Hash with field-level expiration)

  • 支持 opCode SlotInfo (244) — Valkey slot 元数据,解析时安全跳过

  • 支持 opCode SlotImport (243) — Valkey slot import 状态,解析时安全跳过

  • Encoder 支持 Valkey 格式的 Hash2 写入

📈 LFU/LRU Eviction Metadata Support | LFU/LRU 淘汰策略元数据支持

  • Parse opCodeFreq (249) and opCodeIdle (248) from RDB and store them in the object model

  • model.BaseObject gains IdleTime (LRU idle time) and Freq (LFU frequency) fields

  • New model.EvictionInfo interface with GetIdleTime() and GetFreq() methods

  • JSON output now includes optional lru / lfu fields

  • 解析 RDB 中的 opCodeFreq (249)opCodeIdle (248) 并存入对象模型

  • model.BaseObject 新增 IdleTime(LRU 空闲时间)和 Freq(LFU 频率)字段

  • 新增 model.EvictionInfo 接口,提供 GetIdleTime()GetFreq() 方法

  • JSON 输出中新增 lru / lfu 可选字段

v1.3.1

31 Dec 06:30

Choose a tag to compare

  • fix RDB_OPCODE_FUNCTION issue
  • add -show-global-meta option
  • fixed #59
  • add size filter

v1.3.0

18 Aug 04:19

Choose a tag to compare

Add support for hash with field expiration ( rdb12, Redis 7.4+)

v1.2.0

06 Jul 11:23

Choose a tag to compare

v1.1.1

29 Jun 08:02

Choose a tag to compare

fix a tiny bug #49 of encoder

v1.1.0

18 Mar 00:31

Choose a tag to compare

  • support concurrent json conversion
  • support converting stream data to AOF.

v1.0.18

26 Aug 12:58

Choose a tag to compare

fix encoder bug #38 #40

v1.0.17

20 Aug 00:27

Choose a tag to compare

Upgrade sonic to be compatible with go 1.23

v1.0.16

24 Feb 04:58

Choose a tag to compare

Support Prefix Analysis

v1.0.15

25 Jan 13:12

Choose a tag to compare

bug fix: listpack backlen(#28 #29);
optimize listpack parsing speed