Unverified Commit f3588fbc authored by Jie Liang Ang's avatar Jie Liang Ang Committed by GitHub
Browse files

Reuse checkGoodReplicasStatus in script.c (#11078)

Small refactoring done to reuse `checkGoodReplicasStatus` in `script.c` when checking for status of good replicas.
parent 1aa6c4ab
......@@ -181,11 +181,7 @@ int scriptPrepareForRun(scriptRunCtx *run_ctx, client *engine_client, client *ca
/* Don't accept write commands if there are not enough good slaves and
* user configured the min-slaves-to-write option. */
if (server.masterhost == NULL &&
server.repl_min_slaves_max_lag &&
server.repl_min_slaves_to_write &&
server.repl_good_slaves_count < server.repl_min_slaves_to_write)
{
if (!checkGoodReplicasStatus()) {
addReplyErrorObject(caller, shared.noreplicaserr);
return C_ERR;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment