fix: clear some asserts in walRead.c
This commit is contained in:
parent
f8b59fc5bf
commit
bcf6d5b641
|
@ -241,7 +241,6 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
|
||||||
|
|
||||||
if (pRead->curInvalid || pRead->curVersion != fetchVer) {
|
if (pRead->curInvalid || pRead->curVersion != fetchVer) {
|
||||||
if (walReadSeekVer(pRead, fetchVer) < 0) {
|
if (walReadSeekVer(pRead, fetchVer) < 0) {
|
||||||
ASSERT(0);
|
|
||||||
pRead->curVersion = fetchVer;
|
pRead->curVersion = fetchVer;
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -262,7 +261,6 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
|
||||||
} else {
|
} else {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
ASSERT(0);
|
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -299,7 +297,6 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
ASSERT(0);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +305,6 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
|
||||||
pRead->pHead->head.version, ver);
|
pRead->pHead->head.version, ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
ASSERT(0);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,7 +312,6 @@ static int32_t walFetchBodyNew(SWalReader *pRead) {
|
||||||
wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId, ver);
|
wError("vgId:%d, wal fetch body error:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId, ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
ASSERT(0);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +330,6 @@ static int32_t walSkipFetchBodyNew(SWalReader *pRead) {
|
||||||
if (code < 0) {
|
if (code < 0) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
ASSERT(0);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +378,6 @@ int32_t walFetchHead(SWalReader *pRead, int64_t ver, SWalCkHead *pHead) {
|
||||||
} else {
|
} else {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
ASSERT(0);
|
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -447,7 +440,6 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
|
||||||
|
|
||||||
if (pReadHead->bodyLen != taosReadFile(pRead->pLogFile, pReadHead->body, pReadHead->bodyLen)) {
|
if (pReadHead->bodyLen != taosReadFile(pRead->pLogFile, pReadHead->body, pReadHead->bodyLen)) {
|
||||||
if (pReadHead->bodyLen < 0) {
|
if (pReadHead->bodyLen < 0) {
|
||||||
ASSERT(0);
|
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64 ", since %s",
|
wError("vgId:%d, wal fetch body error:%" PRId64 ", read request index:%" PRId64 ", since %s",
|
||||||
pRead->pWal->cfg.vgId, pReadHead->version, ver, tstrerror(terrno));
|
pRead->pWal->cfg.vgId, pReadHead->version, ver, tstrerror(terrno));
|
||||||
|
@ -457,12 +449,10 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
|
||||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||||
}
|
}
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
ASSERT(0);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pReadHead->version != ver) {
|
if (pReadHead->version != ver) {
|
||||||
ASSERT(0);
|
|
||||||
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", read request index:%" PRId64, pRead->pWal->cfg.vgId,
|
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", read request index:%" PRId64, pRead->pWal->cfg.vgId,
|
||||||
pReadHead->version, ver);
|
pReadHead->version, ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
|
@ -471,7 +461,6 @@ int32_t walFetchBody(SWalReader *pRead, SWalCkHead **ppHead) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (walValidBodyCksum(*ppHead) != 0) {
|
if (walValidBodyCksum(*ppHead) != 0) {
|
||||||
ASSERT(0);
|
|
||||||
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId,
|
wError("vgId:%d, wal fetch body error, index:%" PRId64 ", since body checksum not passed", pRead->pWal->cfg.vgId,
|
||||||
ver);
|
ver);
|
||||||
pRead->curInvalid = 1;
|
pRead->curInvalid = 1;
|
||||||
|
|
Loading…
Reference in New Issue