Fix bugs in CONFIG REWRITE, omitting rename-command and include lines, and inserting comments around module and acl configs#10761
Conversation
|
What about configs like |
|
I thought we had a test for this (config rewrite of loaded modules added here #4848), can you look into it, and add what's needed to make it fail on that bug? |
|
@oranagra The This PR is mainly to avoid the following situation where there is an extra line of comment. |
|
Ohh got it. So it adds warning comments when trying to read the old file, but it doesn't prevent it from injecting them to the new file (not commented) so the test passes. So that means that this regression is harmless? (other than looking bad) |
@oranagra Correct. Just something that can cause users' confusion. Don't have any negative effects on redis runtime. |
|
looking more at the history of that block and the recent changes to it, the relevant discussions i could find are:
i may be missing something so i'd like to call @nichchun and @yoav-steinberg to take a look. in retrospect, i think i'd like to revert that condition to the same as it was originally (i.e. the alternative would be to keep the current code, but extend it with more exceptions, i.e. everything that's explicitly supported at the bottom of |
|
@zhugezy can you check why the tests are failing and report? |
|
@zhugezy are you gonna pick this up? prints: probably because that test involves two modules, and after the rewrite only one survives... additionally, i'd like to make sure it properly handles the other special configs lines (rename-command, include, user, sentinal) |
|
apparently the reason the tests fail is because the fix was broken (negated). more importantly, this bug was not harmless, a CONFIG REWRITE would have removed would someone review my changes, so that i can merge them? |
|
i also updated the top comment and description, please validate that. |
@oranagra Looks fine. thanks! |
…, and inserting comments around module and acl configs (redis#10761) A regression from redis#10285 (redis 7.0). CONFIG REWRITE would put lines with: `include`, `rename-command`, `user`, `loadmodule`, and any module specific config in a comment. For ACL `user`, `loadmodule` and module specific configs would be re-inserted at the end (instead of updating existing lines), so the only implication is a messy config file full of comments. But for `rename-command` and `include`, the implication would be that they're now missing, so a server restart would lose them. Co-authored-by: Oran Agra <[email protected]>
A regression from #10285 (redis 7.0).
CONFIG REWRITE would put lines with:
include,rename-command,user,loadmodule, and any module specific config in a comment.For ACL
user,loadmoduleand module specific configs would be re-inserted at the end (instead of updating existing lines), so the only implication is a messy config file full of comments.But for
rename-commandandinclude, the implication would be that they're now missing, so a server restart would lose them.