fix: race condition between fetch all and optr serialize

This commit is contained in:
Cary Xu 2022-08-29 16:15:12 +08:00
parent 66199e4e7a
commit 12a01a88dd
1 changed files with 2 additions and 1 deletions

View File

@ -1715,7 +1715,8 @@ int32_t tdRSmaProcessExecImpl(SSma *pSma, ERsmaExecType type) {
smaDebug("vgId:%d, batchSize:%d, execType:%" PRIi8, SMA_VID(pSma), qallItemSize, type);
}
if (type == RSMA_EXEC_OVERFLOW) {
if (((type == RSMA_EXEC_OVERFLOW) && (atomic_load_8(RSMA_COMMIT_STAT(pRSmaStat)) == 0)) ||
(type == RSMA_EXEC_COMMIT)) {
tdRSmaFetchAllResult(pSma, pInfo, pSubmitArr);
}