diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 41464aa660e22236c4e3fe125739fc2913fd0e9a..ffe42de2362d3d8a837290799d656b9d32fe96bd 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -43,7 +43,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, void (*fp)(), void* param, const pSql->signature = pSql; pSql->param = param; pSql->pTscObj = pObj; - pSql->maxRetry = TSDB_MAX_REPLICA_NUM; + pSql->maxRetry = TSDB_MAX_REPLICA; pSql->fp = fp; pSql->sqlstr = calloc(1, sqlLen + 1); diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 9f0d1a26abd93f8dfb52db0e03feb20529c07904..0cf69dfd4636d38927cb1094af1c3da6ba9d54ee 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -497,7 +497,7 @@ TAOS_STMT* taos_stmt_init(TAOS* taos) { tsem_init(&pSql->rspSem, 0, 0); pSql->signature = pSql; pSql->pTscObj = pObj; - pSql->maxRetry = TSDB_MAX_REPLICA_NUM; + pSql->maxRetry = TSDB_MAX_REPLICA; pStmt->pSql = pSql; return pStmt; diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 44d10ec2c41fb1840d6ee494598596cb3d568c27..ca6dfcee9efb03058ad2401ed57f2dce6f581d59 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -5489,9 +5489,9 @@ int32_t tscCheckCreateDbParams(SSqlCmd* pCmd, SCMCreateDbMsg* pCreate) { } if (pCreate->replications != -1 && - (pCreate->replications < TSDB_MIN_REPLICA_NUM || pCreate->replications > TSDB_MAX_REPLICA_NUM)) { + (pCreate->replications < TSDB_MIN_DB_REPLICA_OPTION || pCreate->replications > TSDB_MAX_DB_REPLICA_OPTION)) { snprintf(msg, tListLen(msg), "invalid db option replications: %d valid range: [%d, %d]", pCreate->replications, - TSDB_MIN_REPLICA_NUM, TSDB_MAX_REPLICA_NUM); + TSDB_MIN_DB_REPLICA_OPTION, TSDB_MAX_DB_REPLICA_OPTION); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg); } diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 6d75aef01f085226fb27ba81ceb611b7c97527cc..73b93435ad1e8224707bdcf6f029d77ee4d51737 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -113,7 +113,7 @@ SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con pSql->pTscObj = pObj; pSql->signature = pSql; - pSql->maxRetry = TSDB_MAX_REPLICA_NUM; + pSql->maxRetry = TSDB_MAX_REPLICA; tsem_init(&pSql->rspSem, 0, 0); pObj->pDnodeConn = pDnodeConn; diff --git a/src/client/src/tscSub.c b/src/client/src/tscSub.c index f7d03bd787d1d8d568ff773e0f1d5b6f9b111ec1..2c5035c2ef66ddc40c5551b335a51acfd8a6b14a 100644 --- a/src/client/src/tscSub.c +++ b/src/client/src/tscSub.c @@ -107,7 +107,7 @@ static SSub* tscCreateSubscription(STscObj* pObj, const char* topic, const char* pSql->signature = pSql; pSql->param = pSql; pSql->pTscObj = pObj; - pSql->maxRetry = TSDB_MAX_REPLICA_NUM; + pSql->maxRetry = TSDB_MAX_REPLICA; pSql->fp = asyncCallback; int code = tscAllocPayload(pCmd, TSDB_DEFAULT_PAYLOAD_SIZE); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index c4641afbf38eed7ef6b8f6ad8ade6b488a038010..eea5d60f64cedd0442d69ac96f21bc920bae2c90 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1649,7 +1649,7 @@ SSqlObj* createSimpleSubObj(SSqlObj* pSql, void (*fp)(), void* param, int32_t cm pNew->fp = fp; pNew->param = param; - pNew->maxRetry = TSDB_MAX_REPLICA_NUM; + pNew->maxRetry = TSDB_MAX_REPLICA; pNew->sqlstr = strdup(pSql->sqlstr); if (pNew->sqlstr == NULL) { @@ -1804,7 +1804,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void pNew->fp = fp; pNew->param = param; - pNew->maxRetry = TSDB_MAX_REPLICA_NUM; + pNew->maxRetry = TSDB_MAX_REPLICA; char* name = pTableMetaInfo->name; STableMetaInfo* pFinalInfo = NULL; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 40c1ee4280e68098f51140b61798fd931a770857..a8ef3f8e8d348b6b67fae6cc1dcd3f810b57e3ec 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -110,7 +110,7 @@ int16_t tsCommitTime = TSDB_DEFAULT_COMMIT_TIME; // seconds int32_t tsTimePrecision = TSDB_DEFAULT_PRECISION; int16_t tsCompression = TSDB_DEFAULT_COMP_LEVEL; int16_t tsWAL = TSDB_DEFAULT_WAL_LEVEL; -int32_t tsReplications = TSDB_DEFAULT_REPLICA_NUM; +int32_t tsReplications = TSDB_DEFAULT_DB_REPLICA_OPTION; int32_t tsMaxVgroupsPerDb = 0; int32_t tsMaxTablePerVnode = TSDB_DEFAULT_TABLES; // balance @@ -706,8 +706,8 @@ static void doInitGlobalConfig() { cfg.ptr = &tsReplications; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; - cfg.minValue = TSDB_MIN_REPLICA_NUM; - cfg.maxValue = TSDB_MAX_REPLICA_NUM; + cfg.minValue = TSDB_MIN_DB_REPLICA_OPTION; + cfg.maxValue = TSDB_MAX_DB_REPLICA_OPTION; cfg.ptrLength = 0; cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index 8e4d8c4253fec81b8bc9b2c5ec83f10f799b7dcc..eb3c3abc840121043e7a36ef884f63f4c5caef57 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -332,9 +332,9 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size); #define TSDB_MAX_WAL_LEVEL 2 #define TSDB_DEFAULT_WAL_LEVEL 1 -#define TSDB_MIN_REPLICA_NUM 1 -#define TSDB_MAX_REPLICA_NUM 3 -#define TSDB_DEFAULT_REPLICA_NUM 1 +#define TSDB_MIN_DB_REPLICA_OPTION 1 +#define TSDB_MAX_DB_REPLICA_OPTION 3 +#define TSDB_DEFAULT_DB_REPLICA_OPTION 1 #define TSDB_MAX_JOIN_TABLE_NUM 5 #define TSDB_MAX_UNION_CLAUSE 5 diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index f05392b10a67046e97b67c7e548290455e6d428f..d96e9f68d5a33addb84ca08d286be7b88b62db30 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -646,7 +646,7 @@ typedef struct SCMSTableVgroupMsg { typedef struct { int32_t vgId; int8_t numOfIps; - SIpAddr ipAddr[TSDB_MAX_REPLICA_NUM]; + SIpAddr ipAddr[TSDB_MAX_REPLICA]; } SCMVgroupInfo; typedef struct { diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index 497d64eabf82f8b10a87e97809d84ab0158eda19..e8183e9089bd97cc40c20368cfcfa25ca450a368 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -287,9 +287,9 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) { return TSDB_CODE_MND_INVALID_DB_OPTION; } - if (pCfg->replications < TSDB_MIN_REPLICA_NUM || pCfg->replications > TSDB_MAX_REPLICA_NUM) { - mError("invalid db option replications:%d valid range: [%d, %d]", pCfg->replications, TSDB_MIN_REPLICA_NUM, - TSDB_MAX_REPLICA_NUM); + if (pCfg->replications < TSDB_MIN_DB_REPLICA_OPTION || pCfg->replications > TSDB_MAX_DB_REPLICA_OPTION) { + mError("invalid db option replications:%d valid range: [%d, %d]", pCfg->replications, TSDB_MIN_DB_REPLICA_OPTION, + TSDB_MAX_DB_REPLICA_OPTION); return TSDB_CODE_MND_INVALID_DB_OPTION; }