summaryrefslogtreecommitdiff
path: root/src/server.c
diff options
context:
space:
mode:
authorllahav-amzn <118261070+llahav-amzn@users.noreply.github.com>2023-01-05 02:26:46 +0200
committerGitHub <noreply@github.com>2023-01-04 16:26:46 -0800
commitcb1fff3cb6a944d1f9cc67f8aa8b1d92648bbade (patch)
tree4f8a76f0244e64767c9a5e3ace5dfed4ed082f9d /src/server.c
parenta2e75a78b424a6faca4bba4b1bf8270b98407284 (diff)
downloadredis-cb1fff3cb6a944d1f9cc67f8aa8b1d92648bbade.tar.gz
In cluster-mode enabled, override the databases config at startup to 1 (#11555)
In cluster-mode, only DB0 is supported so all data must reside in that database. There is a single check that validates that data loaded from an RDB all resides in DB0. This check is performed after all the data is loaded which makes it difficult to identify where the non DB0 data resides as well as does a bunch of unnecessary work to load incompatible data. This change override the database config at startup to 1 to throw an error when attempting to add data to a database other than DB0. Co-authored-by: Eran Liberty <eranl@amazon.com> Co-authored-by: Oran Agra <oran@redislabs.com> Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Diffstat (limited to 'src/server.c')
-rw-r--r--src/server.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/server.c b/src/server.c
index eaad37c07..f01e7382d 100644
--- a/src/server.c
+++ b/src/server.c
@@ -7202,12 +7202,7 @@ int main(int argc, char **argv) {
aofOpenIfNeededOnServerStart();
aofDelHistoryFiles();
if (server.cluster_enabled) {
- if (verifyClusterConfigWithData() == C_ERR) {
- serverLog(LL_WARNING,
- "You can't have keys in a DB different than DB 0 when in "
- "Cluster mode. Exiting.");
- exit(1);
- }
+ serverAssert(verifyClusterConfigWithData() == C_OK);
}
for (j = 0; j < CONN_TYPE_MAX; j++) {