kvrocks
kvrocks copied to clipboard
kvrocks2redis can't sync flush commands
Search before asking
- [X] I had searched in the issues and found no similar issues.
Version
unstable 70fac378e9f966f8209c5195cdd2aaa214a87a0e Fri Feb
Minimal reproduce step
master -> slave -> kvrocks2redis -> target
1、master flush 2、aof only write one del command
What did you expect to see?
write flushcommand to aof file
What did you see instead?
aof only write one del command
Anything Else?
No response
Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
@iushas Thanks for your report, will take a look soon.
@iushas Thanks for your report, will take a look soon.
if put kvrocks2redis with master node ,result is In line with expectations ,all namespace aof file generate one flushdb command
Got your point, that said this issue only happened while syncing from the replica node and works well in the master node.
Got your point, that said this issue only happened while syncing from the replica node and works well in the master node.
yes, Not sure if there are any other commands that would have this problem
Got your point, that said this issue only happened while syncing from the replica node and works well in the master node.
yes, Not sure if there are any other commands that would have this problem
It's caused by the rocksdb's DeleteRange API which we didn't implement the batch extractor. And for parsing from the master node should have the same issue, guess the FLUSHDB
you seen is the kvrocks2redis will send the FLUSHDB command first before parsing the full DB.
AFAIK, the DeleteRange API is only used in FLUSHDB/FLUSHALL command, so it should only affect those two.
MULTI/EXEC has the same problem
127.0.0.1:6666> MULTI
OK
127.0.0.1:6666> SET key 123
QUEUED
127.0.0.1:6666> FLUSHDB
QUEUED
127.0.0.1:6666> EXEC
1) OK
2) (error) ERR Not implemented: DeleteRange unsupported in WriteBatchWithIndex
ERR Not implemented: DeleteRange unsupported in WriteBatchWithIndex rocksdb ref: https://github.com/facebook/rocksdb/blob/c72ee4531b288bf08b9414155fafb86cc4378fb4/include/rocksdb/utilities/write_batch_with_index.h#L165