Merge pull request #858 from taosdata/hotfix/#856

Hotfix/#856
This commit is contained in:
slguan 2019-12-05 15:47:16 +08:00 committed by GitHub
commit 341d186e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -529,9 +529,11 @@ static int vnodeDoSubmitJob(SVnodeObj *pVnode, int import, int32_t *ssid, int32_
int code = TSDB_CODE_SUCCESS; int code = TSDB_CODE_SUCCESS;
int32_t numOfPoints = 0; int32_t numOfPoints = 0;
int32_t i = 0; int32_t i = 0;
SShellSubmitBlock tBlock;
for (i = *ssid; i < esid; i++) { for (i = *ssid; i < esid; i++) {
numOfPoints = 0; numOfPoints = 0;
tBlock = *pBlocks;
code = vnodeCheckSubmitBlockContext(pBlocks, pVnode); code = vnodeCheckSubmitBlockContext(pBlocks, pVnode);
if (code != TSDB_CODE_SUCCESS) break; if (code != TSDB_CODE_SUCCESS) break;
@ -565,6 +567,13 @@ static int vnodeDoSubmitJob(SVnodeObj *pVnode, int import, int32_t *ssid, int32_
*ssid = i; *ssid = i;
*ppBlocks = pBlocks; *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; return code;
} }