Sentinel: return an error if configuration save fails#10151
Sentinel: return an error if configuration save fails#10151yossigo merged 4 commits intoredis:unstablefrom
Conversation
moticless
left a comment
There was a problem hiding this comment.
Looks good. Thank you.
|
@hwware @moticless please put some description in the top comment. |
@oranagra The description for this PR is added in the top, please take a look, Thanks |
If SENTINEL SET fails input validation *and* fails to flush other changes, we need to choose as we can't produce two errors. For now, keep reporting the user error - but ultimately this should probably be atomic. Other minor changes: * Shorten error message * Use a helper function to avoid repeating the check/error reply.
|
@moticless @hwware Added a commit to fix an issue + a small cleanup, PTAL. Thanks! |
|
The test failed, I think a way to pass in Centos, is i am running a daily and see how it (dir things) will look like (passed): https://github.com/enjoy-binbin/redis/actions/runs/1793640021 |
Change the sentinel config file to a directory in SENTINEL SET test. So it will now fail on the `rename` in `rewriteConfigOverwriteFile`. The test used to set the sentinel config file permissions to `000` to simulate failure. But it fails on centos7 / freebsd / alpine. (introduced in redis#10151) Other changes: 1. More error messages after the config rewrite failure. 2. Modify arg name `force_all` in `rewriteConfig` to `force_write`. (was rename in redis#9304) 3. Fix a typo in debug quicklist-packed-threshold, then -> than. (redis#9357)
Change the sentinel config file to a directory in SENTINEL SET test. So it will now fail on the `rename` in `rewriteConfigOverwriteFile`. The test used to set the sentinel config file permissions to `000` to simulate failure. But it fails on centos7 / freebsd / alpine. (introduced in #10151) Other changes: 1. More error messages after the config rewrite failure. 2. Modify arg name `force_all` in `rewriteConfig` to `force_write`. (was rename in #9304) 3. Fix a typo in debug quicklist-packed-threshold, then -> than. (#9357)
When performing
SENTINEL SET, Sentinel updates the local configuration file. Before this commit, failure to update the file would still result with an+OKreply. Now, a-ERR Failed to save config fileerror will be returned.