]>
Commit | Line | Data |
---|---|---|
80586cb8 | 1 | # Copy RDB with zipmap encoded hash to server path |
0387e9c1 | 2 | set server_path [tmpdir "server.convert-zipmap-hash-on-load"] |
80586cb8 | 3 | |
0387e9c1 | 4 | exec cp -f tests/assets/hash-zipmap.rdb $server_path |
80586cb8 PN |
5 | start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb"]] { |
6 | test "RDB load zipmap hash: converts to ziplist" { | |
7 | r select 0 | |
8 | ||
9 | assert_match "*ziplist*" [r debug object hash] | |
10 | assert_equal 2 [r hlen hash] | |
11 | assert_match {v1 v2} [r hmget hash f1 f2] | |
12 | } | |
13 | } | |
14 | ||
0387e9c1 | 15 | exec cp -f tests/assets/hash-zipmap.rdb $server_path |
80586cb8 PN |
16 | start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb" "hash-max-ziplist-entries" 1]] { |
17 | test "RDB load zipmap hash: converts to hash table when hash-max-ziplist-entries is exceeded" { | |
18 | r select 0 | |
19 | ||
20 | assert_match "*hashtable*" [r debug object hash] | |
21 | assert_equal 2 [r hlen hash] | |
22 | assert_match {v1 v2} [r hmget hash f1 f2] | |
23 | } | |
24 | } | |
25 | ||
0387e9c1 | 26 | exec cp -f tests/assets/hash-zipmap.rdb $server_path |
80586cb8 PN |
27 | start_server [list overrides [list "dir" $server_path "dbfilename" "hash-zipmap.rdb" "hash-max-ziplist-value" 1]] { |
28 | test "RDB load zipmap hash: converts to hash table when hash-max-ziplist-value is exceeded" { | |
29 | r select 0 | |
30 | ||
31 | assert_match "*hashtable*" [r debug object hash] | |
32 | assert_equal 2 [r hlen hash] | |
33 | assert_match {v1 v2} [r hmget hash f1 f2] | |
34 | } | |
35 | } |