Merge branch '3.0' of github.com:taosdata/TDengine into feature/udf
This commit is contained in:
commit
5dcca22611
|
@ -62,6 +62,16 @@ int tsdbMemTableCreate(STsdb *pTsdb, STsdbMemTable **ppMemTable) {
|
|||
void tsdbMemTableDestroy(STsdb *pTsdb, STsdbMemTable *pMemTable) {
|
||||
if (pMemTable) {
|
||||
taosHashCleanup(pMemTable->pHashIdx);
|
||||
SSkipListIterator *pIter = tSkipListCreateIter(pMemTable->pSlIdx);
|
||||
SSkipListNode *pNode = NULL;
|
||||
STbData *pTbData = NULL;
|
||||
for (;;) {
|
||||
if (!tSkipListIterNext(pIter)) break;
|
||||
pNode = tSkipListIterGet(pIter);
|
||||
pTbData = (STbData *)pNode->pData;
|
||||
tsdbFreeTbData(pTbData);
|
||||
}
|
||||
tSkipListDestroyIter(pIter);
|
||||
tSkipListDestroy(pMemTable->pSlIdx);
|
||||
taosMemoryFree(pMemTable);
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ int tdbBtreeOpen(int keyLen, int valLen, SPager *pPager, tdb_cmpr_fn_t kcmpr, SB
|
|||
|
||||
int tdbBtreeClose(SBTree *pBt) {
|
||||
if (pBt) {
|
||||
tdbFree(pBt->pBuf);
|
||||
tdbOsFree(pBt);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -130,6 +130,7 @@ static int32_t walReadSeekVer(SWalReadHandle *pRead, int64_t ver) {
|
|||
}
|
||||
}
|
||||
|
||||
// code set inner
|
||||
if (walReadSeekFilePos(pRead, pRet->firstVer, ver) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -249,16 +250,22 @@ int32_t walReadWithHandle(SWalReadHandle *pRead, int64_t ver) {
|
|||
// TODO: check wal life
|
||||
if (pRead->curVersion != ver) {
|
||||
if (walReadSeekVer(pRead, ver) < 0) {
|
||||
terrno = TSDB_CODE_WAL_INVALID_VER;
|
||||
wError("unexpected wal log version: % " PRId64 ", since seek error", ver);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!taosValidFile(pRead->pReadLogTFile)) {
|
||||
return -1;
|
||||
}
|
||||
/*if (!taosValidFile(pRead->pReadLogTFile)) {*/
|
||||
/*return -1;*/
|
||||
/*}*/
|
||||
|
||||
code = taosReadFile(pRead->pReadLogTFile, pRead->pHead, sizeof(SWalHead));
|
||||
if (code != sizeof(SWalHead)) {
|
||||
if (code < 0)
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
else
|
||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -225,6 +225,7 @@ int walRoll(SWal *pWal) {
|
|||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
return -1;
|
||||
}
|
||||
// terrno set inner
|
||||
code = walRollFileInfo(pWal);
|
||||
if (code != 0) {
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue