diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 4e7a8ed6bd38e0973f40d858802901f61ca448c8..40e70c247ef2d8d4a1cce6db07ac9f48271a5085 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5280,8 +5280,8 @@ int32_t doLocalQueryProcess(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) { int32_t tscCheckCreateDbParams(SSqlCmd* pCmd, SCMCreateDbMsg* pCreate) { char msg[512] = {0}; - if (pCreate->commitLog != -1 && (pCreate->commitLog < 0 || pCreate->commitLog > 1)) { - snprintf(msg, tListLen(msg), "invalid db option commitLog: %d, only 0 or 1 allowed", pCreate->commitLog); + if (pCreate->commitLog != -1 && (pCreate->commitLog < 0 || pCreate->commitLog > 2)) { + snprintf(msg, tListLen(msg), "invalid db option commitLog: %d, only 0-2 allowed", pCreate->commitLog); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg); } diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index 0dfadd740484a80276ac8716c5c1bab5470518e7..8e523eaf46701981a5469acfc19135a3fc4013d4 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -163,6 +163,7 @@ static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *rpcMsg) { pCreate->cfg.vgId = htonl(pCreate->cfg.vgId); pCreate->cfg.maxSessions = htonl(pCreate->cfg.maxSessions); pCreate->cfg.daysPerFile = htonl(pCreate->cfg.daysPerFile); + pCreate->cfg.commitLog = pCreate->cfg.commitLog; return vnodeCreate(pCreate); } diff --git a/src/mnode/src/mgmtDb.c b/src/mnode/src/mgmtDb.c index 6a53b0d00183a18bf64cf89a88cd93896e29808f..7d13451f7ef3164becc2c2887a40039bff998ec4 100644 --- a/src/mnode/src/mgmtDb.c +++ b/src/mnode/src/mgmtDb.c @@ -166,8 +166,8 @@ SDbObj *mgmtGetDbByTableId(char *tableId) { } static int32_t mgmtCheckDBParams(SCMCreateDbMsg *pCreate) { - if (pCreate->commitLog < 0 || pCreate->commitLog > 1) { - mError("invalid db option commitLog: %d, only 0 or 1 allowed", pCreate->commitLog); + if (pCreate->commitLog < 0 || pCreate->commitLog > 2) { + mError("invalid db option commitLog: %d, only 0-2 allowed", pCreate->commitLog); return TSDB_CODE_INVALID_OPTION; } diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index b16b82cb4a009fb56b42864ef101f18dd47e0cb5..87f3872b0aaacba15c49a5e3678d94993518ad8a 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -490,6 +490,7 @@ SMDCreateVnodeMsg *mgmtBuildCreateVnodeMsg(SVgObj *pVgroup) { pCfg->daysToKeep2 = htonl(pCfg->daysToKeep2); pCfg->daysToKeep = htonl(pCfg->daysToKeep); pCfg->commitTime = htonl(pCfg->commitTime); + pCfg->commitLog = pCfg->commitLog; pCfg->blocksPerTable = htons(pCfg->blocksPerTable); pCfg->replications = (char) pVgroup->numOfVnodes; pCfg->rowsInFileBlock = htonl(pCfg->rowsInFileBlock); diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 0287285f4db64b611ba29cfdfc72506e4bbbf08e..8a0d66068e92e5823788f8104885205e19de6708 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -632,7 +632,7 @@ static void doInitGlobalConfig() { tsInitConfigOption(cfg++, "clog", &tsCommitLog, TSDB_CFG_VTYPE_SHORT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW, - 0, 1, 0, TSDB_CFG_UTYPE_NONE); + 0, 2, 0, TSDB_CFG_UTYPE_NONE); tsInitConfigOption(cfg++, "comp", &tsCompression, TSDB_CFG_VTYPE_SHORT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW, 0, 2, 0, TSDB_CFG_UTYPE_NONE); diff --git a/src/vnode/main/src/vnodeMain.c b/src/vnode/main/src/vnodeMain.c index d852d4156177058340d7acb6c0a02cb4acddff47..1be9bbb64be2807c3c44d3ca83d789b82f563bb7 100644 --- a/src/vnode/main/src/vnodeMain.c +++ b/src/vnode/main/src/vnodeMain.c @@ -88,7 +88,7 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) { return code; } - dPrint("vgId:%d, vnode is created", pVnodeCfg->cfg.vgId); + dPrint("vgId:%d, vnode is created, clog:%d", pVnodeCfg->cfg.vgId, pVnodeCfg->cfg.commitLog); code = vnodeOpen(pVnodeCfg->cfg.vgId, rootDir); return code;