提交 d5de8dc1 编写于 作者: S slguan

[TD-82] fix error while balance

上级 4f350284
...@@ -36,6 +36,7 @@ enum _TAOS_DN_STATUS { ...@@ -36,6 +36,7 @@ enum _TAOS_DN_STATUS {
int32_t clusterInit(); int32_t clusterInit();
void clusterCleanUp(); void clusterCleanUp();
char* clusterGetDnodeStatusStr(int32_t dnodeStatus); char* clusterGetDnodeStatusStr(int32_t dnodeStatus);
bool clusterCheckModuleInDnode(struct _dnode_obj *pDnode, int moduleType);
int32_t clusterInitDnodes(); int32_t clusterInitDnodes();
void clusterCleanupDnodes(); void clusterCleanupDnodes();
......
...@@ -323,8 +323,7 @@ static int32_t clusterRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, ...@@ -323,8 +323,7 @@ static int32_t clusterRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows,
char ipstr[32]; char ipstr[32];
while (numOfRows < rows) { while (numOfRows < rows) {
clusterReleaseDnode(pDnode); pShow->pNode = clusterGetNextDnode(pShow->pNode, &pDnode);
pShow->pNode = clusterGetNextDnode(pShow->pNode, (SDnodeObj **)&pDnode);
if (pDnode == NULL) break; if (pDnode == NULL) break;
cols = 0; cols = 0;
...@@ -366,13 +365,14 @@ static int32_t clusterRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, ...@@ -366,13 +365,14 @@ static int32_t clusterRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows,
#endif #endif
numOfRows++; numOfRows++;
clusterReleaseDnode(pDnode);
} }
pShow->numOfReads += numOfRows; pShow->numOfReads += numOfRows;
return numOfRows; return numOfRows;
} }
static bool clusterCheckModuleInDnode(SDnodeObj *pDnode, int32_t moduleType) { bool clusterCheckModuleInDnode(SDnodeObj *pDnode, int32_t moduleType) {
uint32_t status = pDnode->moduleStatus & (1 << moduleType); uint32_t status = pDnode->moduleStatus & (1 << moduleType);
return status > 0; return status > 0;
} }
......
...@@ -520,6 +520,11 @@ int32_t sdbInsertRow(SSdbOperDesc *pOper) { ...@@ -520,6 +520,11 @@ int32_t sdbInsertRow(SSdbOperDesc *pOper) {
if (pTable->keyType == SDB_KEY_TYPE_AUTO) { if (pTable->keyType == SDB_KEY_TYPE_AUTO) {
*((uint32_t *)pOper->pObj) = ++pTable->autoIndex; *((uint32_t *)pOper->pObj) = ++pTable->autoIndex;
// let vgId increase from 2
if (pTable->autoIndex == 1 && strcmp(pTable->tableName, "vgroups") == 0) {
*((uint32_t *)pOper->pObj) = ++pTable->autoIndex;
}
} }
pTable->version++; pTable->version++;
sdbVersion++; sdbVersion++;
......
...@@ -111,7 +111,12 @@ short tsDaysPerFile = 10; ...@@ -111,7 +111,12 @@ short tsDaysPerFile = 10;
int tsDaysToKeep = 3650; int tsDaysToKeep = 3650;
int tsReplications = TSDB_REPLICA_MIN_NUM; int tsReplications = TSDB_REPLICA_MIN_NUM;
#ifdef _MPEER
int tsNumOfMPeers = 3; int tsNumOfMPeers = 3;
#else
int tsNumOfMPeers = 1;
#endif
int tsMaxShellConns = 2000; int tsMaxShellConns = 2000;
int tsMaxTables = 100000; int tsMaxTables = 100000;
...@@ -552,9 +557,11 @@ static void doInitGlobalConfig() { ...@@ -552,9 +557,11 @@ static void doInitGlobalConfig() {
tsInitConfigOption(cfg++, "tblocks", &tsNumOfBlocksPerMeter, TSDB_CFG_VTYPE_SHORT, tsInitConfigOption(cfg++, "tblocks", &tsNumOfBlocksPerMeter, TSDB_CFG_VTYPE_SHORT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW,
32, 4096, 0, TSDB_CFG_UTYPE_NONE); 32, 4096, 0, TSDB_CFG_UTYPE_NONE);
#ifdef _MPEER
tsInitConfigOption(cfg++, "numOfMPeers", &tsNumOfMPeers, TSDB_CFG_VTYPE_INT, tsInitConfigOption(cfg++, "numOfMPeers", &tsNumOfMPeers, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLUSTER, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLUSTER,
1, 3, 0, TSDB_CFG_UTYPE_NONE); 1, 3, 0, TSDB_CFG_UTYPE_NONE);
#endif
tsInitConfigOption(cfg++, "balanceInterval", &tsBalanceStartInterval, TSDB_CFG_VTYPE_INT, tsInitConfigOption(cfg++, "balanceInterval", &tsBalanceStartInterval, TSDB_CFG_VTYPE_INT,
TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLUSTER, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLUSTER,
1, 30000, 0, TSDB_CFG_UTYPE_NONE); 1, 30000, 0, TSDB_CFG_UTYPE_NONE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册