This commit is contained in:
Cary Xu 2021-08-13 18:04:43 +08:00
parent 3948b97e85
commit eebc5d4000
1 changed files with 5 additions and 4 deletions

View File

@ -375,15 +375,18 @@ static int walSMemRowCheck(SWalHead *pHead) {
int32_t lenExpand = 0; int32_t lenExpand = 0;
for (int32_t i = 0; i < numOfBlocks; ++i) { for (int32_t i = 0; i < numOfBlocks; ++i) {
expandSubmitBlk(pDestBlks, pSrcBlks, &lenExpand); expandSubmitBlk(pDestBlks, pSrcBlks, &lenExpand);
pDestBlks = POINTER_SHIFT(pDestBlks, htonl(pDestBlks->dataLen) + sizeof(SSubmitBlk));
pSrcBlks = POINTER_SHIFT(pSrcBlks, htonl(pSrcBlks->dataLen) + sizeof(SSubmitBlk));
} }
if (lenExpand > 0) { if (lenExpand > 0) {
pDestMsg->length = htonl(htonl(pDestMsg->length) + lenExpand); pDestMsg->header.contLen = htonl(pDestMsg->length) + lenExpand;
pDestMsg->length = htonl(pDestMsg->header.contLen);
pWalHead->len = pWalHead->len + lenExpand; pWalHead->len = pWalHead->len + lenExpand;
} }
memcpy(pHead, pWalHead, sizeof(SWalHead) + pWalHead->len); memcpy(pHead, pWalHead, sizeof(SWalHead) + pWalHead->len);
tfree(pWalHead); tfree(pWalHead);
} }
return 0; return 0;
} }
@ -511,12 +514,10 @@ static int32_t walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp, ch
pWal->version = pHead->version; pWal->version = pHead->version;
// wInfo("writeFp: %ld", offset); // wInfo("writeFp: %ld", offset);
if (0 != walSMemRowCheck(pHead)) { if (0 != walSMemRowCheck(pHead)) {
wError("vgId:%d, restore wal, fileId:%" PRId64 " hver:%" PRIu64 " wver:%" PRIu64 " len:%d offset:%" PRId64, wError("vgId:%d, restore wal, fileId:%" PRId64 " hver:%" PRIu64 " wver:%" PRIu64 " len:%d offset:%" PRId64,
pWal->vgId, fileId, pHead->version, pWal->version, pHead->len, offset); pWal->vgId, fileId, pHead->version, pWal->version, pHead->len, offset);
} }
(*writeFp)(pVnode, pHead, TAOS_QTYPE_WAL, NULL); (*writeFp)(pVnode, pHead, TAOS_QTYPE_WAL, NULL);
} }