diff --git a/src/mnode/src/mgmtMnode.c b/src/mnode/src/mgmtMnode.c index 5b2a5c40a8..9d7481b73f 100644 --- a/src/mnode/src/mgmtMnode.c +++ b/src/mnode/src/mgmtMnode.c @@ -121,6 +121,9 @@ static int32_t mgmtMnodeActionRestored() { } sdbFreeIter(pIter); } + + mgmtUpdateMnodeIpSet(); + return TSDB_CODE_SUCCESS; } @@ -203,6 +206,8 @@ void mgmtUpdateMnodeIpSet() { SRpcIpSet *ipSet = &tsMnodeRpcIpSet; SDMMnodeInfos *mnodes = &tsMnodeInfos; + mPrint("update mnodes ipset, numOfIps:%d ", mgmtGetMnodesNum()); + mgmtMnodeWrLock(); int32_t index = 0; @@ -223,13 +228,16 @@ void mgmtUpdateMnodeIpSet() { mnodes->inUse = index; } + mPrint("mnode:%d, ep:%s %s", index, pMnode->pDnode->dnodeFqdn, pMnode->role == TAOS_SYNC_ROLE_MASTER ? "master" : ""); + ipSet->numOfIps++; index++; - + mgmtDecMnodeRef(pMnode); } mnodes->nodeNum = index; + sdbFreeIter(pIter); mgmtMnodeUnLock(); diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index c5ef00c233..532e664b48 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -409,7 +409,7 @@ int tsdbWriteCompInfo(SRWHelper *pHelper) { if (pIdx->offset > 0) { pIdx->offset = lseek(pHelper->files.nHeadF.fd, 0, SEEK_END); if (pIdx->offset < 0) return -1; - ASSERT(pIdx->offset >= tsizeof(pHelper->pCompIdx)); + ASSERT(pIdx->offset >= TSDB_FILE_HEAD_SIZE); if (tsendfile(pHelper->files.nHeadF.fd, pHelper->files.headF.fd, NULL, pIdx->len) < pIdx->len) return -1; }