From eae23f51abf9e260eff348bb8a1d37f8ac463b7f Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 25 Oct 2022 16:23:30 +0800 Subject: [PATCH] fix: wait more times if database not ready --- source/dnode/mnode/impl/src/mndTrans.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndTrans.c b/source/dnode/mnode/impl/src/mndTrans.c index 6f430ad3e4..6a606a1a7e 100644 --- a/source/dnode/mnode/impl/src/mndTrans.c +++ b/source/dnode/mnode/impl/src/mndTrans.c @@ -918,13 +918,19 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) { sendRsp = true; } } else { - if (pTrans->stage == TRN_STAGE_REDO_ACTION && pTrans->failedTimes > 6) { + if (pTrans->stage == TRN_STAGE_REDO_ACTION && ((code == TSDB_CODE_APP_NOT_READY && pTrans->failedTimes > 60) || + (code != TSDB_CODE_APP_NOT_READY && pTrans->failedTimes > 6))) { if (code == 0) code = TSDB_CODE_MND_TRANS_UNKNOW_ERROR; sendRsp = true; } } - if (!sendRsp) return; + if (!sendRsp) { + return; + } else { + mInfo("trans:%d, send rsp, stage:%s failedTimes:%d code:0x%x", pTrans->id, mndTransStr(pTrans->stage), + pTrans->failedTimes, code); + } int32_t size = taosArrayGetSize(pTrans->pRpcArray); if (size <= 0) return;