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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user