Make async commands runtime configurable

Former-commit-id: 23bafb5f7c3c9805581f4bf09d9d5136898c2883
This commit is contained in:
John Sully 2021-09-21 20:49:44 +00:00
parent cf85a9cd02
commit dcbd4c547f
3 changed files with 5 additions and 1 deletions

View File

@ -2730,6 +2730,7 @@ standardConfig configs[] = {
createBoolConfig("disable-thp", NULL, MODIFIABLE_CONFIG, g_pserver->disable_thp, 1, NULL, NULL), createBoolConfig("disable-thp", NULL, MODIFIABLE_CONFIG, g_pserver->disable_thp, 1, NULL, NULL),
createBoolConfig("cluster-allow-replica-migration", NULL, MODIFIABLE_CONFIG, g_pserver->cluster_allow_replica_migration, 1, NULL, NULL), createBoolConfig("cluster-allow-replica-migration", NULL, MODIFIABLE_CONFIG, g_pserver->cluster_allow_replica_migration, 1, NULL, NULL),
createBoolConfig("replica-announced", NULL, MODIFIABLE_CONFIG, g_pserver->replica_announced, 1, NULL, NULL), createBoolConfig("replica-announced", NULL, MODIFIABLE_CONFIG, g_pserver->replica_announced, 1, NULL, NULL),
createBoolConfig("enable-async-commands", NULL, MODIFIABLE_CONFIG, g_pserver->enable_async_commands, 1, NULL, NULL),
/* String Configs */ /* String Configs */
createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->acl_filename, "", NULL, NULL), createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->acl_filename, "", NULL, NULL),

View File

@ -2710,7 +2710,8 @@ void readQueryFromClient(connection *conn) {
if (cserver.cthreads > 1) { if (cserver.cthreads > 1) {
parseClientCommandBuffer(c); parseClientCommandBuffer(c);
processInputBuffer(c, false, CMD_CALL_SLOWLOG | CMD_CALL_STATS | CMD_CALL_ASYNC); if (g_pserver->enable_async_commands)
processInputBuffer(c, false, CMD_CALL_SLOWLOG | CMD_CALL_STATS | CMD_CALL_ASYNC);
if (!c->vecqueuedcmd.empty()) if (!c->vecqueuedcmd.empty())
serverTL->vecclientsProcess.push_back(c); serverTL->vecclientsProcess.push_back(c);
} else { } else {

View File

@ -2567,6 +2567,8 @@ struct redisServer {
int target_replica_port; /* Failover target port */ int target_replica_port; /* Failover target port */
int failover_state; /* Failover state */ int failover_state; /* Failover state */
int enable_async_commands;
long long repl_batch_offStart = -1; long long repl_batch_offStart = -1;
long long repl_batch_idxStart = -1; long long repl_batch_idxStart = -1;