Fix intermittent module test failure, resizing the repl backlog is not good enough to clear the backlog

Former-commit-id: d50e4bb8193a349eb3295a53e3111e764676ddcf
This commit is contained in:
John Sully 2021-01-12 00:29:07 +00:00
parent e0703f0627
commit cbc331be74
2 changed files with 8 additions and 1 deletions

View File

@ -829,6 +829,13 @@ NULL
c->flags &= ~(CLIENT_MASTER | CLIENT_MASTER_FORCE_REPLY);
}
addReply(c, shared.ok);
} else if (!strcasecmp(szFromObj(c->argv[1]),"truncate-repl-backlog") && c->argc == 2) {
g_pserver->repl_backlog_idx = 0;
g_pserver->repl_backlog_off = g_pserver->master_repl_offset+1;
g_pserver->repl_backlog_histlen = 0;
if (g_pserver->repl_batch_idxStart >= 0) g_pserver->repl_batch_idxStart = -1;
if (g_pserver->repl_batch_offStart >= 0) g_pserver->repl_batch_offStart = -1;
addReply(c, shared.ok);
} else if (!strcasecmp(szFromObj(c->argv[1]),"config-rewrite-force-all") && c->argc == 2)
{
if (rewriteConfig(cserver.configfile, 1) == -1)

View File

@ -96,7 +96,7 @@ tags "modules" {
$master client kill type replica
$master set asdf asdf
# the side effect of resizing the backlog is that it is flushed (16k is the min size)
$master config set repl-backlog-size [expr {16384 + $i}]
$master debug truncate-repl-backlog
$master exec
}
# wait for loading to stop (fail)