TD-1983 change hash in mnode
This commit is contained in:
parent
5f3797c11f
commit
3e43a65331
|
@ -162,7 +162,6 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
|
||||||
pDnode->openVnodes, pDnode->diskAvailable, pDnode->alternativeRole);
|
pDnode->openVnodes, pDnode->diskAvailable, pDnode->alternativeRole);
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
if (mnodeGetOnlineDnodesNum() == 0) {
|
if (mnodeGetOnlineDnodesNum() == 0) {
|
||||||
return TSDB_CODE_MND_NOT_READY;
|
return TSDB_CODE_MND_NOT_READY;
|
||||||
|
@ -377,15 +376,13 @@ static bool balanceMonitorBalance() {
|
||||||
srcScore, pDestDnode->score, destScore);
|
srcScore, pDestDnode->score, destScore);
|
||||||
balanceAddVnode(pVgroup, pSrcDnode, pDestDnode);
|
balanceAddVnode(pVgroup, pSrcDnode, pDestDnode);
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextVgroup(pIter);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -413,8 +410,6 @@ void balanceReset() {
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
tsAccessSquence = 0;
|
tsAccessSquence = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,12 +438,11 @@ static int32_t balanceMonitorVgroups() {
|
||||||
|
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
if (code == TSDB_CODE_SUCCESS) {
|
if (code == TSDB_CODE_SUCCESS) {
|
||||||
|
mnodeCancelGetNextVgroup(pIter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
return hasUpdatingVgroup;
|
return hasUpdatingVgroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -465,11 +459,12 @@ static bool balanceMonitorDnodeDropping(SDnodeObj *pDnode) {
|
||||||
hasThisDnode = balanceCheckDnodeInVgroup(pDnode, pVgroup);
|
hasThisDnode = balanceCheckDnodeInVgroup(pDnode, pVgroup);
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
|
|
||||||
if (hasThisDnode) break;
|
if (hasThisDnode) {
|
||||||
|
mnodeCancelGetNextVgroup(pIter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
if (!hasThisDnode) {
|
if (!hasThisDnode) {
|
||||||
mInfo("dnode:%d, dropped for all vnodes are moving to other dnodes", pDnode->dnodeId);
|
mInfo("dnode:%d, dropped for all vnodes are moving to other dnodes", pDnode->dnodeId);
|
||||||
mnodeDropDnode(pDnode, NULL);
|
mnodeDropDnode(pDnode, NULL);
|
||||||
|
@ -499,20 +494,18 @@ static bool balanceMontiorDropping() {
|
||||||
pDnode->status = TAOS_DN_STATUS_DROPPING;
|
pDnode->status = TAOS_DN_STATUS_DROPPING;
|
||||||
mnodeUpdateDnode(pDnode);
|
mnodeUpdateDnode(pDnode);
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextDnode(pIter);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDnode->status == TAOS_DN_STATUS_DROPPING) {
|
if (pDnode->status == TAOS_DN_STATUS_DROPPING) {
|
||||||
bool ret = balanceMonitorDnodeDropping(pDnode);
|
bool ret = balanceMonitorDnodeDropping(pDnode);
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextDnode(pIter);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,8 +549,6 @@ static void balanceSetVgroupOffline(SDnodeObj* pDnode) {
|
||||||
}
|
}
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void balanceCheckDnodeAccess() {
|
static void balanceCheckDnodeAccess() {
|
||||||
|
@ -578,8 +569,6 @@ static void balanceCheckDnodeAccess() {
|
||||||
}
|
}
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void balanceProcessBalanceTimer(void *handle, void *tmrId) {
|
static void balanceProcessBalanceTimer(void *handle, void *tmrId) {
|
||||||
|
@ -630,6 +619,7 @@ void balanceAsyncNotify() {
|
||||||
int32_t balanceInit() {
|
int32_t balanceInit() {
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_SCORES, balanceGetScoresMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_SCORES, balanceGetScoresMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_SCORES, balanceRetrieveScores);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_SCORES, balanceRetrieveScores);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_SCORES, mnodeCancelGetNextDnode);
|
||||||
|
|
||||||
pthread_mutex_init(&tsBalanceMutex, NULL);
|
pthread_mutex_init(&tsBalanceMutex, NULL);
|
||||||
balanceInitDnodeList();
|
balanceInitDnodeList();
|
||||||
|
@ -667,8 +657,6 @@ int32_t balanceDropDnode(SDnodeObj *pDnode) {
|
||||||
mnodeDecDnodeRef(pTempDnode);
|
mnodeDecDnodeRef(pTempDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
if (pDnode->openVnodes > totalFreeVnodes) {
|
if (pDnode->openVnodes > totalFreeVnodes) {
|
||||||
mError("dnode:%d, openVnodes:%d totalFreeVnodes:%d no enough dnodes", pDnode->dnodeId, pDnode->openVnodes, totalFreeVnodes);
|
mError("dnode:%d, openVnodes:%d totalFreeVnodes:%d no enough dnodes", pDnode->dnodeId, pDnode->openVnodes, totalFreeVnodes);
|
||||||
return TSDB_CODE_MND_NO_ENOUGH_DNODES;
|
return TSDB_CODE_MND_NO_ENOUGH_DNODES;
|
||||||
|
@ -780,8 +768,12 @@ void balanceAccquireDnodeList() {
|
||||||
SDnodeObj *pDnode = NULL;
|
SDnodeObj *pDnode = NULL;
|
||||||
int32_t dnodeIndex = 0;
|
int32_t dnodeIndex = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (dnodeIndex >= dnodesNum) break;
|
if (dnodeIndex >= dnodesNum) {
|
||||||
|
mnodeCancelGetNextDnode(pIter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
pIter = mnodeGetNextDnode(pIter, &pDnode);
|
pIter = mnodeGetNextDnode(pIter, &pDnode);
|
||||||
if (pDnode == NULL) break;
|
if (pDnode == NULL) break;
|
||||||
if (pDnode->status == TAOS_DN_STATUS_OFFLINE) {
|
if (pDnode->status == TAOS_DN_STATUS_OFFLINE) {
|
||||||
|
@ -802,8 +794,6 @@ void balanceAccquireDnodeList() {
|
||||||
dnodeIndex++;
|
dnodeIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
tsBalanceDnodeListSize = dnodeIndex;
|
tsBalanceDnodeListSize = dnodeIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ void mnodeCleanupAccts();
|
||||||
void mnodeGetStatOfAllAcct(SAcctInfo* pAcctInfo);
|
void mnodeGetStatOfAllAcct(SAcctInfo* pAcctInfo);
|
||||||
void * mnodeGetAcct(char *acctName);
|
void * mnodeGetAcct(char *acctName);
|
||||||
void * mnodeGetNextAcct(void *pIter, SAcctObj **pAcct);
|
void * mnodeGetNextAcct(void *pIter, SAcctObj **pAcct);
|
||||||
|
void mnodeCancelGetNextAcct(void *pIter);
|
||||||
void mnodeIncAcctRef(SAcctObj *pAcct);
|
void mnodeIncAcctRef(SAcctObj *pAcct);
|
||||||
void mnodeDecAcctRef(SAcctObj *pAcct);
|
void mnodeDecAcctRef(SAcctObj *pAcct);
|
||||||
void mnodeAddDbToAcct(SAcctObj *pAcct, SDbObj *pDb);
|
void mnodeAddDbToAcct(SAcctObj *pAcct, SDbObj *pDb);
|
||||||
|
|
|
@ -34,6 +34,7 @@ int64_t mnodeGetDbNum();
|
||||||
SDbObj *mnodeGetDb(char *db);
|
SDbObj *mnodeGetDb(char *db);
|
||||||
SDbObj *mnodeGetDbByTableId(char *db);
|
SDbObj *mnodeGetDbByTableId(char *db);
|
||||||
void * mnodeGetNextDb(void *pIter, SDbObj **pDb);
|
void * mnodeGetNextDb(void *pIter, SDbObj **pDb);
|
||||||
|
void mnodeCancelGetNextDb(void *pIter);
|
||||||
void mnodeIncDbRef(SDbObj *pDb);
|
void mnodeIncDbRef(SDbObj *pDb);
|
||||||
void mnodeDecDbRef(SDbObj *pDb);
|
void mnodeDecDbRef(SDbObj *pDb);
|
||||||
bool mnodeCheckIsMonitorDB(char *db, char *monitordb);
|
bool mnodeCheckIsMonitorDB(char *db, char *monitordb);
|
||||||
|
|
|
@ -65,6 +65,7 @@ int32_t mnodeGetDnodesNum();
|
||||||
int32_t mnodeGetOnlinDnodesCpuCoreNum();
|
int32_t mnodeGetOnlinDnodesCpuCoreNum();
|
||||||
int32_t mnodeGetOnlineDnodesNum();
|
int32_t mnodeGetOnlineDnodesNum();
|
||||||
void * mnodeGetNextDnode(void *pIter, SDnodeObj **pDnode);
|
void * mnodeGetNextDnode(void *pIter, SDnodeObj **pDnode);
|
||||||
|
void mnodeCancelGetNextDnode(void *pIter);
|
||||||
void mnodeIncDnodeRef(SDnodeObj *pDnode);
|
void mnodeIncDnodeRef(SDnodeObj *pDnode);
|
||||||
void mnodeDecDnodeRef(SDnodeObj *pDnode);
|
void mnodeDecDnodeRef(SDnodeObj *pDnode);
|
||||||
void * mnodeGetDnode(int32_t dnodeId);
|
void * mnodeGetDnode(int32_t dnodeId);
|
||||||
|
|
|
@ -38,6 +38,7 @@ void mnodeDropMnodeLocal(int32_t dnodeId);
|
||||||
void * mnodeGetMnode(int32_t mnodeId);
|
void * mnodeGetMnode(int32_t mnodeId);
|
||||||
int32_t mnodeGetMnodesNum();
|
int32_t mnodeGetMnodesNum();
|
||||||
void * mnodeGetNextMnode(void *pIter, struct SMnodeObj **pMnode);
|
void * mnodeGetNextMnode(void *pIter, struct SMnodeObj **pMnode);
|
||||||
|
void mnodeCancelGetNextMnode(void *pIter);
|
||||||
void mnodeIncMnodeRef(struct SMnodeObj *pMnode);
|
void mnodeIncMnodeRef(struct SMnodeObj *pMnode);
|
||||||
void mnodeDecMnodeRef(struct SMnodeObj *pMnode);
|
void mnodeDecMnodeRef(struct SMnodeObj *pMnode);
|
||||||
|
|
||||||
|
|
|
@ -92,9 +92,9 @@ int32_t sdbDeleteRow(SSdbRow *pRow);
|
||||||
int32_t sdbUpdateRow(SSdbRow *pRow);
|
int32_t sdbUpdateRow(SSdbRow *pRow);
|
||||||
int32_t sdbInsertRowToQueue(SSdbRow *pRow);
|
int32_t sdbInsertRowToQueue(SSdbRow *pRow);
|
||||||
|
|
||||||
void *sdbGetRow(void *pTable, void *key);
|
void * sdbGetRow(void *pTable, void *key);
|
||||||
void *sdbFetchRow(void *pTable, void *pIter, void **ppRow);
|
void * sdbFetchRow(void *pTable, void *pIter, void **ppRow);
|
||||||
void sdbFreeIter(void *pIter);
|
void sdbFreeIter(void *pTable, void *pIter);
|
||||||
void sdbIncRef(void *pTable, void *pRow);
|
void sdbIncRef(void *pTable, void *pRow);
|
||||||
void sdbDecRef(void *pTable, void *pRow);
|
void sdbDecRef(void *pTable, void *pRow);
|
||||||
int64_t sdbGetNumOfRows(void *pTable);
|
int64_t sdbGetNumOfRows(void *pTable);
|
||||||
|
|
|
@ -26,8 +26,10 @@ void mnodeCleanUpShow();
|
||||||
|
|
||||||
typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
||||||
typedef int32_t (*SShowRetrieveFp)(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
typedef int32_t (*SShowRetrieveFp)(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
||||||
|
typedef void (*SShowFreeIterFp)(void *pIter);
|
||||||
void mnodeAddShowMetaHandle(uint8_t showType, SShowMetaFp fp);
|
void mnodeAddShowMetaHandle(uint8_t showType, SShowMetaFp fp);
|
||||||
void mnodeAddShowRetrieveHandle(uint8_t showType, SShowRetrieveFp fp);
|
void mnodeAddShowRetrieveHandle(uint8_t showType, SShowRetrieveFp fp);
|
||||||
|
void mnodeAddShowFreeIterHandle(uint8_t msgType, SShowFreeIterFp fp);
|
||||||
void mnodeVacuumResult(char *data, int32_t numOfCols, int32_t rows, int32_t capacity, SShowObj *pShow);
|
void mnodeVacuumResult(char *data, int32_t numOfCols, int32_t rows, int32_t capacity, SShowObj *pShow);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -31,6 +31,8 @@ void mnodeIncTableRef(void *pTable);
|
||||||
void mnodeDecTableRef(void *pTable);
|
void mnodeDecTableRef(void *pTable);
|
||||||
void * mnodeGetNextChildTable(void *pIter, SCTableObj **pTable);
|
void * mnodeGetNextChildTable(void *pIter, SCTableObj **pTable);
|
||||||
void * mnodeGetNextSuperTable(void *pIter, SSTableObj **pTable);
|
void * mnodeGetNextSuperTable(void *pIter, SSTableObj **pTable);
|
||||||
|
void mnodeCancelGetNextChildTable(void *pIter);
|
||||||
|
void mnodeCancelGetNextSuperTable(void *pIter);
|
||||||
void mnodeDropAllChildTables(SDbObj *pDropDb);
|
void mnodeDropAllChildTables(SDbObj *pDropDb);
|
||||||
void mnodeDropAllSuperTables(SDbObj *pDropDb);
|
void mnodeDropAllSuperTables(SDbObj *pDropDb);
|
||||||
void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup);
|
void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup);
|
||||||
|
|
|
@ -25,6 +25,7 @@ int32_t mnodeInitUsers();
|
||||||
void mnodeCleanupUsers();
|
void mnodeCleanupUsers();
|
||||||
SUserObj *mnodeGetUser(char *name);
|
SUserObj *mnodeGetUser(char *name);
|
||||||
void * mnodeGetNextUser(void *pIter, SUserObj **pUser);
|
void * mnodeGetNextUser(void *pIter, SUserObj **pUser);
|
||||||
|
void mnodeCancelGetNextUser(void *pIter);
|
||||||
void mnodeIncUserRef(SUserObj *pUser);
|
void mnodeIncUserRef(SUserObj *pUser);
|
||||||
void mnodeDecUserRef(SUserObj *pUser);
|
void mnodeDecUserRef(SUserObj *pUser);
|
||||||
SUserObj *mnodeGetUserFromConn(void *pConn);
|
SUserObj *mnodeGetUserFromConn(void *pConn);
|
||||||
|
|
|
@ -34,6 +34,7 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode);
|
||||||
//void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb);
|
//void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb);
|
||||||
|
|
||||||
void * mnodeGetNextVgroup(void *pIter, SVgObj **pVgroup);
|
void * mnodeGetNextVgroup(void *pIter, SVgObj **pVgroup);
|
||||||
|
void mnodeCancelGetNextVgroup(void *pIter);
|
||||||
void mnodeUpdateVgroup(SVgObj *pVgroup);
|
void mnodeUpdateVgroup(SVgObj *pVgroup);
|
||||||
void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVload);
|
void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVload);
|
||||||
void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t openVnodes);
|
void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t openVnodes);
|
||||||
|
|
|
@ -144,7 +144,6 @@ void mnodeGetStatOfAllAcct(SAcctInfo* pAcctInfo) {
|
||||||
pAcctInfo->numOfTimeSeries += pAcct->acctInfo.numOfTimeSeries;
|
pAcctInfo->numOfTimeSeries += pAcct->acctInfo.numOfTimeSeries;
|
||||||
mnodeDecAcctRef(pAcct);
|
mnodeDecAcctRef(pAcct);
|
||||||
}
|
}
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
SVgObj *pVgroup = NULL;
|
SVgObj *pVgroup = NULL;
|
||||||
pIter = NULL;
|
pIter = NULL;
|
||||||
|
@ -158,7 +157,6 @@ void mnodeGetStatOfAllAcct(SAcctInfo* pAcctInfo) {
|
||||||
pAcctInfo->totalPoints += pVgroup->pointsWritten;
|
pAcctInfo->totalPoints += pVgroup->pointsWritten;
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
sdbFreeIter(pIter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *mnodeGetAcct(char *name) {
|
void *mnodeGetAcct(char *name) {
|
||||||
|
@ -169,6 +167,10 @@ void *mnodeGetNextAcct(void *pIter, SAcctObj **pAcct) {
|
||||||
return sdbFetchRow(tsAcctSdb, pIter, (void **)pAcct);
|
return sdbFetchRow(tsAcctSdb, pIter, (void **)pAcct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextAcct(void *pIter) {
|
||||||
|
sdbFreeIter(tsAcctSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
void mnodeIncAcctRef(SAcctObj *pAcct) {
|
void mnodeIncAcctRef(SAcctObj *pAcct) {
|
||||||
sdbIncRef(tsAcctSdb, pAcct);
|
sdbIncRef(tsAcctSdb, pAcct);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ static int32_t mnodeCreateCluster();
|
||||||
|
|
||||||
static int32_t mnodeGetClusterMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
static int32_t mnodeGetClusterMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
||||||
static int32_t mnodeRetrieveClusters(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
static int32_t mnodeRetrieveClusters(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
||||||
|
static void mnodeCancelGetNextCluster(void *pIter);
|
||||||
|
|
||||||
static int32_t mnodeClusterActionDestroy(SSdbRow *pRow) {
|
static int32_t mnodeClusterActionDestroy(SSdbRow *pRow) {
|
||||||
tfree(pRow->pObj);
|
tfree(pRow->pObj);
|
||||||
|
@ -108,6 +109,7 @@ int32_t mnodeInitCluster() {
|
||||||
|
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_CLUSTER, mnodeGetClusterMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_CLUSTER, mnodeGetClusterMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_CLUSTER, mnodeRetrieveClusters);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_CLUSTER, mnodeRetrieveClusters);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_CLUSTER, mnodeCancelGetNextCluster);
|
||||||
|
|
||||||
mDebug("table:%s, hash is created", desc.name);
|
mDebug("table:%s, hash is created", desc.name);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -122,6 +124,10 @@ void *mnodeGetNextCluster(void *pIter, SClusterObj **pCluster) {
|
||||||
return sdbFetchRow(tsClusterSdb, pIter, (void **)pCluster);
|
return sdbFetchRow(tsClusterSdb, pIter, (void **)pCluster);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextCluster(void *pIter) {
|
||||||
|
sdbFreeIter(tsClusterSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
void mnodeIncClusterRef(SClusterObj *pCluster) {
|
void mnodeIncClusterRef(SClusterObj *pCluster) {
|
||||||
sdbIncRef(tsClusterSdb, pCluster);
|
sdbIncRef(tsClusterSdb, pCluster);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +173,7 @@ void mnodeUpdateClusterId() {
|
||||||
}
|
}
|
||||||
|
|
||||||
mnodeDecClusterRef(pCluster);
|
mnodeDecClusterRef(pCluster);
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextCluster(pIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t mnodeGetClusterMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
|
static int32_t mnodeGetClusterMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
|
||||||
|
|
|
@ -171,6 +171,7 @@ int32_t mnodeInitDbs() {
|
||||||
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_DROP_DB, mnodeProcessDropDbMsg);
|
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_DROP_DB, mnodeProcessDropDbMsg);
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DB, mnodeGetDbMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DB, mnodeGetDbMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DB, mnodeRetrieveDbs);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DB, mnodeRetrieveDbs);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_DB, mnodeCancelGetNextDb);
|
||||||
|
|
||||||
mDebug("table:dbs table is created");
|
mDebug("table:dbs table is created");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -180,6 +181,10 @@ void *mnodeGetNextDb(void *pIter, SDbObj **pDb) {
|
||||||
return sdbFetchRow(tsDbSdb, pIter, (void **)pDb);
|
return sdbFetchRow(tsDbSdb, pIter, (void **)pDb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextDb(void *pIter) {
|
||||||
|
sdbFreeIter(tsDbSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
SDbObj *mnodeGetDb(char *db) {
|
SDbObj *mnodeGetDb(char *db) {
|
||||||
return (SDbObj *)sdbGetRow(tsDbSdb, db);
|
return (SDbObj *)sdbGetRow(tsDbSdb, db);
|
||||||
}
|
}
|
||||||
|
@ -986,8 +991,8 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) {
|
||||||
SDbObj *pDb = pMsg->pDb;
|
SDbObj *pDb = pMsg->pDb;
|
||||||
|
|
||||||
void *pIter = NULL;
|
void *pIter = NULL;
|
||||||
while (1) {
|
SVgObj *pVgroup = NULL;
|
||||||
SVgObj *pVgroup = NULL;
|
while (1) {
|
||||||
pIter = mnodeGetNextVgroup(pIter, &pVgroup);
|
pIter = mnodeGetNextVgroup(pIter, &pVgroup);
|
||||||
if (pVgroup == NULL) break;
|
if (pVgroup == NULL) break;
|
||||||
if (pVgroup->pDb == pDb) {
|
if (pVgroup->pDb == pDb) {
|
||||||
|
@ -995,7 +1000,6 @@ static int32_t mnodeAlterDbCb(SMnodeMsg *pMsg, int32_t code) {
|
||||||
}
|
}
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mDebug("db:%s, all vgroups is altered", pDb->name);
|
mDebug("db:%s, all vgroups is altered", pDb->name);
|
||||||
mLInfo("db:%s, is alterd by %s", pDb->name, mnodeGetUserFromMsg(pMsg));
|
mLInfo("db:%s, is alterd by %s", pDb->name, mnodeGetUserFromMsg(pMsg));
|
||||||
|
@ -1146,7 +1150,5 @@ void mnodeDropAllDbs(SAcctObj *pAcct) {
|
||||||
mnodeDecDbRef(pDb);
|
mnodeDecDbRef(pDb);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("acct:%s, all dbs:%d is dropped from sdb", pAcct->user, numOfDbs);
|
mInfo("acct:%s, all dbs:%d is dropped from sdb", pAcct->user, numOfDbs);
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,6 +206,7 @@ int32_t mnodeInitDnodes() {
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_VNODES, mnodeRetrieveVnodes);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_VNODES, mnodeRetrieveVnodes);
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DNODE, mnodeGetDnodeMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DNODE, mnodeGetDnodeMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DNODE, mnodeRetrieveDnodes);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DNODE, mnodeRetrieveDnodes);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_DNODE, mnodeCancelGetNextDnode);
|
||||||
|
|
||||||
mDebug("table:dnodes table is created");
|
mDebug("table:dnodes table is created");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -223,6 +224,10 @@ void *mnodeGetNextDnode(void *pIter, SDnodeObj **pDnode) {
|
||||||
return sdbFetchRow(tsDnodeSdb, pIter, (void **)pDnode);
|
return sdbFetchRow(tsDnodeSdb, pIter, (void **)pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextDnode(void *pIter) {
|
||||||
|
sdbFreeIter(tsDnodeSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
int32_t mnodeGetDnodesNum() {
|
int32_t mnodeGetDnodesNum() {
|
||||||
return sdbGetNumOfRows(tsDnodeSdb);
|
return sdbGetNumOfRows(tsDnodeSdb);
|
||||||
}
|
}
|
||||||
|
@ -241,8 +246,6 @@ int32_t mnodeGetOnlinDnodesCpuCoreNum() {
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
if (cpuCores < 2) cpuCores = 2;
|
if (cpuCores < 2) cpuCores = 2;
|
||||||
return cpuCores;
|
return cpuCores;
|
||||||
}
|
}
|
||||||
|
@ -259,8 +262,6 @@ int32_t mnodeGetOnlineDnodesNum() {
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
return onlineDnodes;
|
return onlineDnodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,13 +277,12 @@ void *mnodeGetDnodeByEp(char *ep) {
|
||||||
pIter = mnodeGetNextDnode(pIter, &pDnode);
|
pIter = mnodeGetNextDnode(pIter, &pDnode);
|
||||||
if (pDnode == NULL) break;
|
if (pDnode == NULL) break;
|
||||||
if (strcmp(ep, pDnode->dnodeEp) == 0) {
|
if (strcmp(ep, pDnode->dnodeEp) == 0) {
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextDnode(pIter);
|
||||||
return pDnode;
|
return pDnode;
|
||||||
}
|
}
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -464,7 +464,10 @@ static void mnodeUpdateDnodeEps() {
|
||||||
while (1) {
|
while (1) {
|
||||||
pIter = mnodeGetNextDnode(pIter, &pDnode);
|
pIter = mnodeGetNextDnode(pIter, &pDnode);
|
||||||
if (pDnode == NULL) break;
|
if (pDnode == NULL) break;
|
||||||
if (dnodesNum >= totalDnodes) break;
|
if (dnodesNum >= totalDnodes) {
|
||||||
|
mnodeCancelGetNextDnode(pIter);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
SDnodeEp *pEp = &tsDnodeEps->dnodeEps[dnodesNum];
|
SDnodeEp *pEp = &tsDnodeEps->dnodeEps[dnodesNum];
|
||||||
dnodesNum++;
|
dnodesNum++;
|
||||||
|
@ -474,7 +477,6 @@ static void mnodeUpdateDnodeEps() {
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
pthread_mutex_unlock(&tsDnodeEpsMutex);
|
pthread_mutex_unlock(&tsDnodeEpsMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1100,7 +1102,7 @@ static int32_t mnodeGetVnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
|
||||||
pDnode = mnodeGetDnodeByEp(pShow->payload);
|
pDnode = mnodeGetDnodeByEp(pShow->payload);
|
||||||
} else {
|
} else {
|
||||||
void *pIter = mnodeGetNextDnode(NULL, (SDnodeObj **)&pDnode);
|
void *pIter = mnodeGetNextDnode(NULL, (SDnodeObj **)&pDnode);
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextDnode(pIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDnode != NULL) {
|
if (pDnode != NULL) {
|
||||||
|
@ -1148,7 +1150,6 @@ static int32_t mnodeRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, vo
|
||||||
|
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
sdbFreeIter(pIter);
|
|
||||||
} else {
|
} else {
|
||||||
numOfRows = 0;
|
numOfRows = 0;
|
||||||
}
|
}
|
||||||
|
@ -1217,8 +1218,6 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
if (pSelDnode == NULL) {
|
if (pSelDnode == NULL) {
|
||||||
mError("failed to alloc vnode to vgroup");
|
mError("failed to alloc vnode to vgroup");
|
||||||
return TSDB_CODE_MND_NO_ENOUGH_DNODES;
|
return TSDB_CODE_MND_NO_ENOUGH_DNODES;
|
||||||
|
|
|
@ -123,7 +123,7 @@ static int32_t mnodeMnodeActionRestored() {
|
||||||
pMnode->role = TAOS_SYNC_ROLE_MASTER;
|
pMnode->role = TAOS_SYNC_ROLE_MASTER;
|
||||||
mnodeDecMnodeRef(pMnode);
|
mnodeDecMnodeRef(pMnode);
|
||||||
}
|
}
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextMnode(pIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
mnodeUpdateMnodeEpSet();
|
mnodeUpdateMnodeEpSet();
|
||||||
|
@ -161,6 +161,7 @@ int32_t mnodeInitMnodes() {
|
||||||
|
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_MNODE, mnodeGetMnodeMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_MNODE, mnodeGetMnodeMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_MNODE, mnodeRetrieveMnodes);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_MNODE, mnodeRetrieveMnodes);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_MNODE, mnodeCancelGetNextMnode);
|
||||||
|
|
||||||
mDebug("table:mnodes table is created");
|
mDebug("table:mnodes table is created");
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -192,6 +193,10 @@ void *mnodeGetNextMnode(void *pIter, SMnodeObj **pMnode) {
|
||||||
return sdbFetchRow(tsMnodeSdb, pIter, (void **)pMnode);
|
return sdbFetchRow(tsMnodeSdb, pIter, (void **)pMnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextMnode(void *pIter) {
|
||||||
|
sdbFreeIter(tsMnodeSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
void mnodeUpdateMnodeEpSet() {
|
void mnodeUpdateMnodeEpSet() {
|
||||||
mInfo("update mnodes epSet, numOfEps:%d ", mnodeGetMnodesNum());
|
mInfo("update mnodes epSet, numOfEps:%d ", mnodeGetMnodesNum());
|
||||||
|
|
||||||
|
@ -239,8 +244,6 @@ void mnodeUpdateMnodeEpSet() {
|
||||||
tsMnodeEpSetForShell.numOfEps = index;
|
tsMnodeEpSetForShell.numOfEps = index;
|
||||||
tsMnodeEpSetForPeer.numOfEps = index;
|
tsMnodeEpSetForPeer.numOfEps = index;
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mnodeMnodeUnLock();
|
mnodeMnodeUnLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ static int32_t mnodeGetQueryMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pC
|
||||||
static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
static int32_t mnodeRetrieveQueries(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
||||||
static int32_t mnodeGetConnsMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
static int32_t mnodeGetConnsMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
||||||
static int32_t mnodeRetrieveConns(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
static int32_t mnodeRetrieveConns(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
||||||
|
static void mnodeCancelGetNextConn(void *pIter);
|
||||||
static int32_t mnodeGetStreamMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
static int32_t mnodeGetStreamMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
|
||||||
static int32_t mnodeRetrieveStreams(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
static int32_t mnodeRetrieveStreams(SShowObj *pShow, char *data, int32_t rows, void *pConn);
|
||||||
static void mnodeFreeConn(void *data);
|
static void mnodeFreeConn(void *data);
|
||||||
|
@ -52,10 +53,13 @@ static int32_t mnodeProcessKillConnectionMsg(SMnodeMsg *pMsg);
|
||||||
int32_t mnodeInitProfile() {
|
int32_t mnodeInitProfile() {
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_QUERIES, mnodeGetQueryMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_QUERIES, mnodeGetQueryMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_QUERIES, mnodeRetrieveQueries);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_QUERIES, mnodeRetrieveQueries);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_QUERIES, mnodeCancelGetNextConn);
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_CONNS, mnodeGetConnsMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_CONNS, mnodeGetConnsMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_CONNS, mnodeRetrieveConns);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_CONNS, mnodeRetrieveConns);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_CONNS, mnodeCancelGetNextConn);
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_STREAMS, mnodeGetStreamMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_STREAMS, mnodeGetStreamMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_STREAMS, mnodeRetrieveStreams);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_STREAMS, mnodeRetrieveStreams);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_STREAMS, mnodeCancelGetNextConn);
|
||||||
|
|
||||||
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_KILL_QUERY, mnodeProcessKillQueryMsg);
|
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_KILL_QUERY, mnodeProcessKillQueryMsg);
|
||||||
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_KILL_STREAM, mnodeProcessKillStreamMsg);
|
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_KILL_STREAM, mnodeProcessKillStreamMsg);
|
||||||
|
@ -137,21 +141,15 @@ static void mnodeFreeConn(void *data) {
|
||||||
mDebug("connId:%d, is destroyed", pConn->connId);
|
mDebug("connId:%d, is destroyed", pConn->connId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *mnodeGetNextConn(SHashMutableIterator *pIter, SConnObj **pConn) {
|
static void *mnodeGetNextConn(void *pIter, SConnObj **pConn) {
|
||||||
*pConn = NULL;
|
*pConn = NULL;
|
||||||
|
|
||||||
if (pIter == NULL) {
|
pIter = taosHashIterate(tsMnodeConnCache->pHashTable, pIter);
|
||||||
pIter = taosHashCreateIter(tsMnodeConnCache->pHashTable);
|
if (pIter == NULL) return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
if (!taosHashIterNext(pIter)) {
|
SCacheDataNode **pNode = pIter;
|
||||||
taosHashDestroyIter(pIter);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
SCacheDataNode **pNode = taosHashIterGet(pIter);
|
|
||||||
if (pNode == NULL || *pNode == NULL) {
|
if (pNode == NULL || *pNode == NULL) {
|
||||||
taosHashDestroyIter(pIter);
|
taosHashCancelIterate(tsMnodeConnCache->pHashTable, pIter);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,6 +157,10 @@ static void *mnodeGetNextConn(SHashMutableIterator *pIter, SConnObj **pConn) {
|
||||||
return pIter;
|
return pIter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void mnodeCancelGetNextConn(void *pIter) {
|
||||||
|
taosHashCancelIterate(tsMnodeConnCache->pHashTable, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t mnodeGetConnsMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
|
static int32_t mnodeGetConnsMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn) {
|
||||||
SUserObj *pUser = mnodeGetUserFromConn(pConn);
|
SUserObj *pUser = mnodeGetUserFromConn(pConn);
|
||||||
if (pUser == NULL) return 0;
|
if (pUser == NULL) return 0;
|
||||||
|
|
|
@ -325,7 +325,6 @@ void sdbUpdateSync(void *pMnodes) {
|
||||||
mnodeDecDnodeRef(pDnode);
|
mnodeDecDnodeRef(pDnode);
|
||||||
mnodeDecMnodeRef(pMnode);
|
mnodeDecMnodeRef(pMnode);
|
||||||
}
|
}
|
||||||
sdbFreeIter(pIter);
|
|
||||||
syncCfg.replica = index;
|
syncCfg.replica = index;
|
||||||
mDebug("vgId:1, mnodes info not input, use infos in sdb, numOfMnodes:%d", syncCfg.replica);
|
mDebug("vgId:1, mnodes info not input, use infos in sdb, numOfMnodes:%d", syncCfg.replica);
|
||||||
} else {
|
} else {
|
||||||
|
@ -756,24 +755,17 @@ int32_t sdbUpdateRow(SSdbRow *pRow) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void *sdbFetchRow(void *tparam, void *pNode, void **ppRow) {
|
void *sdbFetchRow(void *tparam, void *pIter, void **ppRow) {
|
||||||
SSdbTable *pTable = tparam;
|
SSdbTable *pTable = tparam;
|
||||||
*ppRow = NULL;
|
*ppRow = NULL;
|
||||||
if (pTable == NULL) return NULL;
|
if (pTable == NULL) return NULL;
|
||||||
|
|
||||||
SHashMutableIterator *pIter = pNode;
|
pIter = taosHashIterate(pTable->iHandle, pIter);
|
||||||
if (pIter == NULL) {
|
if (pIter == NULL) return NULL;
|
||||||
pIter = taosHashCreateIter(pTable->iHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!taosHashIterNext(pIter)) {
|
void **ppMetaRow = pIter;
|
||||||
taosHashDestroyIter(pIter);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void **ppMetaRow = taosHashIterGet(pIter);
|
|
||||||
if (ppMetaRow == NULL) {
|
if (ppMetaRow == NULL) {
|
||||||
taosHashDestroyIter(pIter);
|
taosHashCancelIterate(pTable->iHandle, pIter);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,10 +775,11 @@ void *sdbFetchRow(void *tparam, void *pNode, void **ppRow) {
|
||||||
return pIter;
|
return pIter;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sdbFreeIter(void *pIter) {
|
void sdbFreeIter(void *tparam, void *pIter) {
|
||||||
if (pIter != NULL) {
|
SSdbTable *pTable = tparam;
|
||||||
taosHashDestroyIter(pIter);
|
if (pTable == NULL || pIter == NULL) return;
|
||||||
}
|
|
||||||
|
taosHashCancelIterate(pTable->iHandle, pIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *sdbOpenTable(SSdbTableDesc *pDesc) {
|
void *sdbOpenTable(SSdbTableDesc *pDesc) {
|
||||||
|
@ -827,9 +820,10 @@ void sdbCloseTable(void *handle) {
|
||||||
tsSdbMgmt.numOfTables--;
|
tsSdbMgmt.numOfTables--;
|
||||||
tsSdbMgmt.tableList[pTable->id] = NULL;
|
tsSdbMgmt.tableList[pTable->id] = NULL;
|
||||||
|
|
||||||
SHashMutableIterator *pIter = taosHashCreateIter(pTable->iHandle);
|
void *pIter = taosHashIterate(pTable->iHandle, NULL);
|
||||||
while (taosHashIterNext(pIter)) {
|
while (pIter) {
|
||||||
void **ppRow = taosHashIterGet(pIter);
|
void **ppRow = pIter;
|
||||||
|
pIter = taosHashIterate(pTable->iHandle, pIter);
|
||||||
if (ppRow == NULL) continue;
|
if (ppRow == NULL) continue;
|
||||||
|
|
||||||
SSdbRow row = {
|
SSdbRow row = {
|
||||||
|
@ -840,7 +834,7 @@ void sdbCloseTable(void *handle) {
|
||||||
(*pTable->fpDestroy)(&row);
|
(*pTable->fpDestroy)(&row);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosHashDestroyIter(pIter);
|
taosHashCancelIterate(pTable->iHandle, pIter);
|
||||||
taosHashCleanup(pTable->iHandle);
|
taosHashCleanup(pTable->iHandle);
|
||||||
pthread_mutex_destroy(&pTable->mutex);
|
pthread_mutex_destroy(&pTable->mutex);
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ static void *tsMnodeShowCache = NULL;
|
||||||
static int32_t tsShowObjIndex = 0;
|
static int32_t tsShowObjIndex = 0;
|
||||||
static SShowMetaFp tsMnodeShowMetaFp[TSDB_MGMT_TABLE_MAX] = {0};
|
static SShowMetaFp tsMnodeShowMetaFp[TSDB_MGMT_TABLE_MAX] = {0};
|
||||||
static SShowRetrieveFp tsMnodeShowRetrieveFp[TSDB_MGMT_TABLE_MAX] = {0};
|
static SShowRetrieveFp tsMnodeShowRetrieveFp[TSDB_MGMT_TABLE_MAX] = {0};
|
||||||
|
static SShowFreeIterFp tsMnodeShowFreeIterFp[TSDB_MGMT_TABLE_MAX] = {0};
|
||||||
|
|
||||||
int32_t mnodeInitShow() {
|
int32_t mnodeInitShow() {
|
||||||
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_SHOW, mnodeProcessShowMsg);
|
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_SHOW, mnodeProcessShowMsg);
|
||||||
|
@ -85,6 +86,10 @@ void mnodeAddShowRetrieveHandle(uint8_t msgType, SShowRetrieveFp fp) {
|
||||||
tsMnodeShowRetrieveFp[msgType] = fp;
|
tsMnodeShowRetrieveFp[msgType] = fp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeAddShowFreeIterHandle(uint8_t msgType, SShowFreeIterFp fp) {
|
||||||
|
tsMnodeShowFreeIterFp[msgType] = fp;
|
||||||
|
}
|
||||||
|
|
||||||
static char *mnodeGetShowType(int32_t showType) {
|
static char *mnodeGetShowType(int32_t showType) {
|
||||||
switch (showType) {
|
switch (showType) {
|
||||||
case TSDB_MGMT_TABLE_ACCT: return "show accounts";
|
case TSDB_MGMT_TABLE_ACCT: return "show accounts";
|
||||||
|
@ -412,7 +417,9 @@ static void* mnodePutShowObj(SShowObj *pShow) {
|
||||||
|
|
||||||
static void mnodeFreeShowObj(void *data) {
|
static void mnodeFreeShowObj(void *data) {
|
||||||
SShowObj *pShow = *(SShowObj **)data;
|
SShowObj *pShow = *(SShowObj **)data;
|
||||||
sdbFreeIter(pShow->pIter);
|
if (tsMnodeShowFreeIterFp[pShow->type] != NULL && pShow->pIter != NULL) {
|
||||||
|
(*tsMnodeShowFreeIterFp[pShow->type])(pShow->pIter);
|
||||||
|
}
|
||||||
|
|
||||||
mDebug("%p, show is destroyed, data:%p index:%d", pShow, data, pShow->index);
|
mDebug("%p, show is destroyed, data:%p index:%d", pShow, data, pShow->index);
|
||||||
tfree(pShow);
|
tfree(pShow);
|
||||||
|
|
|
@ -342,8 +342,7 @@ static int32_t mnodeChildTableActionRestored() {
|
||||||
mnodeDecTableRef(pTable);
|
mnodeDecTableRef(pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextChildTable(pIter);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,10 +601,13 @@ int32_t mnodeInitTables() {
|
||||||
|
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_TABLE, mnodeGetShowTableMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_TABLE, mnodeGetShowTableMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_TABLE, mnodeRetrieveShowTables);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_TABLE, mnodeRetrieveShowTables);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_TABLE, mnodeCancelGetNextChildTable);
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_METRIC, mnodeGetShowSuperTableMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_METRIC, mnodeGetShowSuperTableMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_METRIC, mnodeRetrieveShowSuperTables);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_METRIC, mnodeRetrieveShowSuperTables);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_METRIC, mnodeCancelGetNextSuperTable);
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_STREAMTABLES, mnodeGetStreamTableMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_STREAMTABLES, mnodeGetStreamTableMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_STREAMTABLES, mnodeRetrieveStreamTables);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_STREAMTABLES, mnodeRetrieveStreamTables);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_STREAMTABLES, mnodeCancelGetNextChildTable);
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -626,14 +628,12 @@ static void *mnodeGetSuperTableByUid(uint64_t uid) {
|
||||||
pIter = mnodeGetNextSuperTable(pIter, &pStable);
|
pIter = mnodeGetNextSuperTable(pIter, &pStable);
|
||||||
if (pStable == NULL) break;
|
if (pStable == NULL) break;
|
||||||
if (pStable->uid == uid) {
|
if (pStable->uid == uid) {
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextSuperTable(pIter);
|
||||||
return pStable;
|
return pStable;
|
||||||
}
|
}
|
||||||
mnodeDecTableRef(pStable);
|
mnodeDecTableRef(pStable);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,10 +655,18 @@ void *mnodeGetNextChildTable(void *pIter, SCTableObj **pTable) {
|
||||||
return sdbFetchRow(tsChildTableSdb, pIter, (void **)pTable);
|
return sdbFetchRow(tsChildTableSdb, pIter, (void **)pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextChildTable(void *pIter) {
|
||||||
|
sdbFreeIter(tsChildTableSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
void *mnodeGetNextSuperTable(void *pIter, SSTableObj **pTable) {
|
void *mnodeGetNextSuperTable(void *pIter, SSTableObj **pTable) {
|
||||||
return sdbFetchRow(tsSuperTableSdb, pIter, (void **)pTable);
|
return sdbFetchRow(tsSuperTableSdb, pIter, (void **)pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextSuperTable(void *pIter) {
|
||||||
|
sdbFreeIter(tsSuperTableSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
void mnodeIncTableRef(void *p1) {
|
void mnodeIncTableRef(void *p1) {
|
||||||
STableObj *pTable = (STableObj *)p1;
|
STableObj *pTable = (STableObj *)p1;
|
||||||
if (pTable->type == TSDB_SUPER_TABLE) {
|
if (pTable->type == TSDB_SUPER_TABLE) {
|
||||||
|
@ -914,10 +922,10 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
|
||||||
|
|
||||||
SSTableObj *pStable = (SSTableObj *)pMsg->pTable;
|
SSTableObj *pStable = (SSTableObj *)pMsg->pTable;
|
||||||
if (pStable->vgHash != NULL /*pStable->numOfTables != 0*/) {
|
if (pStable->vgHash != NULL /*pStable->numOfTables != 0*/) {
|
||||||
SHashMutableIterator *pIter = taosHashCreateIter(pStable->vgHash);
|
int32_t *pVgId = taosHashIterate(pStable->vgHash, NULL);
|
||||||
while (taosHashIterNext(pIter)) {
|
while (pVgId) {
|
||||||
int32_t *pVgId = taosHashIterGet(pIter);
|
|
||||||
SVgObj *pVgroup = mnodeGetVgroup(*pVgId);
|
SVgObj *pVgroup = mnodeGetVgroup(*pVgId);
|
||||||
|
pVgId = taosHashIterate(pStable->vgHash, pVgId);
|
||||||
if (pVgroup == NULL) break;
|
if (pVgroup == NULL) break;
|
||||||
|
|
||||||
SDropSTableMsg *pDrop = rpcMallocCont(sizeof(SDropSTableMsg));
|
SDropSTableMsg *pDrop = rpcMallocCont(sizeof(SDropSTableMsg));
|
||||||
|
@ -933,7 +941,8 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
|
||||||
dnodeSendMsgToDnode(&epSet, &rpcMsg);
|
dnodeSendMsgToDnode(&epSet, &rpcMsg);
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
taosHashDestroyIter(pIter);
|
|
||||||
|
taosHashCancelIterate(pStable->vgHash, pVgId);
|
||||||
|
|
||||||
mnodeDropAllChildTablesInStable(pStable);
|
mnodeDropAllChildTablesInStable(pStable);
|
||||||
}
|
}
|
||||||
|
@ -1430,8 +1439,6 @@ void mnodeDropAllSuperTables(SDbObj *pDropDb) {
|
||||||
mnodeDecTableRef(pTable);
|
mnodeDecTableRef(pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("db:%s, all super tables:%d is dropped from sdb", pDropDb->name, numOfTables);
|
mInfo("db:%s, all super tables:%d is dropped from sdb", pDropDb->name, numOfTables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1523,11 +1530,11 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
|
||||||
} else {
|
} else {
|
||||||
SVgroupsMsg *pVgroupMsg = (SVgroupsMsg *)msg;
|
SVgroupsMsg *pVgroupMsg = (SVgroupsMsg *)msg;
|
||||||
|
|
||||||
SHashMutableIterator *pIter = taosHashCreateIter(pTable->vgHash);
|
int32_t *pVgId = taosHashIterate(pTable->vgHash, NULL);
|
||||||
int32_t vgSize = 0;
|
int32_t vgSize = 0;
|
||||||
while (taosHashIterNext(pIter)) {
|
while (pVgId) {
|
||||||
int32_t *pVgId = taosHashIterGet(pIter);
|
SVgObj *pVgroup = mnodeGetVgroup(*pVgId);
|
||||||
SVgObj * pVgroup = mnodeGetVgroup(*pVgId);
|
pVgId = taosHashIterate(pTable->vgHash, pVgId);
|
||||||
if (pVgroup == NULL) continue;
|
if (pVgroup == NULL) continue;
|
||||||
|
|
||||||
pVgroupMsg->vgroups[vgSize].vgId = htonl(pVgroup->vgId);
|
pVgroupMsg->vgroups[vgSize].vgId = htonl(pVgroup->vgId);
|
||||||
|
@ -1547,7 +1554,7 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) {
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosHashDestroyIter(pIter);
|
taosHashCancelIterate(pTable->vgHash, pVgId);
|
||||||
mnodeDecTableRef(pTable);
|
mnodeDecTableRef(pTable);
|
||||||
|
|
||||||
pVgroupMsg->numOfVgroups = htonl(vgSize);
|
pVgroupMsg->numOfVgroups = htonl(vgSize);
|
||||||
|
@ -2230,8 +2237,6 @@ void mnodeDropAllChildTablesInVgroups(SVgObj *pVgroup) {
|
||||||
mnodeDecTableRef(pTable);
|
mnodeDecTableRef(pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("vgId:%d, all child tables is dropped from sdb", pVgroup->vgId);
|
mInfo("vgId:%d, all child tables is dropped from sdb", pVgroup->vgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2263,8 +2268,6 @@ void mnodeDropAllChildTables(SDbObj *pDropDb) {
|
||||||
mnodeDecTableRef(pTable);
|
mnodeDecTableRef(pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("db:%s, all child tables:%d is dropped from sdb", pDropDb->name, numOfTables);
|
mInfo("db:%s, all child tables:%d is dropped from sdb", pDropDb->name, numOfTables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2293,8 +2296,6 @@ static void mnodeDropAllChildTablesInStable(SSTableObj *pStable) {
|
||||||
mnodeDecTableRef(pTable);
|
mnodeDecTableRef(pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("stable:%s, all child tables:%d is dropped from sdb", pStable->info.tableId, numOfTables);
|
mInfo("stable:%s, all child tables:%d is dropped from sdb", pStable->info.tableId, numOfTables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,6 @@ static void mnodePrintUserAuth() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush(fp);
|
fflush(fp);
|
||||||
sdbFreeIter(pIter);
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +176,8 @@ int32_t mnodeInitUsers() {
|
||||||
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_DROP_USER, mnodeProcessDropUserMsg);
|
mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_DROP_USER, mnodeProcessDropUserMsg);
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_USER, mnodeGetUserMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_USER, mnodeGetUserMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_USER, mnodeRetrieveUsers);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_USER, mnodeRetrieveUsers);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_USER, mnodeCancelGetNextUser);
|
||||||
|
|
||||||
mnodeAddPeerMsgHandle(TSDB_MSG_TYPE_DM_AUTH, mnodeProcessAuthMsg);
|
mnodeAddPeerMsgHandle(TSDB_MSG_TYPE_DM_AUTH, mnodeProcessAuthMsg);
|
||||||
|
|
||||||
mDebug("table:%s, hash is created", desc.name);
|
mDebug("table:%s, hash is created", desc.name);
|
||||||
|
@ -196,6 +197,10 @@ void *mnodeGetNextUser(void *pIter, SUserObj **pUser) {
|
||||||
return sdbFetchRow(tsUserSdb, pIter, (void **)pUser);
|
return sdbFetchRow(tsUserSdb, pIter, (void **)pUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextUser(void *pIter) {
|
||||||
|
sdbFreeIter(tsUserSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
void mnodeIncUserRef(SUserObj *pUser) {
|
void mnodeIncUserRef(SUserObj *pUser) {
|
||||||
return sdbIncRef(tsUserSdb, pUser);
|
return sdbIncRef(tsUserSdb, pUser);
|
||||||
}
|
}
|
||||||
|
@ -574,8 +579,6 @@ void mnodeDropAllUsers(SAcctObj *pAcct) {
|
||||||
mnodeDecUserRef(pUser);
|
mnodeDecUserRef(pUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mDebug("acct:%s, all users:%d is dropped from sdb", pAcct->user, numOfUsers);
|
mDebug("acct:%s, all users:%d is dropped from sdb", pAcct->user, numOfUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,6 +230,7 @@ int32_t mnodeInitVgroups() {
|
||||||
|
|
||||||
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_VGROUP, mnodeGetVgroupMeta);
|
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_VGROUP, mnodeGetVgroupMeta);
|
||||||
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mnodeRetrieveVgroups);
|
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mnodeRetrieveVgroups);
|
||||||
|
mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_VGROUP, mnodeCancelGetNextVgroup);
|
||||||
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mnodeProcessCreateVnodeRsp);
|
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mnodeProcessCreateVnodeRsp);
|
||||||
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP, mnodeProcessAlterVnodeRsp);
|
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP, mnodeProcessAlterVnodeRsp);
|
||||||
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mnodeProcessDropVnodeRsp);
|
mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mnodeProcessDropVnodeRsp);
|
||||||
|
@ -304,7 +305,7 @@ void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t o
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
mnodeCancelGetNextVgroup(pIter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVload) {
|
void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVload) {
|
||||||
|
@ -491,6 +492,10 @@ void *mnodeGetNextVgroup(void *pIter, SVgObj **pVgroup) {
|
||||||
return sdbFetchRow(tsVgroupSdb, pIter, (void **)pVgroup);
|
return sdbFetchRow(tsVgroupSdb, pIter, (void **)pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mnodeCancelGetNextVgroup(void *pIter) {
|
||||||
|
sdbFreeIter(tsVgroupSdb, pIter);
|
||||||
|
}
|
||||||
|
|
||||||
static int32_t mnodeCreateVgroupFp(SMnodeMsg *pMsg) {
|
static int32_t mnodeCreateVgroupFp(SMnodeMsg *pMsg) {
|
||||||
SVgObj *pVgroup = pMsg->pVgroup;
|
SVgObj *pVgroup = pMsg->pVgroup;
|
||||||
SDbObj *pDb = pMsg->pDb;
|
SDbObj *pDb = pMsg->pDb;
|
||||||
|
@ -1095,8 +1100,6 @@ void mnodeDropAllDnodeVgroups(SDnodeObj *pDropDnode) {
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("dnode:%d, all vgroups:%d is dropped from sdb", pDropDnode->dnodeId, numOfVgroups);
|
mInfo("dnode:%d, all vgroups:%d is dropped from sdb", pDropDnode->dnodeId, numOfVgroups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1118,8 +1121,6 @@ void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb) {
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("db:%s, all vgroups is updated in sdb", pAlterDb->name);
|
mInfo("db:%s, all vgroups is updated in sdb", pAlterDb->name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1147,8 +1148,6 @@ void mnodeDropAllDbVgroups(SDbObj *pDropDb) {
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("db:%s, all vgroups:%d is dropped from sdb", pDropDb->name, numOfVgroups);
|
mInfo("db:%s, all vgroups:%d is dropped from sdb", pDropDb->name, numOfVgroups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1170,7 +1169,5 @@ void mnodeSendDropAllDbVgroupsMsg(SDbObj *pDropDb) {
|
||||||
numOfVgroups++;
|
numOfVgroups++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdbFreeIter(pIter);
|
|
||||||
|
|
||||||
mInfo("db:%s, all vgroups:%d drop msg is sent to dnode", pDropDb->name, numOfVgroups);
|
mInfo("db:%s, all vgroups:%d drop msg is sent to dnode", pDropDb->name, numOfVgroups);
|
||||||
}
|
}
|
||||||
|
|
|
@ -542,10 +542,11 @@ void vnodeBuildStatusMsg(void *param) {
|
||||||
|
|
||||||
void *pIter = taosHashIterate(tsVnodesHash, NULL);
|
void *pIter = taosHashIterate(tsVnodesHash, NULL);
|
||||||
while (pIter) {
|
while (pIter) {
|
||||||
SVnodeObj **pVnode = pIter;
|
SVnodeObj **pVnode = pIter;
|
||||||
if (*pVnode) {
|
if (*pVnode) {
|
||||||
vnodeBuildVloadMsg(*pVnode, pStatus);
|
vnodeBuildVloadMsg(*pVnode, pStatus);
|
||||||
}
|
}
|
||||||
|
pIter = taosHashIterate(tsVnodesHash, pIter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ run general/table/vgroup.sim
|
||||||
run general/user/authority.sim
|
run general/user/authority.sim
|
||||||
run general/vector/metrics_mix.sim
|
run general/vector/metrics_mix.sim
|
||||||
run general/vector/table_field.sim
|
run general/vector/table_field.sim
|
||||||
run general/user/authority.sim
|
|
||||||
run general/tag/set.sim
|
run general/tag/set.sim
|
||||||
run general/table/delete_writing.sim
|
run general/table/delete_writing.sim
|
||||||
run general/stable/disk.sim
|
run general/stable/disk.sim
|
||||||
|
|
Loading…
Reference in New Issue