leonchen83 / redis-rdb-cli

Redis rdb CLI : A CLI tool that can parse, filter, split, merge rdb and analyze memory usage offline. It can also sync 2 redis data and allow user define their own sink service to migrate redis data to somewhere.
Apache License 2.0
416 stars 83 forks source link

Bloom keys not synced to target redis instance #60

Open Prudhvi0717 opened 1 year ago

Prudhvi0717 commented 1 year ago

When Syncing redis instances with "rst" the data and bloom filters and its keys in initial snapshot are being migrated to target instance. But during further sync the new created bloom keys are not being synced. The normal keys are synced seamlessly.

So can we also have the bloom keys be synced? Is there anyway to do this? @leonchen83

leonchen83 commented 1 year ago

Hi @Prudhvi0717 Unfortunately yes, redis-rdb-cli does not support third party modules like redisbloom, rejson and etc. Because there are too many third party modules. so implement module sync is very hard(we should parse every module command and sync these commands to target)

If you want to sync bloom filter. You should fork this project and modify following java class to support above modules

XRst.java
SingleRdbVisitor.java in ext/rst package
ClusterRdbVisitor.java in ext/rst package

step1: in XRst.java write your own bloom filter command parser and register parsers to replicator like following

// since redis 7.0
replicator.addCommandParser(CommandName.name("SPUBLISH"), new CombineCommandParser(new SPublishParser()));
replicator.addCommandParser(CommandName.name("FUNCTION"), new CombineCommandParser(new FunctionParser()));

step2: in SingleRdbVisitor and ClusterRdbVisitor handle bloom filter command and synced to target redis instance