diff --git a/src/config.cpp b/src/config.cpp index 6fc957485..49d539ddf 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -2730,6 +2730,7 @@ standardConfig configs[] = { 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("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 */ createStringConfig("aclfile", NULL, IMMUTABLE_CONFIG, ALLOW_EMPTY_STRING, g_pserver->acl_filename, "", NULL, NULL), diff --git a/src/networking.cpp b/src/networking.cpp index 618f9dc01..8667e4e7f 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -2710,7 +2710,8 @@ void readQueryFromClient(connection *conn) { if (cserver.cthreads > 1) { 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()) serverTL->vecclientsProcess.push_back(c); } else { diff --git a/src/server.h b/src/server.h index 6a0196a22..819690b62 100644 --- a/src/server.h +++ b/src/server.h @@ -2567,6 +2567,8 @@ struct redisServer { int target_replica_port; /* Failover target port */ int failover_state; /* Failover state */ + int enable_async_commands; + long long repl_batch_offStart = -1; long long repl_batch_idxStart = -1;