Closed jonaskello closed 3 years ago
As mentioned here, there is a known limitation that you can only use RESTORE to the same key as the data was DUMP:ed from. So you can use RENAME to make a copy like this:
>> GRAPH.QUERY MotoGP "CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}), (:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}), (:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})"
1) 1) "Labels added: 2"
2) "Nodes created: 6"
3) "Properties set: 6"
4) "Relationships created: 3"
5) "Cached execution: 0"
6) "Query internal execution time: 1.053900 milliseconds"
>> eval "local o = redis.call('DUMP', KEYS[1]);redis.call('RENAME', KEYS[1], KEYS[2]);redis.call('RESTORE', KEYS[1], 0, o)" 2 MotoGP MotoGPCopy
(nil)
>> GRAPH.QUERY MotoGPCopy "MATCH (a) RETURN a"
1) 1) "a"
2) 1) 1) 1) 1) "id"
2) (integer) 0
2) 1) "labels"
2) 1) "Rider"
>> GRAPH.QUERY MotoGP "MATCH (a) RETURN a"
1) 1) "a"
2) 1) 1) 1) 1) "id"
2) (integer) 0
2) 1) "labels"
2) 1) "Rider"
Each graph in RedisGraph is stored on a key. For keys we can use the
DUMP
andRESTORE
commands in Redis to copy them. However when I do that RedisGraph gets stuck and only returns "replicating" messages to all further commands for any key.Steps to reproduce
Run these commands in Redis CLI:
I'm using a singe docker container locally on my computer with image
redislabs/redisgraph:2.4.1
. So no replication should be involved as far as I understand.The DUMP/RESTORE approach works in image
redislabs/redisgraph:2.0.20
but imageredislabs/redisgraph:2.2.15
and above gives the (error) RedisGraph module is currently replicating error. So it seems this is a regression bug.I previously reported this on #1076 but since this seems like a bug and that issue is a feature request I decided to open a separate issue for this bug.