feat(cluster): disconnect replication connections to orphan slaves
it solves https://github.com/apache/kvrocks/issues/2841
Thank you for your contribution! Could you add some test cases for it?
Thank you for your contribution! Could you add some test cases for it?
Of course, but save the boring tasks for weekdays :P.
Thank you for your contribution! Could you add some test cases for it?
@PragmaTwice After a closer look, this PR doesn't introduce any new changes other than disconnecting data replication for nodes removed from the cluster. I added a small snippet of assertion code in cluster_test.go for this scenario. Do you think there are any other areas that might need more testing?
@RiversJin, I found that this PR introduces many code styles and fixes, except for the disconnecting feature. Would you mind separating them into a few dedicated PRs that would be easy to review and clarify the context?
I found that this PR introduces many code styles and fixes, except for the disconnecting feature. Would you mind separating them into a few dedicated PRs that would be easy to review and clarify the context?
@git-hulk Sure! The unrelated tweaks were legacy from our internal codebase. I've removed the obvious ones, but the iterator-based index optimization in Cluster::nodes_ (avoiding double lookups) is interleaved in some places. It's technically out of scope, but actually improves performance. but need some time to remove those...
Quality Gate passed
Issues
6 New issues
0 Accepted issues
Measures
0 Security Hotspots
51.8% Coverage on New Code
0.0% Duplication on New Code
Yeah these changes in parse_utils.h looks good to me, so maybe you can open a separate PR for it.