diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c index a49e855e39ec1f635e48dd9c47b9a4f942864655..215185c5554a1db64b44232df454f1ad45f2c0e7 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmFile.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmFile.c @@ -16,7 +16,7 @@ #define _DEFAULT_SOURCE #include "vmInt.h" -#define MAX_CONTENT_LEN 1024 * 1024 +#define MAX_CONTENT_LEN 2 * 1024 * 1024 SVnodeObj **vmGetVnodeListFromHash(SVnodeMgmt *pMgmt, int32_t *numOfVnodes) { taosThreadRwlockRdlock(&pMgmt->lock); @@ -60,7 +60,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t pFile = taosOpenFile(file, TD_FILE_READ); if (pFile == NULL) { - dDebug("file %s not exist", file); + dInfo("file %s not exist", file); code = 0; goto _OVER; } @@ -133,7 +133,7 @@ int32_t vmGetVnodeListFromFile(SVnodeMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes = vnodesNum; code = 0; - dDebug("succcessed to read file %s, numOfVnodes:%d", file, vnodesNum); + dInfo("succcessed to read file %s, numOfVnodes:%d", file, vnodesNum); _OVER: if (content != NULL) taosMemoryFree(content); @@ -163,6 +163,7 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { if (ppVnodes == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; code = -1; + dError("failed to write %s while get vnodelist", file); goto _OVER; } @@ -172,6 +173,7 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { if (content == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; code = -1; + dError("failed to write %s while malloc content", file); goto _OVER; } @@ -213,6 +215,12 @@ _OVER: if (code != 0) return -1; - dDebug("successed to write %s, numOfVnodes:%d", realfile, numOfVnodes); - return taosRenameFile(file, realfile); + dInfo("successed to write %s, numOfVnodes:%d", realfile, numOfVnodes); + code = taosRenameFile(file, realfile); + + if (code != 0) { + dError("failed to rename %s to %s", file, realfile); + } + + return code; } \ No newline at end of file diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index bc4677285808e3d8fd76d9f8d65da7e3ab7249f6..082fe7341b0a82b934de769cd4f604eb646950be 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -213,7 +213,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SVnodeObj *pVnode = vmAcquireVnode(pMgmt, req.vgId); if (pVnode != NULL) { - dDebug("vgId:%d, already exist", req.vgId); + dInfo("vgId:%d, already exist", req.vgId); tFreeSCreateVnodeReq(&req); vmReleaseVnode(pMgmt, pVnode); terrno = TSDB_CODE_VND_ALREADY_EXIST; @@ -358,7 +358,7 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { } int32_t vgId = dropReq.vgId; - dDebug("vgId:%d, start to drop vnode", vgId); + dInfo("vgId:%d, start to drop vnode", vgId); if (dropReq.dnodeId != pMgmt->pData->dnodeId) { terrno = TSDB_CODE_INVALID_MSG; @@ -368,7 +368,7 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { SVnodeObj *pVnode = vmAcquireVnode(pMgmt, vgId); if (pVnode == NULL) { - dDebug("vgId:%d, failed to drop since %s", vgId, terrstr()); + dInfo("vgId:%d, failed to drop since %s", vgId, terrstr()); terrno = TSDB_CODE_VND_NOT_EXIST; return -1; } @@ -383,6 +383,7 @@ int32_t vmProcessDropVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) { vmCloseVnode(pMgmt, pVnode); vmWriteVnodeListToFile(pMgmt); + dInfo("vgId:%d, is dropped", vgId); return 0; } diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c index 313a88fc5c60f3ac2ae84b1ca6cf811033f5779c..f808c67ef66a31f143c0555afade9ff8b31a2163 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmInt.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmInt.c @@ -138,7 +138,7 @@ static void *vmOpenVnodeInThread(void *param) { SVnodeMgmt *pMgmt = pThread->pMgmt; char path[TSDB_FILENAME_LEN]; - dDebug("thread:%d, start to open %d vnodes", pThread->threadIndex, pThread->vnodeNum); + dInfo("thread:%d, start to open %d vnodes", pThread->threadIndex, pThread->vnodeNum); setThreadName("open-vnodes"); for (int32_t v = 0; v < pThread->vnodeNum; ++v) { @@ -156,14 +156,14 @@ static void *vmOpenVnodeInThread(void *param) { pThread->failed++; } else { vmOpenVnode(pMgmt, pCfg, pImpl); - dDebug("vgId:%d, is opened by thread:%d", pCfg->vgId, pThread->threadIndex); + dInfo("vgId:%d, is opened by thread:%d", pCfg->vgId, pThread->threadIndex); pThread->opened++; atomic_add_fetch_32(&pMgmt->state.openVnodes, 1); } } - dDebug("thread:%d, numOfVnodes:%d, opened:%d failed:%d", pThread->threadIndex, pThread->vnodeNum, pThread->opened, - pThread->failed); + dInfo("thread:%d, numOfVnodes:%d, opened:%d failed:%d", pThread->threadIndex, pThread->vnodeNum, pThread->opened, + pThread->failed); return NULL; } @@ -496,7 +496,7 @@ static void *vmRestoreVnodeInThread(void *param) { dError("vgId:%d, failed to restore vnode by thread:%d", pVnode->vgId, pThread->threadIndex); pThread->failed++; } else { - dDebug("vgId:%d, is restored by thread:%d", pVnode->vgId, pThread->threadIndex); + dInfo("vgId:%d, is restored by thread:%d", pVnode->vgId, pThread->threadIndex); pThread->opened++; atomic_add_fetch_32(&pMgmt->state.openVnodes, 1); }