From 4ee2f63374b06e8e8e35f2cfdfebb77c71a29a14 Mon Sep 17 00:00:00 2001 From: slguan Date: Thu, 11 Jul 2019 19:01:36 +0800 Subject: [PATCH] Check the replica parameters when creating the database --- src/system/src/mgmtDb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/system/src/mgmtDb.c b/src/system/src/mgmtDb.c index 143828f30d..63d3759a66 100644 --- a/src/system/src/mgmtDb.c +++ b/src/system/src/mgmtDb.c @@ -126,7 +126,11 @@ int mgmtCheckDbParams(SCreateDbMsg *pCreate) { if (pCreate->replications < 0) pCreate->replications = 1; // if (pCreate->rowsInFileBlock < 0) pCreate->rowsInFileBlock = tsRowsInFileBlock; // if (pCreate->cacheNumOfBlocks.fraction < 0) pCreate->cacheNumOfBlocks.fraction = tsAverageCacheBlocks; // - pCreate->replications = 1; + + if (pCreate->replications != 1) { + mTrace("invalid db option replications: %d", pCreate->replications); + return TSDB_CODE_INVALID_OPTION; + } if (pCreate->commitLog < 0 || pCreate->commitLog > 1) { mTrace("invalid db option commitLog: %d", pCreate->commitLog); -- GitLab