Merge pull request #2619 from taosdata/hotfix/crash

Hotfix/crash
This commit is contained in:
Shengliang Guan 2020-07-09 22:54:43 +08:00 committed by GitHub
commit 682c85a3aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -967,7 +967,12 @@ static void *sdbWorkerFp(void *param) {
} }
int32_t code = sdbWrite(pOper, pHead, type); int32_t code = sdbWrite(pOper, pHead, type);
if (pOper && code <= 0) pOper->retCode = code; if (code < 0) {
if (pOper)
pOper->retCode = code;
else
pHead->len = code; // hackway
}
} }
walFsync(tsSdbObj.wal); walFsync(tsSdbObj.wal);
@ -983,7 +988,7 @@ static void *sdbWorkerFp(void *param) {
sdbConfirmForward(NULL, pOper, pOper->retCode); sdbConfirmForward(NULL, pOper, pOper->retCode);
} else if (type == TAOS_QTYPE_FWD) { } else if (type == TAOS_QTYPE_FWD) {
pHead = (SWalHead *)item; pHead = (SWalHead *)item;
syncConfirmForward(tsSdbObj.sync, pHead->version, TSDB_CODE_SUCCESS); syncConfirmForward(tsSdbObj.sync, pHead->version, pHead->len);
taosFreeQitem(item); taosFreeQitem(item);
} else { } else {
taosFreeQitem(item); taosFreeQitem(item);