enh: add more check

This commit is contained in:
Cary Xu 2022-10-19 17:58:39 +08:00
parent 8573fb56c8
commit 78828d4d47
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}