summaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorranshid <88133677+ranshid@users.noreply.github.com>2022-03-01 14:40:29 +0200
committerGitHub <noreply@github.com>2022-03-01 14:40:29 +0200
commit9b15dd288e2a053cc84f3e0088a0275dc7c17486 (patch)
tree2b1ba068dbd0bdb7b1951fc6702be95115318d88 /src/debug.c
parent4a45386e3c7c95dff65802f758feefd00091790b (diff)
downloadredis-9b15dd288e2a053cc84f3e0088a0275dc7c17486.tar.gz
Introduce debug command to disable reply buffer resizing (#10360)
In order to resolve some flaky tests which hard rely on examine memory footprint. we introduce the following fixes: # Fix in client-eviction test - by @yoav-steinberg Sometime the libc allocator can use different size client struct allocations. this may cause unexpected memory calculations to fail the test. # Introduce new DEBUG command for disabling reply buffer resizing In order to eliminate reply buffer resizing during specific tests. we introduced the ability to disable (and enable) the resizing cron job Co-authored-by: yoav-steinberg yoav@redislabs.com
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/debug.c b/src/debug.c
index b95daaa36..2f57e7de3 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -482,10 +482,12 @@ void debugCommand(client *c) {
" Show low level client eviction pools info (maxmemory-clients).",
"PAUSE-CRON <0|1>",
" Stop periodic cron job processing.",
-"REPLYBUFFER-PEAK-RESET-TIME <NEVER||RESET|time>",
+"REPLYBUFFER PEAK-RESET-TIME <NEVER||RESET|time>",
" Sets the time (in milliseconds) to wait between client reply buffer peak resets.",
" In case NEVER is provided the last observed peak will never be reset",
" In case RESET is provided the peak reset time will be restored to the default value",
+"REPLYBUFFER RESIZING <0|1>",
+" Enable or disable the replay buffer resize cron job",
NULL
};
addReplyHelp(c, help);
@@ -962,14 +964,21 @@ NULL
{
server.pause_cron = atoi(c->argv[2]->ptr);
addReply(c,shared.ok);
- } else if (!strcasecmp(c->argv[1]->ptr,"replybuffer-peak-reset-time") && c->argc == 3 ) {
- if (!strcasecmp(c->argv[2]->ptr, "never")) {
- server.reply_buffer_peak_reset_time = -1;
- } else if(!strcasecmp(c->argv[2]->ptr, "reset")) {
- server.reply_buffer_peak_reset_time = REPLY_BUFFER_DEFAULT_PEAK_RESET_TIME;
+ } else if (!strcasecmp(c->argv[1]->ptr,"replybuffer") && c->argc == 4 ) {
+ if(!strcasecmp(c->argv[2]->ptr, "peak-reset-time")) {
+ if (!strcasecmp(c->argv[3]->ptr, "never")) {
+ server.reply_buffer_peak_reset_time = -1;
+ } else if(!strcasecmp(c->argv[3]->ptr, "reset")) {
+ server.reply_buffer_peak_reset_time = REPLY_BUFFER_DEFAULT_PEAK_RESET_TIME;
+ } else {
+ if (getLongFromObjectOrReply(c, c->argv[3], &server.reply_buffer_peak_reset_time, NULL) != C_OK)
+ return;
+ }
+ } else if(!strcasecmp(c->argv[2]->ptr,"resizing")) {
+ server.reply_buffer_resizing_enabled = atoi(c->argv[3]->ptr);
} else {
- if (getLongFromObjectOrReply(c, c->argv[2], &server.reply_buffer_peak_reset_time, NULL) != C_OK)
- return;
+ addReplySubcommandSyntaxError(c);
+ return;
}
addReply(c, shared.ok);
} else {