From 54526adcc3e304c48ef521669020f9ec1bbd2410 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 17:18:41 +0800 Subject: [PATCH 01/10] fix: commit txn for rsma --- source/dnode/vnode/src/inc/vnodeInt.h | 1 + source/dnode/vnode/src/sma/smaCommit.c | 24 ++++++++++++++++++++++++ source/dnode/vnode/src/vnd/vnodeCommit.c | 20 +++++++++++--------- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/source/dnode/vnode/src/inc/vnodeInt.h b/source/dnode/vnode/src/inc/vnodeInt.h index 42ab0c2a37..a5dc4431ab 100644 --- a/source/dnode/vnode/src/inc/vnodeInt.h +++ b/source/dnode/vnode/src/inc/vnodeInt.h @@ -211,6 +211,7 @@ int32_t smaSyncCommit(SSma* pSma); int32_t smaSyncPostCommit(SSma* pSma); int32_t smaPreCommit(SSma* pSma); int32_t smaCommit(SSma* pSma); +int32_t smaFinishCommit(SSma* pSma); int32_t smaPostCommit(SSma* pSma); int32_t smaDoRetention(SSma* pSma, int64_t now); diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 3dce724de7..d1717f9a1e 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -112,6 +112,30 @@ int32_t smaBegin(SSma *pSma) { return TSDB_CODE_SUCCESS; } +int32_t smaFinishCommit(SSma *pSma) { + int32_t code = 0; + SVnode *pVnode = pSma->pVnode; + SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); + if (!pSmaEnv) { + goto _exit; + } + if ((code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { + smaError("vgId:%d, failed to finish commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); + goto _exit; + } + if ((code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { + smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); + goto _exit; + } + if ((code = tsdbFinishCommit(VND_RSMA2(pVnode))) < 0) { + smaError("vgId:%d, failed to finish commit tsdb rsma2 since %s", TD_VID(pVnode), tstrerror(code)); + goto _exit; + } +_exit: + terrno = code; + return code; +} + #if 0 /** * @brief pre-commit for rollup sma(sync commit). diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 24b678b5eb..0bc1623d8b 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -239,10 +239,8 @@ int vnodeCommit(SVnode *pVnode) { } walBeginSnapshot(pVnode->pWal, pVnode->state.applied); - if (smaPreCommit(pVnode->pSma) < 0) { - vError("vgId:%d, failed to pre-commit sma since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } + code = smaPreCommit(pVnode->pSma); + TSDB_CHECK_CODE(code, lino, _exit); vnodeBufPoolUnRef(pVnode->inUse); pVnode->inUse = NULL; @@ -254,10 +252,8 @@ int vnodeCommit(SVnode *pVnode) { } if (VND_IS_RSMA(pVnode)) { - if (smaCommit(pVnode->pSma) < 0) { - vError("vgId:%d, failed to commit sma since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } + code = smaCommit(pVnode->pSma); + TSDB_CHECK_CODE(code, lino, _exit); } else { code = tsdbCommit(pVnode->pTsdb); TSDB_CHECK_CODE(code, lino, _exit); @@ -274,7 +270,13 @@ int vnodeCommit(SVnode *pVnode) { TSDB_CHECK_CODE(code, lino, _exit); } - tsdbFinishCommit(pVnode->pTsdb); + if (VND_IS_RSMA(pVnode)) { + code = smaFinishCommit(pVnode->pSma); + TSDB_CHECK_CODE(code, lino, _exit); + } else { + code = tsdbFinishCommit(pVnode->pTsdb); + TSDB_CHECK_CODE(code, lino, _exit); + } if (metaFinishCommit(pVnode->pMeta) < 0) { code = terrno; From 8573fb56c88dd32f8a6102ec2f6fce8044f45767 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 17:48:56 +0800 Subject: [PATCH 02/10] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 21 ++++++++++++--------- source/dnode/vnode/src/vnd/vnodeCommit.c | 14 +------------- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index d1717f9a1e..08b326c659 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -89,6 +89,7 @@ int32_t smaBegin(SSma *pSma) { return TSDB_CODE_SUCCESS; } + SVnode *pVnode = pSma->pVnode; SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); int8_t rsmaTriggerStat = @@ -109,6 +110,17 @@ int32_t smaBegin(SSma *pSma) { break; } } + + if (VND_RSMA1(pVnode) && tsdbBegin(VND_RSMA1(pVnode)) < 0) { + smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(terrno)); + return TSDB_CODE_FAILED; + } + + if (VND_RSMA2(pVnode) && tsdbBegin(VND_RSMA2(pVnode)) < 0) { + smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(terrno)); + return TSDB_CODE_FAILED; + } + return TSDB_CODE_SUCCESS; } @@ -333,15 +345,6 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma) { * 1) This is high cost task and should not put in asyncPreCommit originally. * 2) But, if put in asyncCommit, would trigger taskInfo cloning frequently. */ - nLoops = 0; - while (atomic_load_64(&pRSmaStat->nBufItems) > 0) { - ++nLoops; - if (nLoops > 1000) { - sched_yield(); - nLoops = 0; - } - } - smaInfo("vgId:%d, rsma commit, wait for all items to be consumed, TID:%p", SMA_VID(pSma), (void *)taosGetSelfPthreadId()); nLoops = 0; diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 0bc1623d8b..2ca59ef45a 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -51,20 +51,8 @@ int vnodeBegin(SVnode *pVnode) { return -1; } - if (pVnode->pSma) { - if (VND_RSMA1(pVnode) && tsdbBegin(VND_RSMA1(pVnode)) < 0) { - vError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } - - if (VND_RSMA2(pVnode) && tsdbBegin(VND_RSMA2(pVnode)) < 0) { - vError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(terrno)); - return -1; - } - } - // begin sma - smaBegin(pVnode->pSma); // TODO: refactor to include the rsma1/rsma2 tsdbBegin() after tsdb_refact branch merged + smaBegin(pVnode->pSma); return 0; } From 78828d4d47ea3603ff8e972877b59befb54e8c64 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 17:58:39 +0800 Subject: [PATCH 03/10] enh: add more check --- source/dnode/vnode/src/sma/smaCommit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 08b326c659..8849bcc047 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -131,15 +131,15 @@ int32_t smaFinishCommit(SSma *pSma) { if (!pSmaEnv) { goto _exit; } - if ((code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { + if (VND_RSMA0(pVnode) && (code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; } - if ((code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { + if (VND_RSMA1(pVnode) && (code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; } - if ((code = tsdbFinishCommit(VND_RSMA2(pVnode))) < 0) { + if (VND_RSMA2(pVnode) && (code = tsdbFinishCommit(VND_RSMA2(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma2 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; } From c5b5699c88084dd94407ac8b8d777b3568e7f297 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:41:15 +0800 Subject: [PATCH 04/10] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 8849bcc047..cb14604731 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -78,49 +78,49 @@ int32_t smaCommit(SSma *pSma) { return tdProcessRSmaAsyncCommitImpl(pSma); } int32_t smaPostCommit(SSma *pSma) { return tdProcessRSmaAsyncPostCommitImpl(pSma); } /** - * @brief set rsma trigger stat active + * @brief prepare rsma1/2, and set rsma trigger stat active * * @param pSma * @return int32_t */ int32_t smaBegin(SSma *pSma) { + int32_t code = 0; + SVnode *pVnode = pSma->pVnode; + + if ((code = tsdbBegin(VND_RSMA1(pVnode))) < 0) { + smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(code)); + return TSDB_CODE_FAILED; + } + + if ((code = tsdbBegin(VND_RSMA2(pVnode))) < 0) { + smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(code)); + return TSDB_CODE_FAILED; + } + + // set trigger stat SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); if (!pSmaEnv) { return TSDB_CODE_SUCCESS; } - - SVnode *pVnode = pSma->pVnode; SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); - - int8_t rsmaTriggerStat = + int8_t rsmaTriggerStat = atomic_val_compare_exchange_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_PAUSED, TASK_TRIGGER_STAT_ACTIVE); switch (rsmaTriggerStat) { case TASK_TRIGGER_STAT_PAUSED: { - smaDebug("vgId:%d, rsma trigger stat from paused to active", SMA_VID(pSma)); + smaDebug("vgId:%d, rsma trigger stat from paused to active", TD_VID(pVnode)); break; } case TASK_TRIGGER_STAT_INIT: { atomic_store_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_ACTIVE); - smaDebug("vgId:%d, rsma trigger stat from init to active", SMA_VID(pSma)); + smaDebug("vgId:%d, rsma trigger stat from init to active", TD_VID(pVnode)); break; } default: { atomic_store_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_ACTIVE); - smaError("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", SMA_VID(pSma), rsmaTriggerStat); + smaError("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", TD_VID(pVnode), rsmaTriggerStat); break; } } - - if (VND_RSMA1(pVnode) && tsdbBegin(VND_RSMA1(pVnode)) < 0) { - smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(terrno)); - return TSDB_CODE_FAILED; - } - - if (VND_RSMA2(pVnode) && tsdbBegin(VND_RSMA2(pVnode)) < 0) { - smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(terrno)); - return TSDB_CODE_FAILED; - } - return TSDB_CODE_SUCCESS; } From 20d812fdaadc5a67da1d05563d45890afc17b3eb Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:43:59 +0800 Subject: [PATCH 05/10] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index cb14604731..f0a0f80ca1 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -89,18 +89,18 @@ int32_t smaBegin(SSma *pSma) { if ((code = tsdbBegin(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(code)); - return TSDB_CODE_FAILED; + return code; } if ((code = tsdbBegin(VND_RSMA2(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(code)); - return TSDB_CODE_FAILED; + return code; } // set trigger stat SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); if (!pSmaEnv) { - return TSDB_CODE_SUCCESS; + return code; } SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); int8_t rsmaTriggerStat = @@ -121,7 +121,7 @@ int32_t smaBegin(SSma *pSma) { break; } } - return TSDB_CODE_SUCCESS; + return code; } int32_t smaFinishCommit(SSma *pSma) { From e9977800440a23049ce5b73e0eaab5c696c5d422 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:52:09 +0800 Subject: [PATCH 06/10] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 10 ++-------- source/dnode/vnode/src/vnd/vnodeCommit.c | 12 ++++++------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index f0a0f80ca1..90ee786188 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -131,10 +131,7 @@ int32_t smaFinishCommit(SSma *pSma) { if (!pSmaEnv) { goto _exit; } - if (VND_RSMA0(pVnode) && (code = tsdbFinishCommit(VND_RSMA0(pVnode))) < 0) { - smaError("vgId:%d, failed to finish commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); - goto _exit; - } + if (VND_RSMA1(pVnode) && (code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; @@ -407,10 +404,7 @@ static int32_t tdProcessRSmaAsyncCommitImpl(SSma *pSma) { return TSDB_CODE_FAILED; } #endif - if ((code = tsdbCommit(VND_RSMA0(pVnode))) < 0) { - smaError("vgId:%d, failed to commit tsdb rsma0 since %s", TD_VID(pVnode), tstrerror(code)); - goto _exit; - } + if ((code = tsdbCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); goto _exit; diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 2ca59ef45a..7e471ddfe5 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -239,12 +239,12 @@ int vnodeCommit(SVnode *pVnode) { TSDB_CHECK_CODE(code, lino, _exit); } + code = tsdbCommit(pVnode->pTsdb); + TSDB_CHECK_CODE(code, lino, _exit); + if (VND_IS_RSMA(pVnode)) { code = smaCommit(pVnode->pSma); TSDB_CHECK_CODE(code, lino, _exit); - } else { - code = tsdbCommit(pVnode->pTsdb); - TSDB_CHECK_CODE(code, lino, _exit); } if (tqCommit(pVnode->pTq) < 0) { @@ -258,12 +258,12 @@ int vnodeCommit(SVnode *pVnode) { TSDB_CHECK_CODE(code, lino, _exit); } + code = tsdbFinishCommit(pVnode->pTsdb); + TSDB_CHECK_CODE(code, lino, _exit); + if (VND_IS_RSMA(pVnode)) { code = smaFinishCommit(pVnode->pSma); TSDB_CHECK_CODE(code, lino, _exit); - } else { - code = tsdbFinishCommit(pVnode->pTsdb); - TSDB_CHECK_CODE(code, lino, _exit); } if (metaFinishCommit(pVnode->pMeta) < 0) { From 706aa1da1ed91215469b3a993144798c2adcf760 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 19:59:35 +0800 Subject: [PATCH 07/10] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 10 ++++++---- source/dnode/vnode/src/vnd/vnodeCommit.c | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 90ee786188..57b8623e4b 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -89,18 +89,18 @@ int32_t smaBegin(SSma *pSma) { if ((code = tsdbBegin(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma1 since %s", TD_VID(pVnode), tstrerror(code)); - return code; + goto _exit; } if ((code = tsdbBegin(VND_RSMA2(pVnode))) < 0) { smaError("vgId:%d, failed to begin rsma2 since %s", TD_VID(pVnode), tstrerror(code)); - return code; + goto _exit; } // set trigger stat SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); if (!pSmaEnv) { - return code; + goto _exit; } SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); int8_t rsmaTriggerStat = @@ -117,10 +117,12 @@ int32_t smaBegin(SSma *pSma) { } default: { atomic_store_8(RSMA_TRIGGER_STAT(pRSmaStat), TASK_TRIGGER_STAT_ACTIVE); - smaError("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", TD_VID(pVnode), rsmaTriggerStat); + smaWarn("vgId:%d, rsma trigger stat %" PRIi8 " is unexpected", TD_VID(pVnode), rsmaTriggerStat); break; } } +_exit: + terrno = code; return code; } diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index 7e471ddfe5..c88c095bb5 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -52,7 +52,10 @@ int vnodeBegin(SVnode *pVnode) { } // begin sma - smaBegin(pVnode->pSma); + if (smaBegin(pVnode->pSma) < 0) { + vError("vgId:%d, failed to begin sma since %s", TD_VID(pVnode), tstrerror(terrno)); + return -1; + } return 0; } From 5abfeb47ca81b24dac7412b9e7b8a663ea50121a Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Wed, 19 Oct 2022 20:25:42 +0800 Subject: [PATCH 08/10] chore: code optimization for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index 57b8623e4b..ac41b6c00a 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -129,10 +129,6 @@ _exit: int32_t smaFinishCommit(SSma *pSma) { int32_t code = 0; SVnode *pVnode = pSma->pVnode; - SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); - if (!pSmaEnv) { - goto _exit; - } if (VND_RSMA1(pVnode) && (code = tsdbFinishCommit(VND_RSMA1(pVnode))) < 0) { smaError("vgId:%d, failed to finish commit tsdb rsma1 since %s", TD_VID(pVnode), tstrerror(code)); From b2b61bab9633b833c440f710d752f24dc856a981 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 20 Oct 2022 15:53:47 +0800 Subject: [PATCH 09/10] fix: commit txn for rsma --- source/dnode/vnode/src/sma/smaCommit.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/dnode/vnode/src/sma/smaCommit.c b/source/dnode/vnode/src/sma/smaCommit.c index ac41b6c00a..a79ae35d79 100644 --- a/source/dnode/vnode/src/sma/smaCommit.c +++ b/source/dnode/vnode/src/sma/smaCommit.c @@ -390,10 +390,6 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma) { static int32_t tdProcessRSmaAsyncCommitImpl(SSma *pSma) { int32_t code = 0; SVnode *pVnode = pSma->pVnode; - SSmaEnv *pSmaEnv = SMA_RSMA_ENV(pSma); - if (!pSmaEnv) { - goto _exit; - } #if 0 SRSmaStat *pRSmaStat = (SRSmaStat *)SMA_ENV_STAT(pSmaEnv); From af4957f6721b481e9e0ea917a4b6cf94bf1bd495 Mon Sep 17 00:00:00 2001 From: Cary Xu Date: Thu, 20 Oct 2022 16:02:51 +0800 Subject: [PATCH 10/10] chore: code optimization for rsma --- source/dnode/vnode/src/vnd/vnodeCommit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/vnd/vnodeCommit.c b/source/dnode/vnode/src/vnd/vnodeCommit.c index c88c095bb5..318e16a04d 100644 --- a/source/dnode/vnode/src/vnd/vnodeCommit.c +++ b/source/dnode/vnode/src/vnd/vnodeCommit.c @@ -52,7 +52,7 @@ int vnodeBegin(SVnode *pVnode) { } // begin sma - if (smaBegin(pVnode->pSma) < 0) { + if (VND_IS_RSMA(pVnode) && smaBegin(pVnode->pSma) < 0) { vError("vgId:%d, failed to begin sma since %s", TD_VID(pVnode), tstrerror(terrno)); return -1; }