add redis_repl_flow_server and code refactor