summaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorMadelyn Olson <34459052+madolson@users.noreply.github.com>2022-04-26 03:25:33 -0700
committerGitHub <noreply@github.com>2022-04-26 13:25:33 +0300
commit6fa8e4f7afcbd14748c736c38e5fbc117eaef7ba (patch)
treee74b7ddf889b99daadd615cbee5ca069e14c82bb /src/debug.c
parentefcd1bf394668e418df1a93cd28cf9e8b0c09ce5 (diff)
downloadredis-6fa8e4f7afcbd14748c736c38e5fbc117eaef7ba.tar.gz
Set replicas to panic on disk errors, and optionally panic on replication errors (#10504)
* Till now, replicas that were unable to persist, would still execute the commands they got from the master, now they'll panic by default, and we add a new `replica-ignore-disk-errors` config to change that. * Till now, when a command failed on a replica or AOF-loading, it only logged a warning and a stat, we add a new `propagation-error-behavior` config to allow panicking in that state (may become the default one day) Note that commands that fail on the replica can either indicate a bug that could cause data inconsistency between the replica and the master, or they could be in some cases (specifically in previous versions), a result of a command (e.g. EVAL) that failed on the master, but still had to be propagated to fail on the replica as well.
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/debug.c b/src/debug.c
index 4f0e37777..081cb862f 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -416,6 +416,8 @@ void debugCommand(client *c) {
" Like HTSTATS but for the hash table stored at <key>'s value.",
"LOADAOF",
" Flush the AOF buffers on disk and reload the AOF in memory.",
+"REPLICATE <string>",
+" Replicates the provided string to replicas, allowing data divergence.",
#ifdef USE_JEMALLOC
"MALLCTL <key> [<val>]",
" Get or set a malloc tuning integer.",
@@ -849,6 +851,10 @@ NULL
{
server.aof_flush_sleep = atoi(c->argv[2]->ptr);
addReply(c,shared.ok);
+ } else if (!strcasecmp(c->argv[1]->ptr,"replicate") && c->argc >= 3) {
+ replicationFeedSlaves(server.slaves, server.slaveseldb,
+ c->argv + 2, c->argc - 2);
+ addReply(c,shared.ok);
} else if (!strcasecmp(c->argv[1]->ptr,"error") && c->argc == 3) {
sds errstr = sdsnewlen("-",1);