Skip to content

解析混合aof模式的aof文件报错 #937

Open
@OMG-By

Description

@OMG-By

问题描述(Issue Description)

解析aof文件。如果源实例开启混合aof模式,即:aof-use-rdb-preamble=yes时,redis-shake解析报错。

环境信息(Environment)

  • RedisShake 版本(RedisShake Version):V4
  • Redis 源端版本(Redis Source Version):4.0+
  • Redis 目的端版本(Redis Destination Version):无
  • Redis 部署方式(standalone/cluster/sentinel):standalone
  • 是否在云服务商实例上部署(Deployed on Cloud Provider):

日志信息(Logs)

2025-03-17 15:31:39 ERR Bad File format reading the append only File /data/rdb/aof_test/appendonly.aof_4_0_14:make a backup of your AOF File, then use ./redis-check-AOF --fix <FileName.manifest>
RedisShake/internal/aof/aof.go:123 -> (*Loader).LoadSingleAppendOnlyFile()
RedisShake/internal/reader/aof_reader.go:82 -> (*aofReader).StartRead.func1()
runtime/asm_amd64.s:1695 -> goexit()

其他信息(Additional Information)

使用redis-check-aof工具解析是合法的
./redis-check-aof appendonly.aof_4_0_14
Start checking Old-Style AOF
[offset 0] Checking RDB file appendonly.aof_4_0_14
[offset 27] AUX FIELD redis-ver = '4.0.14'
[offset 41] AUX FIELD redis-bits = '64'
[offset 53] AUX FIELD ctime = '1742196612'
[offset 68] AUX FIELD used-mem = '12532232'
[offset 84] AUX FIELD aof-preamble = '1'
[offset 86] Selecting DB ID 0
[offset 102] Selecting DB ID 1
[offset 369] Checksum OK
[offset 369] \o/ RDB looks OK! \o/
[info] 10 keys read
[info] 0 expires
[info] 0 already expired
RDB preamble is OK, proceeding with AOF tail...
AOF analyzed: filename=appendonly.aof_4_0_14, size=2498, ok_up_to=2498, ok_up_to_line=271, diff=0
AOF appendonly.aof_4_0_14 is valid

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions