The GitHub Actions job "CI" on kvrocks.git has failed.
Run started by GitHub user enjoy-binbin (triggered by enjoy-binbin).

Head commit for run:
91835cfddfe571a6c6f509f0315d7116d118cda2 / Binbin <binloveplay1...@qq.com>
Fix RESTORE check for zset2 object type

Zset2 object type is 5, and we wrongly skipped it,
as a result we cannot recover normal zset data (zset
version 2 is doubles stored in binary):
```
127.0.0.1:6379> zadd key 1.1 a 2.2 b 3.3 c
(integer) 3
127.0.0.1:6379> object encoding key
"skiplist"
127.0.0.1:6379> dump key
"\x05\x03\x01cffffff\n@\x01b\x9a\x99\x99\x99\x99\x99\x01@\x01a\x9a\x99\x99\x99\x99\x99\xf1?\x0b\x00\x15\xae\xd7&\xda\x10\xe1\x03"

127.0.0.1:6666> restore zset 0 
"\x05\x03\x01cffffff\n@\x01b\x9a\x99\x99\x99\x99\x99\x01@\x01a\x9a\x99\x99\x99\x99\x99\xf1?\x0b\x00\x15\xae\xd7&\xda\x10\xe1\x03"
(error) ERR invalid object type: 5
```

After the fix (although it seems we have some precision issues):
```
127.0.0.1:6379> restore zset 0 
"\x05\x03\x01cffffff\n@\x01b\x9a\x99\x99\x99\x99\x99\x01@\x01a\x9a\x99\x99\x99\x99\x99\xf1?\x0b\x00\x15\xae\xd7&\xda\x10\xe1\x03"
OK
127.0.0.1:6379> zrange zset 0 -1 withscores
1) "a"
2) "1.1"
3) "b"
4) "2.2"
5) "c"
6) "3.3"

127.0.0.1:6666> restore zset 0 
"\x05\x03\x01cffffff\n@\x01b\x9a\x99\x99\x99\x99\x99\x01@\x01a\x9a\x99\x99\x99\x99\x99\xf1?\x0b\x00\x15\xae\xd7&\xda\x10\xe1\x03"
OK
127.0.0.1:6666> zrange zset 0 -1 withscores
1) "a"
2) "1.1000000000000001"
3) "b"
4) "2.2000000000000002"
5) "c"
6) "3.2999999999999998"
```

In addition, i updated the error message to mention unsupported
word, this will feel more friendly.

Report URL: https://github.com/apache/kvrocks/actions/runs/6009763298

With regards,
GitHub Actions via GitBox

Reply via email to