Snapchat / KeyDB

A Multithreaded Fork of Redis
https://keydb.dev
BSD 3-Clause "New" or "Revised" License
11.22k stars 568 forks source link

[BUG] Redisgraph Module in KeyDB - Replication Fails #463

Closed fferozbasha closed 1 year ago

fferozbasha commented 2 years ago

Describe the bug

Loaded Redisgraph (version 2.8.15) module in to the KeyDB Instance (v 6.3.1). Works all good in standalone mode. But when I add another instance as "replica", the replica instance server stops responding. When we reconnect to the CLI, we can see the data though.

=== KEYDB BUG REPORT START: Cut & paste starting from here === 41548:41660:S 07 Jul 2022 03:34:23.100 # === ASSERTION FAILED === 41548:41660:S 07 Jul 2022 03:34:23.100 # ==> module.cpp:650 'GlobalLocksAcquired()' is not true

------ STACK TRACE ------

Backtrace: /usr/bin/keydb-server 127.0.0.1:6380(moduleHandlePropagationAfterCommandCallback(RedisModuleCtx)+0x194) [0x5213c4] /usr/bin/keydb-server 127.0.0.1:6380(moduleFreeContext(RedisModuleCtx)+0xe) [0x5213fe] /usr/bin/keydb-server 127.0.0.1:6380(rdbSaveObject(_rio, robj_roptr, robj_roptr)+0x92a) [0x54835a] /usr/bin/keydb-server 127.0.0.1:6380(rdbSaveKeyValuePair(_rio, robj_roptr, robj_roptr, expireEntry const)+0xb4) [0x5484b4] /usr/bin/keydb-server 127.0.0.1:6380(saveKey(_rio, redisDbPersistentDataSnapshot const, int, unsigned long, char const, robj_roptr)+0x6e) [0x54b86e] /usr/bin/keydb-server 127.0.0.1:6380() [0x51701a] /usr/bin/keydb-server 127.0.0.1:6380(redisDbPersistentDataSnapshot::iterate_threadsafe_core(std::function<bool (char const, robj_roptr)>&, bool, bool, bool) const+0x8a) [0x551d3a] /usr/bin/keydb-server 127.0.0.1:6380(rdbSaveRio(_rio*, redisDbPersistentDataSnapshot const, int, int, rdbSaveInfo)+0x28c) [0x54581c] /usr/bin/keydb-server 127.0.0.1:6380(rdbSaveFile(char*, redisDbPersistentDataSnapshot const*, rdbSaveInfo)+0xac) [0x545b1c] /usr/bin/keydb-server 127.0.0.1:6380(rdbSave(redisDbPersistentDataSnapshot const, rdbSaveInfo)+0x4c) [0x545dfc] /usr/bin/keydb-server 127.0.0.1:6380(rdbSaveThread(void)+0x30f) [0x5461cf] /lib64/libpthread.so.0(+0x7ea5) [0x7fdba4134ea5] /lib64/libc.so.6(clone+0x6d) [0x7fdba3e5db0d]

To reproduce

Setup 2 KeyDB instances and load them with Redisgraph module. Configured second instance as replica of the 1st one. Configuration = replicaof

Expected behavior

The dump.rdb files should get replicated without any issues and post that we should ideally be able to setup active-replica with multi-master configuration. And the graph data should get replicated without issues.

Additional information

For test purpose, I have created 2 instances in the same physical machine. The machine has 72 cores of CPU and 192 GB of RAM and also enough storage.

FallingSnow commented 2 years ago

I'm using keydb in standalone mode and I'm running into this.

/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f89e655d61f]
                -(+)-        KeyDB has now joined Snap! See the announcement at:  https://docs.keydb.dev/news
1:1:M 13 Aug 2022 23:42:21.010 # Server initialized
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db) [0x7f89e68346db]
keydb-server unixsocket:/shared/redis.sock(rdbSaveThread(void*)+0x32f) [0x55dff4d6515f]
keydb-server unixsocket:/shared/redis.sock(rdbSave(redisDbPersistentDataSnapshot const**, rdbSaveInfo*)+0x66) [0x55dff4d64d26]
keydb-server unixsocket:/shared/redis.sock(rdbSaveFile(char*, redisDbPersistentDataSnapshot const**, rdbSaveInfo*)+0xd5) [0x55dff4d649f5]
keydb-server unixsocket:/shared/redis.sock(rdbSaveRio(_rio*, redisDbPersistentDataSnapshot const**, int*, int, rdbSaveInfo*)+0x2fc) [0x55dff4d646bc]
keydb-server unixsocket:/shared/redis.sock(redisDbPersistentDataSnapshot::iterate_threadsafe_core(std::function<bool (char const*, robj_roptr)>&, bool, bool, bool) const+0xb6) [0x55dff4d72036]
keydb-server unixsocket:/shared/redis.sock(+0xc5a7a) [0x55dff4cc5a7a]
keydb-server unixsocket:/shared/redis.sock(saveKey(_rio*, redisDbPersistentDataSnapshot const*, int, unsigned long*, char const*, robj_roptr)+0x85) [0x55dff4d6ae15]
keydb-server unixsocket:/shared/redis.sock(rdbSaveKeyValuePair(_rio*, robj_roptr, robj_roptr, expireEntry const*)+0xc4) [0x55dff4d67704]
keydb-server unixsocket:/shared/redis.sock(rdbSaveObject(_rio*, robj_roptr, robj_roptr)+0x99a) [0x55dff4d6758a]
keydb-server unixsocket:/shared/redis.sock(moduleFreeContext(RedisModuleCtx*)+0xe) [0x55dff4d1a50e]
keydb-server unixsocket:/shared/redis.sock(moduleHandlePropagationAfterCommandCallback(RedisModuleCtx*)+0x188) [0x55dff4d1a4c8]
------ STACK TRACE ------
Backtrace:
1:41:M 13 Aug 2022 23:57:22.082 # ==> module.cpp:650 'GlobalLocksAcquired()' is not true
1:41:M 13 Aug 2022 23:57:22.082 # === ASSERTION FAILED ===
=== KEYDB BUG REPORT START: Cut & paste starting from here ===
msotheeswaran-sc commented 1 year ago

We are unable to officially support usage of redisearch with keydb as the license on the Redis labs modules is not open source and prevents them from being used with other databases, but we will continue to fix any bugs with the module api and support open source modules.