Check the replica parameters when creating the database

This commit is contained in:
slguan 2019-07-11 19:01:36 +08:00
parent 05c8a3313f
commit 4ee2f63374
1 changed files with 5 additions and 1 deletions

View File

@ -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);