[TD-3963]fix cache_last_row bug
This commit is contained in:
parent
97b0ca05e4
commit
e81c7324db
|
@ -907,13 +907,12 @@ int tsdbCacheLastData(STsdbRepo *pRepo, STsdbCfg* oldCfg) {
|
||||||
atomic_store_8(&pRepo->hasCachedLastColumn, 0);
|
atomic_store_8(&pRepo->hasCachedLastColumn, 0);
|
||||||
}
|
}
|
||||||
tsdbInfo("free cache last data since cacheLast option changed");
|
tsdbInfo("free cache last data since cacheLast option changed");
|
||||||
for (int i = 1; i < maxTableIdx; i++) {
|
for (int i = 1; i <= maxTableIdx; i++) {
|
||||||
STable *pTable = pMeta->tables[i];
|
STable *pTable = pMeta->tables[i];
|
||||||
if (pTable == NULL) continue;
|
if (pTable == NULL) continue;
|
||||||
if (need_free_last_row) {
|
if (need_free_last_row) {
|
||||||
taosTZfree(pTable->lastRow);
|
taosTZfree(pTable->lastRow);
|
||||||
pTable->lastRow = NULL;
|
pTable->lastRow = NULL;
|
||||||
pTable->lastKey = TSKEY_INITIAL_VAL;
|
|
||||||
}
|
}
|
||||||
if (need_free_last_col) {
|
if (need_free_last_col) {
|
||||||
tsdbFreeLastColumns(pTable);
|
tsdbFreeLastColumns(pTable);
|
||||||
|
|
|
@ -1030,7 +1030,6 @@ static int tsdbUpdateTableLatestInfo(STsdbRepo *pRepo, STable *pTable, SDataRow
|
||||||
taosTZfree(pTable->lastRow);
|
taosTZfree(pTable->lastRow);
|
||||||
TSDB_WLOCK_TABLE(pTable);
|
TSDB_WLOCK_TABLE(pTable);
|
||||||
pTable->lastRow = NULL;
|
pTable->lastRow = NULL;
|
||||||
pTable->lastKey = TSKEY_INITIAL_VAL;
|
|
||||||
TSDB_WUNLOCK_TABLE(pTable);
|
TSDB_WUNLOCK_TABLE(pTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue