kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

feat(cluster): disconnect replication connections to orphan slaves

Open RiversJin opened this issue 9 months ago • 7 comments

it solves https://github.com/apache/kvrocks/issues/2841

RiversJin avatar Mar 23 '25 11:03 RiversJin

Thank you for your contribution! Could you add some test cases for it?

PragmaTwice avatar Mar 23 '25 12:03 PragmaTwice

Thank you for your contribution! Could you add some test cases for it?

Of course, but save the boring tasks for weekdays :P.

RiversJin avatar Mar 23 '25 13:03 RiversJin

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 avatar Mar 24 '25 07:03 RiversJin

@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?

git-hulk avatar Mar 28 '25 07:03 git-hulk

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...

RiversJin avatar Mar 28 '25 08:03 RiversJin

Yeah these changes in parse_utils.h looks good to me, so maybe you can open a separate PR for it.

PragmaTwice avatar Apr 01 '25 09:04 PragmaTwice