Repository navigation
Closed
Description
I am testing out new RedisJson2 on my clustered Redis setup (on same host in WSL). While it does what it says (Setting and Getting JSON), I am having a difficult time in understanding the size of keys and or a given path.
As per docs , https://oss.redis.com/redisjson/ram/ , when I do the following SET and JSON.DEBUG MEMORY operations, it returns blank.
Example (as per docs):
127.0.0.1:6379> JSON.SET emptystring . '""'
OK
127.0.0.1:6379> JSON.DEBUG MEMORY emptystring
(integer) 24
127.0.0.1:6379> JSON.SET foo . '"bar"'
OK
127.0.0.1:6379> JSON.DEBUG MEMORY foo
(integer) 27
127.0.0.1:6379> JSON.SET arr . '[]'
OK
127.0.0.1:6379> JSON.DEBUG MEMORY arr
(integer) 32
127.0.0.1:6379> JSON.SET obj . '{}'
OK
127.0.0.1:6379> JSON.DEBUG MEMORY obj
(integer) 32
127.0.0.1:6379> JSON.SET arr . '["", "", "", ""]'
OK
127.0.0.1:6379> JSON.DEBUG MEMORY arr
(integer) 152
127.0.0.1:6379> JSON.SET arr . '["", "", "", "", ""]'
OK
127.0.0.1:6379> JSON.DEBUG MEMORY arr
(integer) 208
On My local cluster:
127.0.0.1:7001> JSON.SET emptystring . '""'
-> Redirected to slot [7909] located at 127.0.0.1:7002
OK
127.0.0.1:7002> JSON.DEBUG MEMORY emptystring
-> Redirected to slot [5099] located at 127.0.0.1:7001
(integer) 0
127.0.0.1:7001> JSON.SET foo . '"bar"'
-> Redirected to slot [12182] located at 127.0.0.1:7003
OK
127.0.0.1:7003> JSON.DEBUG MEMORY foo
-> Redirected to slot [5099] located at 127.0.0.1:7001
(integer) 0
127.0.0.1:7001> JSON.SET arr . '[]'
-> Redirected to slot [7349] located at 127.0.0.1:7002
OK
127.0.0.1:7002> JSON.DEBUG MEMORY arr
-> Redirected to slot [5099] located at 127.0.0.1:7001
(integer) 0
127.0.0.1:7001> JSON.SET obj . '{}'
-> Redirected to slot [6142] located at 127.0.0.1:7002
OK
127.0.0.1:7002> JSON.DEBUG MEMORY obj
-> Redirected to slot [5099] located at 127.0.0.1:7001
(integer) 0
127.0.0.1:7001> JSON.SET arr . '["", "", "", ""]'
-> Redirected to slot [7349] located at 127.0.0.1:7002
OK
127.0.0.1:7002> JSON.DEBUG MEMORY arr
-> Redirected to slot [5099] located at 127.0.0.1:7001
(integer) 0
127.0.0.1:7001> JSON.SET arr . '["", "", "", "", ""]'
-> Redirected to slot [7349] located at 127.0.0.1:7002
OK
127.0.0.1:7002> JSON.DEBUG MEMORY arr
-> Redirected to slot [5099] located at 127.0.0.1:7001
(integer) 0
127.0.0.1:7001>
Here are more details :
WSL Instance Details
ikevinshah@PC:~$
ikevinshah@PC:~$ redis-server --version
Redis server v=6.2.6 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=5f53a4e8cad013f0
ikevinshah@PC:~$
ikevinshah@PC:~$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
ikevinshah@PC:~$
Redis Details
127.0.0.1:7001>
127.0.0.1:7001> CLUSTER NODES
1997bd5644d878a07547b52417088c98fdfcab03 127.0.0.1:7003@17003 master - 0 1637376921574 37 connected 10923-16383
de424ef718ba555ab7a3ab0d4a37a58a7917ee12 127.0.0.1:7006@17006 slave 8853ba46dfe03d13ed2bd336e152bdeeae3d7249 0 1637376920570 33 connected
c040991992382f22d1e776f86dce7e2e56cc0dd9 127.0.0.1:7005@17005 slave 8853ba46dfe03d13ed2bd336e152bdeeae3d7249 0 1637376920570 33 connected
8f70e32e9b3aed0de7a0d006ee72db7de07250c0 127.0.0.1:7004@17004 slave 1997bd5644d878a07547b52417088c98fdfcab03 0 1637376921000 37 connected
8853ba46dfe03d13ed2bd336e152bdeeae3d7249 127.0.0.1:7001@17001 myself,master - 0 1637376920000 33 connected 0-5460
908d139c30af0c01aab0707f61b8e6143ac9a9d4 127.0.0.1:7009@17009 slave c1e141e8d6efc6337ea2e33879306164f641423d 0 1637376921876 13 connected
5c4cdbceb6c510254a421f46111d0e111a227400 127.0.0.1:7007@17007 slave 1997bd5644d878a07547b52417088c98fdfcab03 0 1637376922000 37 connected
ae9d30249f67b3c9d1085ef5909ce486cc0a3c1e 127.0.0.1:7008@17008 slave 1997bd5644d878a07547b52417088c98fdfcab03 0 1637376921374 37 connected
c1e141e8d6efc6337ea2e33879306164f641423d 127.0.0.1:7002@17002 master - 0 1637376922379 13 connected 5461-10922
127.0.0.1:7001>
127.0.0.1:7001> CLUSTER INFO
cluster_state:ok
cluster_slots_assigned:16384
cluster_slots_ok:16384
cluster_slots_pfail:0
cluster_slots_fail:0
cluster_known_nodes:9
cluster_size:3
cluster_current_epoch:37
cluster_my_epoch:33
cluster_stats_messages_ping_sent:596
cluster_stats_messages_pong_sent:587
cluster_stats_messages_sent:1183
cluster_stats_messages_ping_received:587
cluster_stats_messages_pong_received:596
cluster_stats_messages_received:1183
127.0.0.1:7001>
127.0.0.1:7001> MODULE LIST
1) 1) "name"
2) "ReJSON"
3) "ver"
4) (integer) 20004
127.0.0.1:7001>
Is this because of me using a cluster?
Sure I might be doing something wrong. Just wanted to check with others whether this is an expected behavior or I am doing something wrong.
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix #545 key location in `JSON.DEBUG MEMORY`
fix RedisJSON#545 key location in `JSON.DEBUG MEMORY` (RedisJSON#546)