Merge pull request #814 from taosdata/hotfix/#813

fix #813
This commit is contained in:
haojun Liao 2019-12-02 15:52:12 +08:00 committed by GitHub
commit 24542d783a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -466,8 +466,6 @@ static int vnodeLoadNeededBlockData(SMeterObj *pObj, SImportHandle *pHandle, int
SCompBlock *pBlock = pHandle->pBlocks + blockId;
*code = TSDB_CODE_SUCCESS;
assert(pBlock->sversion == pObj->sversion);
SVnodeObj *pVnode = vnodeList + pObj->vnode;
int dfd = pBlock->last ? pVnode->lfd : pVnode->dfd;
@ -989,6 +987,13 @@ static int vnodeMergeDataIntoFile(SImportInfo *pImport, const char *payload, int
}
}
int aslot = MIN(blockIter.slot, importHandle.compInfo.numOfBlocks - 1);
int64_t sversion = importHandle.pBlocks[aslot].sversion;
if (sversion != pObj->sversion) {
code = TSDB_CODE_OTHERS;
goto _error_merge;
}
// Open the new .t file if not opened yet.
if (pVnode->nfd <= 0) {
if (vnodeOpenTempFilesForImport(&importHandle, pObj, fid) < 0) {