git-hulk opened a new pull request, #2221:
URL: https://github.com/apache/kvrocks/pull/2221

   This closes #2214
   
   The namespace mechanism is NOT allowed in cluster mode, so it's
   unnecessary to rewrite while the cluster mode is enabled. This
   config rewrite behavior will cause the replication issue which was
   mentioned in #2214 when starting the cluster node.
   
   The root cause is that the server will try to rewrite the namespace
   into the rocksdb if the option `repl-namespace-enabled` is enabled.
   So it will increase the server's rocksdb sequence and replication will
   start with the wrong offset. We have checked if the role is a slave 
   before rewriting, but the cluster replication is NOT set at that 
time(master-replica is good).
   
   The good news is it only affects the cluster users who enabled the option 
`repl-namespace-enabled`, so I guess almost no user will do this since the 
namespace replication is meaningless to the cluster mode.
   
   For the reproduce code, please refer the commit 
7efcf6d3332dd4abb197f5fe3a6cab87e5eb3bd7. The replica will lost one update 
before applying this patch:
   
   ```
   === RUN   
TestClusterReplication/Cluster_replication_should_work_normally_after_restart
       replication_test.go:88: 
                Error Trace:    
/Users/hulk/code/cxx/kvrocks/tests/gocase/integration/replication/replication_test.go:88
                Error:          Not equal: 
                                expected: "v1"
                                actual  : "v0"
   ```
   
   And it works well after this patch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to