Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
781d7b0d
Unverified
Commit
781d7b0d
authored
Dec 22, 2020
by
Wen Hui
Committed by
GitHub
Dec 22, 2020
Browse files
Sentinel: add missing calls for sentinelflushconfig when config master at runtime (#8229)
parent
92a483bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
781d7b0d
...
@@ -3579,14 +3579,13 @@ void sentinelSetCommand(client *c) {
...
@@ -3579,14 +3579,13 @@ void sentinelSetCommand(client *c) {
"Reconfiguration of scripts path is denied for "
"Reconfiguration of scripts path is denied for "
"security reasons. Check the deny-scripts-reconfig "
"security reasons. Check the deny-scripts-reconfig "
"configuration directive in your Sentinel configuration"
);
"configuration directive in your Sentinel configuration"
);
return
;
goto
seterr
;
}
}
if
(
strlen
(
value
)
&&
access
(
value
,
X_OK
)
==
-
1
)
{
if
(
strlen
(
value
)
&&
access
(
value
,
X_OK
)
==
-
1
)
{
addReplyError
(
c
,
addReplyError
(
c
,
"Notification script seems non existing or non executable"
);
"Notification script seems non existing or non executable"
);
if (changes) sentinelFlushConfig();
goto
seterr
;
return;
}
}
sdsfree
(
ri
->
notification_script
);
sdsfree
(
ri
->
notification_script
);
ri
->
notification_script
=
strlen
(
value
)
?
sdsnew
(
value
)
:
NULL
;
ri
->
notification_script
=
strlen
(
value
)
?
sdsnew
(
value
)
:
NULL
;
...
@@ -3599,15 +3598,14 @@ void sentinelSetCommand(client *c) {
...
@@ -3599,15 +3598,14 @@ void sentinelSetCommand(client *c) {
"Reconfiguration of scripts path is denied for "
"Reconfiguration of scripts path is denied for "
"security reasons. Check the deny-scripts-reconfig "
"security reasons. Check the deny-scripts-reconfig "
"configuration directive in your Sentinel configuration"
);
"configuration directive in your Sentinel configuration"
);
return
;
goto
seterr
;
}
}
if
(
strlen
(
value
)
&&
access
(
value
,
X_OK
)
==
-
1
)
{
if
(
strlen
(
value
)
&&
access
(
value
,
X_OK
)
==
-
1
)
{
addReplyError
(
c
,
addReplyError
(
c
,
"Client reconfiguration script seems non existing or "
"Client reconfiguration script seems non existing or "
"non executable"
);
"non executable"
);
if (changes) sentinelFlushConfig();
goto
seterr
;
return;
}
}
sdsfree
(
ri
->
client_reconfig_script
);
sdsfree
(
ri
->
client_reconfig_script
);
ri
->
client_reconfig_script
=
strlen
(
value
)
?
sdsnew
(
value
)
:
NULL
;
ri
->
client_reconfig_script
=
strlen
(
value
)
?
sdsnew
(
value
)
:
NULL
;
...
@@ -3657,8 +3655,7 @@ void sentinelSetCommand(client *c) {
...
@@ -3657,8 +3655,7 @@ void sentinelSetCommand(client *c) {
}
else
{
}
else
{
addReplyErrorFormat
(
c
,
"Unknown option or number of arguments for "
addReplyErrorFormat
(
c
,
"Unknown option or number of arguments for "
"SENTINEL SET '%s'"
,
option
);
"SENTINEL SET '%s'"
,
option
);
if (changes) sentinelFlushConfig();
goto
seterr
;
return;
}
}
/* Log the event. */
/* Log the event. */
...
@@ -3684,9 +3681,11 @@ void sentinelSetCommand(client *c) {
...
@@ -3684,9 +3681,11 @@ void sentinelSetCommand(client *c) {
return
;
return
;
badfmt:
/* Bad format errors */
badfmt:
/* Bad format errors */
if (changes) sentinelFlushConfig();
addReplyErrorFormat
(
c
,
"Invalid argument '%s' for SENTINEL SET '%s'"
,
addReplyErrorFormat
(
c
,
"Invalid argument '%s' for SENTINEL SET '%s'"
,
(
char
*
)
c
->
argv
[
badarg
]
->
ptr
,
option
);
(
char
*
)
c
->
argv
[
badarg
]
->
ptr
,
option
);
seterr:
if
(
changes
)
sentinelFlushConfig
();
return
;
}
}
/* Our fake PUBLISH command: it is actually useful only to receive hello messages
/* Our fake PUBLISH command: it is actually useful only to receive hello messages
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment