Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the support of the namespace replication #1776

Merged
merged 7 commits into from
Oct 9, 2023

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Sep 24, 2023

This PR implements the namespace replication between master and slaves, the detailed design is inside #1720. We added a new configuration repl-namespace-enabled to turn on/off this feature and it's disabled by default.

  • If repl-namespace-enabled is set to no, it behaves the same as the previous. All namespace configurations are stored in the configuration file.

  • if repl-namespace-enabled is set to yes, all namespace configurations will be removed from the configuration file, stored in DB, and then propagated to slaves. If the namespace has already existed in the slave, it will be overwritten by the master. Another significant change is that slaves cannot change namespaces if the replication is enabled.

This closes #1720

@git-hulk git-hulk requested review from PragmaTwice, torwig and enjoy-binbin and removed request for PragmaTwice September 30, 2023 15:46
@git-hulk git-hulk marked this pull request as ready for review September 30, 2023 15:46
src/server/namespace.cc Outdated Show resolved Hide resolved
src/server/server.cc Outdated Show resolved Hide resolved
@PragmaTwice
Copy link
Member

PragmaTwice commented Oct 1, 2023

It just come to me that if we firstly set repl-namespace-enabled to yes, use kvrocks in a period of time, and then change it to no, will it process correctly? e.g. will these tokens in the storage be removed?

@git-hulk
Copy link
Member Author

git-hulk commented Oct 1, 2023

It just come to me that if we firstly set repl-namespace-enabled to yes, use kvrocks in a period of time, and then change it to no, will it process correctly? e.g. will these tokens in the storage be removed?

Good point, we should remove the DB key if this option switches from yes to no. But this may introduce another issue if the slave enables this configuration. So I think we can disallow changing it to no after turning it to yes.

@git-hulk git-hulk force-pushed the feature/repl-namespace branch from 663353c to 4391ba4 Compare October 1, 2023 10:40
@git-hulk git-hulk requested a review from PragmaTwice October 1, 2023 10:46
@git-hulk git-hulk merged commit f972819 into apache:unstable Oct 9, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to propagate namespace and tokens from master to slaves
2 participants