rmt_redis.c:6446 エラー: RDB 形式のバージョンを処理できません redis-merge-tool 移行ツールがエラーを報告します

目次

質問:

redis-merge-tool を使用すると、次のエラーがスローされる可能性があります

理由:

解決:

1. Redisのバージョンを下げる

2. redis-merge-tool ソースコードを変更した後に再コンパイルします。

知らせ

住所が変わった場合に備えて、これまでの住所を以下に記載します


質問:

redis-merge-tool を使用すると、次のエラーがスローされる可能性があります

[2019-10-18 04:05:49.267] rmt_redis.c:6446 ERROR: Can't handle RDB format version 839003080
[2019-10-18 04:05:49.267] rmt_redis.c:6715 ERROR: Rdb file for node[127.0.0.1:7002@17002] parsed failed

理由:

redis-merge-tool 移行ツールは rdb7 バージョンまでサポートしていますが、使用している redis で生成された rdb バージョンが 7 を超えています。たとえば、redis5.0 を使用しています。

解決:

1. Redisのバージョンを下げる

2. redis-merge-tool ソースコードを変更した後に再コンパイルします。

rmt_redis.cファイルを変更し  、7 を 10 以上に変更します。

/* ========================== Redis RDB ============================ */
/* The current RDB version. When the format changes in a way that is no longer
 * backward compatible this number gets incremented. */
#define REDIS_RDB_VERSION 7   ###修改这行,将7改为10或者更高

知らせ

Redis の高度な機能が Redis で使用されていないことを確認する必要があります。高度な機能は次のアドレスを参照できます。

https://github.com/sripathikrishnan/redis-rdb-tools/blob/master/docs/RDB_Version_History.textile

住所が変わった場合に備えて、これまでの住所を以下に記載します

 


Redis RDB Version History
This document tracks the changes made to the dump file format over time.

Redis dump file is 100% backwards compatible. An older dump file format will always work with a newer version of Redis.

Version 9 - redis 5.0
The following additions have been made :

New Streams data type
The RDB can contain LRU or LFU of the keys
The RDB can contain Module AUX fields
Version 8 - redis 4.0
The following additions have been made :

New Modules data types
Sorted sets store binary double values instead of strings
Version 7 - redis 3.2
The following additions have been made :

New QuickList encoding
New AUX fields with metadata
New DBSIZE opcode
Version 6 - redis 2.8
In previous versions, ziplists used a variable length encoding scheme for integers.
Integers were stored in 16, 32 or 64 bits. In this version, this variable length
encoding system has been extended.

The following additions have been made :

Integers 0 through 12, both inclusive, are now encoded as part of the entry header
Numbers between -128 and 127, both inclusive, are stored in 1 byte
Numbers between -2^23 and 2^23 -1, both inclusive, are stored in 3 bytes
Issue ID : https://github.com/antirez/redis/issues/469

To migrate to version 5 :

In redis.conf, set list-max-ziplist-entries to 0
Restart Redis Server, and issue the SAVE command
Edit the dump.rdb file, and change the rdb version in the header to REDIS0005
Version 5 - redis 2.4
This version introduced an 8 byte checksum (CRC-32) at the end of the file. If checksum is disabled in redis.conf,
the last 8 bytes will be zeroes.

Issue ID : https://github.com/antirez/redis/issues/366

To migrate to version 4 -

Delete the last 8 bytes of the file (i.e. after the byte 0xFF)
Change the rdb version in the header to REDIS0004
Version 4
This version introduced a new encoding for hashmaps - “Hashmaps encoded as Zip Lists”. This version also deprecates
the Zipmap encoding that was used in previous versions.

“Hashmaps encoded as ziplists” has encoding type = 13. The value is parsed like a ziplist, and adjacent entries
in the list are considered key=value pairs in the hashmap.

Issue ID : https://github.com/antirez/redis/pull/285

To migrate to version 3 -

In redis.conf, set hash-max-ziplist-entries to 0
Restart Redis Server, and issue the SAVE command
Edit the dump.rdb file, and change the rdb version in the header to REDIS0003
Version 3
This version introduced key expiry with millisecond precision.

Earlier versions stored key expiry in the format 0xFD <4 byte timestamp>. In version 3, key expiry is stored as
0xFC <8 byte timestamp>. Here, 0xFD and 0xFC are the opcodes to indicate key expiry in seconds and milliseconds respectively.

Issue ID : https://github.com/antirez/redis/issues/169

To migrate to version 2 -

If you don’t use key expiry, simply change the version in the header to REDIS0002
If you use key expiry, you can still migrate, but there will be some loss in expiry precision. Also, the migration is a bit involved.
For each key=value pair in the dump file, you will have to convert 0xFC <8 byte timestamp> to 0xFD <4 byte timestamp>.
After converting the timestamps, change the version in the header to REDIS0002
Version 2
This version introduced special encoding for small hashmaps, lists and sets.

Specifically, it introduced the following encoding types -

REDIS_RDB_TYPE_HASH_ZIPMAP = 9
REDIS_RDB_TYPE_LIST_ZIPLIST = 10
REDIS_RDB_TYPE_SET_INTSET = 11
REDIS_RDB_TYPE_ZSET_ZIPLIST = 12
1
2
3
4
Commit : https://github.com/antirez/redis/commit/6b52ad87c05ca2162a2d21f1f5b5329bf52a7678

To migrate to version 1 -

In redis.conf, set the following properties to 0 hash-max-zipmap-entries, list-max-ziplist-entries, set-max-intset-entries, zset-max-ziplist-entries
Restart Redis, and issue the SAVE command
Edit the dump.rdb file, and change the rdb version in the header to REDIS0001 

 

おすすめ

転載: blog.csdn.net/qq_39706515/article/details/130825616