kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

kvrocks2redis can't sync flush commands

Open iushas opened this issue 11 months ago • 6 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

unstable 70fac378e9f966f8209c5195cdd2aaa214a87a0e Fri Feb

Minimal reproduce step

image

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 avatar Mar 18 '24 09:03 iushas

@iushas Thanks for your report, will take a look soon.

git-hulk avatar Mar 18 '24 09:03 git-hulk

@iushas Thanks for your report, will take a look soon.

image if put kvrocks2redis with master node ,result is In line with expectations ,all namespace aof file generate one flushdb command

iushas avatar Mar 18 '24 09:03 iushas

Got your point, that said this issue only happened while syncing from the replica node and works well in the master node.

git-hulk avatar Mar 18 '24 10:03 git-hulk

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

iushas avatar Mar 18 '24 10:03 iushas

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.

git-hulk avatar Mar 18 '24 12:03 git-hulk

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

PokIsemaine avatar May 23 '24 03:05 PokIsemaine