From cff3009a4174c00b135ead08705d2bb484ddfd4c Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 5 Dec 2019 15:40:09 +0800 Subject: [PATCH] fix #856 --- src/system/detail/src/vnodeShell.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c index f4b3cdbbe7..66bede89b7 100644 --- a/src/system/detail/src/vnodeShell.c +++ b/src/system/detail/src/vnodeShell.c @@ -529,9 +529,11 @@ static int vnodeDoSubmitJob(SVnodeObj *pVnode, int import, int32_t *ssid, int32_ int code = TSDB_CODE_SUCCESS; int32_t numOfPoints = 0; int32_t i = 0; + SShellSubmitBlock tBlock; for (i = *ssid; i < esid; i++) { numOfPoints = 0; + tBlock = *pBlocks; code = vnodeCheckSubmitBlockContext(pBlocks, pVnode); if (code != TSDB_CODE_SUCCESS) break; @@ -565,6 +567,13 @@ static int vnodeDoSubmitJob(SVnodeObj *pVnode, int import, int32_t *ssid, int32_ *ssid = i; *ppBlocks = pBlocks; + /* Since the pBlock part can be changed by the vnodeForwardToPeer interface, + * which is also possible to be used again. For that case, we just copy the original + * block content back. + */ + if (import && (code == TSDB_CODE_ACTION_IN_PROGRESS)) { + memcpy((void *)pBlocks, (void *)&tBlock, sizeof(SShellSubmitBlock)); + } return code; } -- GitLab