Unverified Commit 41e6e05d authored by Oran Agra's avatar Oran Agra Committed by GitHub
Browse files

Allow most CONFIG SET during loading, block some commands in async-loading (#9878)

## 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
parent ad55fbaa
This diff is collapsed.
......@@ -7,6 +7,7 @@
"arity": 1,
"function": "bgrewriteaofCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"NOSCRIPT"
]
......
......@@ -13,6 +13,7 @@
]
],
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"NOSCRIPT"
],
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -8,6 +8,7 @@
"container": "CLUSTER",
"function": "clusterCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"RANDOM",
"STALE"
......
......@@ -10,6 +10,7 @@
"command_flags": [
"ADMIN",
"NOSCRIPT",
"LOADING",
"STALE"
]
}
......
......@@ -10,6 +10,7 @@
"command_flags": [
"ADMIN",
"NOSCRIPT",
"LOADING",
"STALE"
]
}
......
......@@ -16,6 +16,7 @@
"command_flags": [
"ADMIN",
"NOSCRIPT",
"LOADING",
"STALE"
],
"arguments": [
......
......@@ -8,6 +8,7 @@
"container": "MODULE",
"function": "moduleCommand",
"command_flags": [
"NO_ASYNC_LOADING",
"ADMIN",
"NOSCRIPT",
"PROTECTED"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment