diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 0e255d011b621cd4785c463bac5eea5ef67794af..478e7790fba3405139d94548b219d2e2e857e12e 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1004,7 +1004,7 @@ static int32_t mnodeAddSuperTableColumn(SDbObj *pDb, SSuperTableObj *pStable, SS sizeof(SSchema) * pStable->numOfTags); memcpy(pStable->schema + pStable->numOfColumns, schema, sizeof(SSchema) * ncols); - SSchema *tschema = (SSchema *) (pStable->schema + sizeof(SSchema) * pStable->numOfColumns); + SSchema *tschema = (SSchema *) (pStable->schema + pStable->numOfColumns); for (int32_t i = 0; i < ncols; i++) { tschema[i].colId = pStable->nextColId++; } diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index 67ba891f93237399b11ce53b8e9ea6ae06cfa582..0882ee983dfb6aca7831600e870885e0061ca75d 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -321,6 +321,22 @@ void vnodeRelease(void *pVnodeRaw) { return; } + if (pVnode->tsdb) + tsdbCloseRepo(pVnode->tsdb, 1); + pVnode->tsdb = NULL; + + if (pVnode->wal) + walClose(pVnode->wal); + pVnode->wal = NULL; + + if (pVnode->wqueue) + dnodeFreeVnodeWqueue(pVnode->wqueue); + pVnode->wqueue = NULL; + + if (pVnode->rqueue) + dnodeFreeVnodeRqueue(pVnode->rqueue); + pVnode->rqueue = NULL; + tfree(pVnode->rootDir); if (pVnode->status == TAOS_VN_STATUS_DELETING) { @@ -411,33 +427,21 @@ void vnodeBuildStatusMsg(void *param) { } static void vnodeCleanUp(SVnodeObj *pVnode) { + // remove from hash, so new messages wont be consumed taosHashRemove(tsDnodeVnodesHash, (const char *)&pVnode->vgId, sizeof(int32_t)); + // stop replication module if (pVnode->sync) { syncStop(pVnode->sync); pVnode->sync = NULL; } - if (pVnode->tsdb) - tsdbCloseRepo(pVnode->tsdb, 1); - pVnode->tsdb = NULL; - - if (pVnode->wal) - walClose(pVnode->wal); - pVnode->wal = NULL; - + // stop continuous query if (pVnode->cq) cqClose(pVnode->cq); pVnode->cq = NULL; - if (pVnode->wqueue) - dnodeFreeVnodeWqueue(pVnode->wqueue); - pVnode->wqueue = NULL; - - if (pVnode->rqueue) - dnodeFreeVnodeRqueue(pVnode->rqueue); - pVnode->rqueue = NULL; - + // release local resources only after cutting off outside connections vnodeRelease(pVnode); } diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index 7dec2c961e4d957d4adf2200cddb5974aea1214e..58ab8b99b41e62a5112f4d5013f1926affbf0f96 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -137,6 +137,7 @@ python3 ./test.py -f query/queryError.py python3 ./test.py -f query/filterAllIntTypes.py python3 ./test.py -f query/filterFloatAndDouble.py python3 ./test.py -f query/filterOtherTypes.py +python3 ./test.py -f query/querySort.py #stream python3 ./test.py -f stream/stream1.py diff --git a/tests/pytest/regressiontest.sh b/tests/pytest/regressiontest.sh index 743a837f5efb5235198ebd90223159aa42405013..97a069f237f345ffae889a8c0b70da5a5714c7da 100755 --- a/tests/pytest/regressiontest.sh +++ b/tests/pytest/regressiontest.sh @@ -133,6 +133,7 @@ python3 ./test.py -f user/pass_len.py python3 ./test.py -f query/filter.py python3 ./test.py -f query/filterAllIntTypes.py python3 ./test.py -f query/filterFloatAndDouble.py +python3 ./test.py -f query/querySort.py #stream