You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "xiaofan8421 (via GitHub)" <gi...@apache.org> on 2023/12/18 09:08:40 UTC

[I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

xiaofan8421 opened a new issue, #1941:
URL: https://github.com/apache/kvrocks/issues/1941

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
   
   
   ### Version
   
   kvrocks v2.4.0 and v2.6.0
   we fork based on Kvrocks these versions and implement new product features.
   
   ### Minimal reproduce step
   
   1. UAT/PRE Kvrocks cluster environment, add some namespace, then auth them, add lots of KVs.
   2. Deploy new cfg to old cfg path.
   3. send "CONFIG REWRITE" to Kvrocks by Redis-cli for persisting namespace info to new cfg. 
   
   ### What did you expect to see?
   
   new cfg should only show the namespaces info in the tail of kvrocks.cfg and should not change other fields in my cfg.
   
   
   ### What did you see instead?
   
   some other cfg fields changes before "################################ NAMESPACE #####################################" in kvrocks.conf?
   
   ### Anything Else?
   
   ![image](https://github.com/apache/kvrocks/assets/22815750/3c9e00de-f4a1-4549-bc8f-24fba501ebb5)
   1. CONFIG REWRITE not only saves namespace info into cfg, but also changes other cfg fields. Right? Why need to do it?
   2. If CONFIG REWRITE will change Kvrocks.conf definitely, how do I know what fields in my cfg will change every persist cfg by CONFIG REWRITE. 
   3. #1882 issue already has solved it? if done, what I need to upgrade Kvrocks to the latest v2.7.0 Right?
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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: issues-unsubscribe@kvrocks.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "xiaofan8421 (via GitHub)" <gi...@apache.org>.
xiaofan8421 commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1860650317

   > As I mentioned previously, since `2.7.0`, I think you can try to set `repl-namespace-enabled` to `yes`, which can store namespace information into database directly rather than `kvrocks.conf`. And then you don't need to care about the namespace section in `kvrocks.conf` anymore.
   
   Cool. 
   It sounds like much more elegant than flush namespace into kvrocks.conf. That's all I need.
   I will perform PoC validation later.
   Thanks again.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "xiaofan8421 (via GitHub)" <gi...@apache.org>.
xiaofan8421 commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1860838335

   > IMHO I don't think it is a BUG.
   > 
   > `CONFIG REWRITE` is to rewrite all current server configuration to the config file `kvrocks.conf`, which of course does not only include namespace changes, but also all configuration changes, e.g. if the current value of `bind` in the kvrocks server is `x.x.x.x`, but in `kvrocks.conf` it's `y.y.y.y`, `CONFIG REWRITE` will overwrite it to `x.x.x.x`. By this way, kvrocks can persist configuration changes made by `CONFIG SET`. And it's same as in redis.
   > 
   > Please refer to https://redis.io/commands/config-rewrite/ for further understanding.
   > 
   > And please enable `repl-namespace-enabled`
   > 
   > https://github.com/apache/kvrocks/blob/2ecf764db9a393a414c7239410db198079bed573/kvrocks.conf#L62
   > 
   > if you want to store namespace information to rocksdb instead of `kvrocks.conf`, which is encouraged.
   
   Thanks for your reference to Redis's official doc about CONFIG REWRITE.
   But "# replica-announce-port 1234" is the default in Kvrocks.conf, why here shows "replica-announce-port 0" the tail of kvrocks.conf. Will it conform to their principle? I think that I didn't change it explicitly in my snapshot about kvrocks.conf at that time.
   if "#" represents default no or 0, Maybe it is much more suitable to not display it.  
   ![image](https://github.com/apache/kvrocks/assets/22815750/a4052998-668b-4300-b180-9c55ff614399)
   


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "xiaofan8421 (via GitHub)" <gi...@apache.org>.
xiaofan8421 closed issue #1941: CONFIG REWRITE cmd overrides my new cfg
URL: https://github.com/apache/kvrocks/issues/1941


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "xiaofan8421 (via GitHub)" <gi...@apache.org>.
xiaofan8421 commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1860840587

   > > As I mentioned previously, since `2.7.0`, I think you can try to set `repl-namespace-enabled` to `yes`, which can store namespace information into database directly rather than `kvrocks.conf`. And then you don't need to care about the namespace section in `kvrocks.conf` anymore.
   > 
   > Cool. It sounds like much more elegant than flush namespace into kvrocks.conf. That's all I need. I will perform PoC validation later. Thanks again.
   
   Great!
   It works well.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1860484526

   @xiaofan8421 I'm not quite sure if I understand your question correctly. 
   
   Do you mean that you edit the configuration file and don't expect it to be overridden by Kvrocks? If yes, you can use `config rewrite` to dump the live configuration first, then modify items you want and restart Kvrocks after that.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "xiaofan8421 (via GitHub)" <gi...@apache.org>.
xiaofan8421 commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1860378911

   Thanks for your reply. But I still have a little confused about Kvrocks' persist cfg impl.
   Background:
     If I need to upgrade Kvrocks(Maybe only bin or cfg,  or combine with them), what is the best practice in production?
     
   At least, It seems that no official doc to talk about upgradation with Kvrocks(bin or cfg)  safely.
   
   In another way, As we know, not all cfg is supported for reloading dynamically. 
   It's common for us to restart Kvrocks to let cfg load effectively in another lifetime. 
   
   The one: persist old Kvrocks's namespace into my new cfg by the persist way for CONFIG REWRITE to upgrade Kvrocks, then Kvrocks restart to load new cfg. (Drawbacks: override my new cfg partial fields)
   The other one:  read namespace info from the tail of old cfg(old Kvrocks.conf) by scripts, then appending these namespace into my new cfg to avoid that some cfg fields are changed unexpectedly in my Kvrocks.conf
   Which do you recommend?
   


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1860626463

   As I mentioned previously, since `2.7.0`, I think you can try to set `repl-namespace-enabled` to `yes`, which can store namespace information into database directly rather than `kvrocks.conf`. And then you don't need to care about the namespace section in `kvrocks.conf` anymore. 


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1859981852

   IMHO I don't think it is a BUG.
   
   `CONFIG REWRITE` is to rewrite all current server configuration to the config file `kvrocks.conf`, which of course does not only include namespace changes, but also all configuration changes, e.g. if the current value of `bind` in the kvrocks server is `x.x.x.x`, but in `kvrocks.conf` it's `y.y.y.y`, `CONFIG REWRITE` will overwrite it to `x.x.x.x`. By this way, kvrocks can persist configuration changes by `CONFIG SET`. And it's same as in redis.
   
   Please refer to https://redis.io/commands/config-rewrite/ for further understanding.
   
   And please refer to https://github.com/apache/kvrocks/blob/2ecf764db9a393a414c7239410db198079bed573/kvrocks.conf#L62 if you want to store namespace information to rocksdb instead of `kvrocks.conf`, which is encouraged.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "xiaofan8421 (via GitHub)" <gi...@apache.org>.
xiaofan8421 commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1862078281

   
   
   
   > > @xiaofan8421 I'm not quite sure if I understand your question correctly.
   > > Do you mean that you edit the configuration file and don't expect it to be overridden by Kvrocks? If yes, you can use `config rewrite` to dump the live configuration first, then modify items you want and restart Kvrocks after that.
   > 
   > Yes, I also list the two solutions above your answer. But too manual to auto, and depends on the diff(persist cfg by CONFIG REWRITE VS new cfg by deploying) mechanism. It sounds like that lack of elegance, but Maybe this problem is not the actual problem.
   > 
   > In general, we directly use persist cfg by CONFIG REWRITE and then modify them are much more better and scientific than adopt the way of unverified new cfg. Right? Namely, Above the former one is safer than the latter one.
   
   But except namespace(which elegantly stores into rocksdb now for v2.7.0), other cfg fields which are persisted into kvrocks.conf by Kvrocks still faces this problem when upgrading.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] CONFIG REWRITE cmd overrides my new cfg [kvrocks]

Posted by "xiaofan8421 (via GitHub)" <gi...@apache.org>.
xiaofan8421 commented on issue #1941:
URL: https://github.com/apache/kvrocks/issues/1941#issuecomment-1860551457

   > @xiaofan8421 I'm not quite sure if I understand your question correctly.
   > 
   > Do you mean that you edit the configuration file and don't expect it to be overridden by Kvrocks? If yes, you can use `config rewrite` to dump the live configuration first, then modify items you want and restart Kvrocks after that.
   
   Yes,  I also list the two solutions above your answer. But too manual to auto, and depends on the diff(persist cfg by CONFIG REWRITE VS new cfg by deploying) mechanism.
   It sounds like that lack of elegance, but Maybe this problem is not the actual problem.
   
   In general, we directly use persist cfg by CONFIG REWRITE and then modify them are much more better and scientific than  adopt the way of unverified  new cfg. Right? Namely, Above the former one is safer than the latter one.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org