mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
41e6e05dee
## background Till now CONFIG SET was blocked during loading. (In the not so distant past, GET was disallowed too) We recently (not released yet) added an async-loading mode, see #9323, and during that time it'll serve CONFIG SET and any other command. And now we realized (#9770) that some configs, and commands are dangerous during async-loading. ## changes * Allow most CONFIG SET during loading (both on async-loading and normal loading) * Allow CONFIG REWRITE and CONFIG RESETSTAT during loading * Block a few config during loading (`appendonly`, `repl-diskless-load`, and `dir`) * Block a few commands during loading (list below) ## the blocked commands: * SAVE - obviously we don't wanna start a foregreound save during loading 8-) * BGSAVE - we don't mind to schedule one, but we don't wanna fork now * BGREWRITEAOF - we don't mind to schedule one, but we don't wanna fork now * MODULE - we obviously don't wanna unload a module during replication / rdb loading (MODULE HELP and MODULE LIST are not blocked) * SYNC / PSYNC - we're in the middle of RDB loading from master, must not allow sync requests now. * REPLICAOF / SLAVEOF - we're in the middle of replicating, maybe it makes sense to let the user abort it, but he couldn't do that so far, i don't wanna take any risk of bugs due to odd state. * CLUSTER - only allow [HELP, SLOTS, NODES, INFO, MYID, LINKS, KEYSLOT, COUNTKEYSINSLOT, GETKEYSINSLOT, RESET, REPLICAS, COUNT_FAILURE_REPORTS], for others, preserve the status quo ## other fixes * processEventsWhileBlocked had an issue when being nested, this could happen with a busy script during async loading (new), but also in a busy script during AOF loading (old). this lead to a crash in the scenario described in #6988
37 lines
982 B
JSON
37 lines
982 B
JSON
{
|
|
"FAILOVER": {
|
|
"summary": "Forces a replica to perform a manual failover of its master.",
|
|
"complexity": "O(1)",
|
|
"group": "cluster",
|
|
"since": "3.0.0",
|
|
"arity": -2,
|
|
"container": "CLUSTER",
|
|
"function": "clusterCommand",
|
|
"command_flags": [
|
|
"NO_ASYNC_LOADING",
|
|
"ADMIN",
|
|
"RANDOM",
|
|
"STALE"
|
|
],
|
|
"arguments": [
|
|
{
|
|
"name": "options",
|
|
"type": "oneof",
|
|
"optional": true,
|
|
"arguments": [
|
|
{
|
|
"name": "force",
|
|
"type": "pure-token",
|
|
"token": "FORCE"
|
|
},
|
|
{
|
|
"name": "takeover",
|
|
"type": "pure-token",
|
|
"token": "TAKEOVER"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|