From c068b1b083a1135ed961e8cd57a4f16ff99b5f1c Mon Sep 17 00:00:00 2001 From: slzhou Date: Mon, 24 Oct 2022 15:00:33 +0800 Subject: [PATCH] enhance: log submit that takes more than 10s with error --- src/vnode/src/vnodeWrite.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vnode/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c index e3371c79db..f9c354e474 100644 --- a/src/vnode/src/vnodeWrite.c +++ b/src/vnode/src/vnodeWrite.c @@ -160,7 +160,7 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR int32_t code = TSDB_CODE_SUCCESS; vTrace("vgId:%d, submit msg is processed", pVnode->vgId); - + int64_t submitStartUs = taosGetTimestampUs(); if (pVnode->dbType == TSDB_DB_TYPE_TOPIC && pVnode->role == TAOS_SYNC_ROLE_MASTER) { tpUpdateTs(pVnode->vgId, &pVnode->sequence, pCont); } @@ -186,6 +186,11 @@ static int32_t vnodeProcessSubmitMsg(SVnodeObj *pVnode, void *pCont, SRspRet *pR atomic_fetch_add_64(&tsSubmitRowSucNum, ntohl(pRsp->affectedRows)); } + int64_t submitEndUs = taosGetTimestampUs(); + + if (submitEndUs - submitStartUs > 10 * 1000000) { + vError("vgId: %d, insert msg takes more than 10s", pVnode->vgId); + } return code; } -- GitLab