TDengine/source/dnode/mnode/impl/inc/mndStream.h

552 lines
23 KiB
C
Raw Normal View History

2022-03-10 09:15:45 +00:00
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_MND_STREAM_H_
#define _TD_MND_STREAM_H_
2025-04-24 01:11:54 +00:00
#include "stream.h"
2022-03-10 09:15:45 +00:00
#include "mndInt.h"
2024-01-25 08:53:30 +00:00
#include "mndTrans.h"
2022-03-10 09:15:45 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2025-06-11 08:18:19 +00:00
bool mstEventPassIsolation(int32_t num, int32_t event);
bool mstEventHandledChkSet(int32_t event);
2025-04-14 05:20:57 +00:00
typedef enum {
2025-04-30 10:39:59 +00:00
STM_ERR_TASK_NOT_EXISTS = 1,
2025-05-29 03:43:17 +00:00
STM_ERR_STREAM_STOPPED,
2025-04-30 10:39:59 +00:00
} EStmErrType;
2025-04-19 10:58:51 +00:00
2025-05-30 10:15:49 +00:00
typedef enum {
2025-06-06 01:09:40 +00:00
STM_EVENT_ACTIVE_BEGIN = 0,
STM_EVENT_NORMAL_BEGIN,
STM_EVENT_CREATE_STREAM,
STM_EVENT_DROP_STREAM,
STM_EVENT_STOP_STREAM,
STM_EVENT_START_STREAM,
STM_EVENT_CREATE_SNODE,
STM_EVENT_DROP_SNODE,
STM_EVENT_LOOP_SDB,
STM_EVENT_LOOP_MAP,
STM_EVENT_LOOP_SNODE,
2025-06-21 05:47:30 +00:00
STM_EVENT_STM_TERR,
2025-06-06 01:09:40 +00:00
STM_EVENT_MAX_VALUE
} SStmLastEvent;
2025-05-30 10:15:49 +00:00
2025-06-11 08:18:19 +00:00
static const char* gMndStreamEvent[] = {"ACTIVE_BEGIN", "NORMAL_BEGIN", "CREATE_STREAM", "DROP_STREAM", "STOP_STREAM", "START_STREAM",
2025-06-21 05:47:30 +00:00
"CREATE_SNODE", "DROP_SNODE", "LOOP_SDB", "LOOP_MAP", "LOOP_SNODE", "STREAM_TERR", "MAX_VALUE"};
2025-05-30 10:15:49 +00:00
2025-05-23 10:14:34 +00:00
#define MND_STM_STATE_WATCH 1
#define MND_STM_STATE_NORMAL 2
2025-05-30 00:56:34 +00:00
static const char* gMndStreamState[] = {"X", "W", "N"};
2025-05-23 10:14:34 +00:00
2025-04-28 01:11:20 +00:00
2025-04-29 00:37:37 +00:00
#define MND_STREAM_RUNNER_DEPLOY_NUM 3
feat(stream): optimize stream logic (#33027) * fix: remove debug log * fix: remove assert * fix: delete unused code * enh: [TD-37251] Support expr in state window. * feat(stream): support expr in state window trigger * enh: [TD-37251] Fix SCL_IS_CONST_CALC condition. * fix(stream): set ver in wal * fix: print code * fix: increase runner replica num * fix: trigger mem error * fix: sliding _tnext_ts value * fix(stream): disable tagFilterCache in stream reader trigger * fix: crash * Revert "fix(stream): fix history calc finish check" This reverts commit f93d17f1d27f011639d22cb0880637dbeb7e5532. * Revert "fix(stream): fix calc request allocation in trigger" This reverts commit c5410f6da09835303d32967f4b6d02a7e47cd589. * fix(stream): fix calc request allocation in trigger * enh: [TD-37251] External window support more placeholder. * fix(stream): modify size of return from 1000000->4096 * enh: [TD-37251] Modify error msg when stream query do not have from clause. * fix(stream): add log for group not found * fix(stream): do not return gid=0 in walMetaData interface * enh: [TD-37251] Fix missing ts column in vtable query. * fix: test case build failed * fix: invalid read issue * fix(stream): add vtable logic * fix(stream): encode error in wal * fix(stream): add vtable logic * fix(stream): add log * fix: diff funcition crash * Revert "Merge branch 'enh/TD-37251-3.0-dropoutput' into enh/TD-37251-3.0" This reverts commit e93cbd6fd42261527df046c70e0ece7568af187b, reversing changes made to dc3230591d4428c817703f52574aa01d5f10e5fe. * Revert "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit dc3230591d4428c817703f52574aa01d5f10e5fe, reversing changes made to 085e086782896db22acd292816e53497cbecb726. * fix(stream): fix block data len is too large if data type is vchar * fix: drop output table * feat: runner delete output table * process pDropBlock in trigger task. * fix(stream): opti log level * fix(stream): build block for drop table * fix(stream): set gid for normal table * fix(stream): set gid for normal table * feat: Support delete output. * fix(stream): rows error * fix(stream): memory leak * enh: [TD-37251] Fix external window wrong ts column. * fix(stream): fix calc time check in batch mode * fix: merge aligned external window issue * Revert "fix(stream): fix calc time check in batch mode" This reverts commit d895b7f5776cf77c2ce290cdeedca86c206da6ce. * fix(stream): add test case * fix(stream): add insert drop table logic * fix: external window end issue * fix(stream): add test case * fix(stream): fix trigger pull data * fix(stream): fix history calc request * enh: drop table on snode * fix(stream): adjust hash index if data is filtered in wal * fix(stream): rollback * enh: add merge aligned extwin window row idx * fix: drop output table * fix: compile issue * enh: [TD-37251] Add flag to identify interval window is overlapped * fix: overlap * fix(stream): set gid=-1 for initialized * fix(stream): modify log level * fix: trigger slow issue * fix(stream): add basic test for obj pool * fix(stream): fix metadata clear in trigger * fix(stream): fix idle runner allocation in trigger * fix: handle agg output on externalWin * fix: test case * fix(stream): adjust log * fix: reset pCtx pOutput * fix: memory leak * fix: search first win for tsCol * fix(stream): add test case for schema change * fix: mem leak * fix: mem leak * Reapply "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit b508e66958eb95117b1d086a964b87b5ac59a19e. * fix(stream): fix virtual table data pull * fix(stream): fix set table request * fix(stream): process empty uidlist * fix(stream): fix set table request * fix(stream): fix data new request in trigger * fix(stream): tablelist error for vtable * fix(stream): block ver is null * fix(stream): remove version limition for wal * fix(stream): block rows error * fix(stream): fix pending calc param in batch mode * fix(stream): auto create table * fix(stream): fix stream vtable data merge * fix: _tcurrentts * fix(stream): destroy hash * fix(stream): fix trigger status * fix(stream): colId error in vtable * fix(stream): update nrows of vtable data block * fix(stream): fix trigger status * fix(stream): enable low latency calc for period trigger * fix: test case file path * fix: test case file path * fix: string to node in reader * enh: add test log * fix(stream): increase wait time of non-low-latency mode * fix(stream): fix column capacity in scalar calculation * fix(stream): fix column capacity in trigger expr calculation * fix: get origTableInfos * fix(stream): fix calc data pull in trigger * fix(stream): fix calc data cache write in trigger * enh: [TD-37251] Add flag to identify interval wind * fix: external window memory usage issue * fix(stream): fix epxr result column in trigger * fix(stream): add metaCache for calc plan * fix(stream): fix stream obj list clear * fix(stream): rollback * enh: [TD-37251] Add flag to identify interval wind * fix: mem free * fix(stream): add metaCache for calc plan * fix(stream): fix calc data cache write in trigger * fix(stream): fix calc data cache write in trigger * enh: optimize external result block memory * fix(stream): modify logic of judge table for create table * fix(stream): fix event window check in trigger * fix(stream): fix count window check in trigger * fix(stream): colSize=0 while encoding block because pDataCol->hasNull is false in secode time & reload table list if create table * enh: optimize stream memory * fix(stream): trigger tag error * fix: add log * fix(stream): fix calc data write in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix(build): handle return value of function * fix(stream): read gid error if it is child table in stream * fix(stream): fix calc param of history calculation * fix(stream): fix recalc of delete data * fix(stream): fix calc data of period trigger * fix(stream): fix cache read check * fix(stream): filter error in calc plan * fix: reset externla window expr * fix(stream): fix calc parm of max delay * fix: time range and case issues * fix(stream): fix crash in trigger * fix: case issues * fix: fix window node mem leak. * fix(stream): fix meta data clear in trigger * fix(stream): table schema is old in TsdbDataRequest for vtable * fix: fix slingding window place holder check condition. * Revert "fix: fix slingding window place holder check condition." This reverts commit ad864a1dc113961b409e32e2ac7d1feb534b74d6. * fix(stream): null pointer error * fix: case issue * fix(stream): calc data error for vtable * fix(stream): fix data sorter in trigger * fix(stream): add log for delete data * fix(stream): fix start version of realtime calculation * fix(stream): fix cache data merger of vtable * fix: case issues * fix(ci): upgrade stream cases in test_cols_function * fix(stream): gid not found if change tag value * fix: fix slingding window place holder check condition. * fix(stream): fix virt table info request in trigger * fix(stream): set gid = uid if stream table type != SUPER table * fix: clean cache data by group * fix: add block info and case issues * fix: fix heap-buffer-overflow. * fix(stream): fix state window with extend param * fix: fix access null pointer. * fix: case issues * fix: case issue * fix(stream): fix ignore_nodata_trigger option for period trigger * fix(stream): fix pseudo col fetch for calc data * fix: Extend checking time to avoid timeout. * fix: case issues * fix(stream): fix group col fetch for virtual tables * fix(stream): tag is NULL for non vtable * fix(stream): fix sliding check of virtual table * test(stream): check stream status after create all streams * fix: add log * fix(stream): fix wal meta truncate when ignore disorder * fix(stream): gid not found for child table * fix: fix place holder condition pushdown error. * fix(stream): suid not equal when delete data for child table * fix: id issue * fix(stream): disable recalc for count trigger * fix: cast result rowSize error in project * fix(stream): add log for tsdb meta * fix(stream): fix gid in tsdb meta request * fix(stream): fix wend of unclosed windows * fix(stream): fix ignore_nodata_trigger option for period trigger * fix: case issues * fix(stream): fix calc data pull for empty interval window * fix: fix ext window condition. * fix(ci): smaBasic performance check affectd by debug level log * fix(stream): add suid when set table list for vtable * fix: forbid using prefilter when using %%trows an trigger table is virtual table. * fix: forbid prefilter %%trows cases. * fix(stream): sort cid in tsdbVirtalDataReq * fix: forbid prefilter %%trows cases. * fix(stream): add log for virtual table tsdb data * fix(stream): get delete msg for vtable * fix: winRowIndex * Revert "fix: winRowIndex" This reverts commit e08b41cf960bb9ca031b9ea20b4495cbbd4e3ed0. * fix(stream): fix data merge in trigger * test(stream): fix case ans * fix(stream): fix empty calc data pull for period trigger * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix: case issue * fix: crash issue * fix: forbid prefilter %%trows cases. * fix(stream): session case * fix(stream): fix data pull for virtual tables * fix(stream): add log * fix(stream): fix calc req send in batch mode * fix: fix stream UT * fix(stream): tablelist is null for non vtable * fix: mem leak * fix(stream): fix compile error in trigger * fix: return code issue --------- Co-authored-by: dapan1121 <wpan@taosdata.com> Co-authored-by: facetosea <285808407@qq.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: Jinqing Kuang <kuangjinqingcn@gmail.com> Co-authored-by: Tony Zhang <tonyzhang@taosdata.com>
2025-09-25 07:48:14 +00:00
#define MND_STREAM_RUNNER_REPLICA_NUM 5
#define MND_STREAM_ISOLATION_PERIOD_NUM 10
2025-04-28 01:11:20 +00:00
#define MND_STREAM_REPORT_PERIOD (STREAM_HB_INTERVAL_MS * STREAM_MAX_GROUP_NUM)
feat(stream): optimize stream logic (#33027) * fix: remove debug log * fix: remove assert * fix: delete unused code * enh: [TD-37251] Support expr in state window. * feat(stream): support expr in state window trigger * enh: [TD-37251] Fix SCL_IS_CONST_CALC condition. * fix(stream): set ver in wal * fix: print code * fix: increase runner replica num * fix: trigger mem error * fix: sliding _tnext_ts value * fix(stream): disable tagFilterCache in stream reader trigger * fix: crash * Revert "fix(stream): fix history calc finish check" This reverts commit f93d17f1d27f011639d22cb0880637dbeb7e5532. * Revert "fix(stream): fix calc request allocation in trigger" This reverts commit c5410f6da09835303d32967f4b6d02a7e47cd589. * fix(stream): fix calc request allocation in trigger * enh: [TD-37251] External window support more placeholder. * fix(stream): modify size of return from 1000000->4096 * enh: [TD-37251] Modify error msg when stream query do not have from clause. * fix(stream): add log for group not found * fix(stream): do not return gid=0 in walMetaData interface * enh: [TD-37251] Fix missing ts column in vtable query. * fix: test case build failed * fix: invalid read issue * fix(stream): add vtable logic * fix(stream): encode error in wal * fix(stream): add vtable logic * fix(stream): add log * fix: diff funcition crash * Revert "Merge branch 'enh/TD-37251-3.0-dropoutput' into enh/TD-37251-3.0" This reverts commit e93cbd6fd42261527df046c70e0ece7568af187b, reversing changes made to dc3230591d4428c817703f52574aa01d5f10e5fe. * Revert "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit dc3230591d4428c817703f52574aa01d5f10e5fe, reversing changes made to 085e086782896db22acd292816e53497cbecb726. * fix(stream): fix block data len is too large if data type is vchar * fix: drop output table * feat: runner delete output table * process pDropBlock in trigger task. * fix(stream): opti log level * fix(stream): build block for drop table * fix(stream): set gid for normal table * fix(stream): set gid for normal table * feat: Support delete output. * fix(stream): rows error * fix(stream): memory leak * enh: [TD-37251] Fix external window wrong ts column. * fix(stream): fix calc time check in batch mode * fix: merge aligned external window issue * Revert "fix(stream): fix calc time check in batch mode" This reverts commit d895b7f5776cf77c2ce290cdeedca86c206da6ce. * fix(stream): add test case * fix(stream): add insert drop table logic * fix: external window end issue * fix(stream): add test case * fix(stream): fix trigger pull data * fix(stream): fix history calc request * enh: drop table on snode * fix(stream): adjust hash index if data is filtered in wal * fix(stream): rollback * enh: add merge aligned extwin window row idx * fix: drop output table * fix: compile issue * enh: [TD-37251] Add flag to identify interval window is overlapped * fix: overlap * fix(stream): set gid=-1 for initialized * fix(stream): modify log level * fix: trigger slow issue * fix(stream): add basic test for obj pool * fix(stream): fix metadata clear in trigger * fix(stream): fix idle runner allocation in trigger * fix: handle agg output on externalWin * fix: test case * fix(stream): adjust log * fix: reset pCtx pOutput * fix: memory leak * fix: search first win for tsCol * fix(stream): add test case for schema change * fix: mem leak * fix: mem leak * Reapply "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit b508e66958eb95117b1d086a964b87b5ac59a19e. * fix(stream): fix virtual table data pull * fix(stream): fix set table request * fix(stream): process empty uidlist * fix(stream): fix set table request * fix(stream): fix data new request in trigger * fix(stream): tablelist error for vtable * fix(stream): block ver is null * fix(stream): remove version limition for wal * fix(stream): block rows error * fix(stream): fix pending calc param in batch mode * fix(stream): auto create table * fix(stream): fix stream vtable data merge * fix: _tcurrentts * fix(stream): destroy hash * fix(stream): fix trigger status * fix(stream): colId error in vtable * fix(stream): update nrows of vtable data block * fix(stream): fix trigger status * fix(stream): enable low latency calc for period trigger * fix: test case file path * fix: test case file path * fix: string to node in reader * enh: add test log * fix(stream): increase wait time of non-low-latency mode * fix(stream): fix column capacity in scalar calculation * fix(stream): fix column capacity in trigger expr calculation * fix: get origTableInfos * fix(stream): fix calc data pull in trigger * fix(stream): fix calc data cache write in trigger * enh: [TD-37251] Add flag to identify interval wind * fix: external window memory usage issue * fix(stream): fix epxr result column in trigger * fix(stream): add metaCache for calc plan * fix(stream): fix stream obj list clear * fix(stream): rollback * enh: [TD-37251] Add flag to identify interval wind * fix: mem free * fix(stream): add metaCache for calc plan * fix(stream): fix calc data cache write in trigger * fix(stream): fix calc data cache write in trigger * enh: optimize external result block memory * fix(stream): modify logic of judge table for create table * fix(stream): fix event window check in trigger * fix(stream): fix count window check in trigger * fix(stream): colSize=0 while encoding block because pDataCol->hasNull is false in secode time & reload table list if create table * enh: optimize stream memory * fix(stream): trigger tag error * fix: add log * fix(stream): fix calc data write in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix(build): handle return value of function * fix(stream): read gid error if it is child table in stream * fix(stream): fix calc param of history calculation * fix(stream): fix recalc of delete data * fix(stream): fix calc data of period trigger * fix(stream): fix cache read check * fix(stream): filter error in calc plan * fix: reset externla window expr * fix(stream): fix calc parm of max delay * fix: time range and case issues * fix(stream): fix crash in trigger * fix: case issues * fix: fix window node mem leak. * fix(stream): fix meta data clear in trigger * fix(stream): table schema is old in TsdbDataRequest for vtable * fix: fix slingding window place holder check condition. * Revert "fix: fix slingding window place holder check condition." This reverts commit ad864a1dc113961b409e32e2ac7d1feb534b74d6. * fix(stream): null pointer error * fix: case issue * fix(stream): calc data error for vtable * fix(stream): fix data sorter in trigger * fix(stream): add log for delete data * fix(stream): fix start version of realtime calculation * fix(stream): fix cache data merger of vtable * fix: case issues * fix(ci): upgrade stream cases in test_cols_function * fix(stream): gid not found if change tag value * fix: fix slingding window place holder check condition. * fix(stream): fix virt table info request in trigger * fix(stream): set gid = uid if stream table type != SUPER table * fix: clean cache data by group * fix: add block info and case issues * fix: fix heap-buffer-overflow. * fix(stream): fix state window with extend param * fix: fix access null pointer. * fix: case issues * fix: case issue * fix(stream): fix ignore_nodata_trigger option for period trigger * fix(stream): fix pseudo col fetch for calc data * fix: Extend checking time to avoid timeout. * fix: case issues * fix(stream): fix group col fetch for virtual tables * fix(stream): tag is NULL for non vtable * fix(stream): fix sliding check of virtual table * test(stream): check stream status after create all streams * fix: add log * fix(stream): fix wal meta truncate when ignore disorder * fix(stream): gid not found for child table * fix: fix place holder condition pushdown error. * fix(stream): suid not equal when delete data for child table * fix: id issue * fix(stream): disable recalc for count trigger * fix: cast result rowSize error in project * fix(stream): add log for tsdb meta * fix(stream): fix gid in tsdb meta request * fix(stream): fix wend of unclosed windows * fix(stream): fix ignore_nodata_trigger option for period trigger * fix: case issues * fix(stream): fix calc data pull for empty interval window * fix: fix ext window condition. * fix(ci): smaBasic performance check affectd by debug level log * fix(stream): add suid when set table list for vtable * fix: forbid using prefilter when using %%trows an trigger table is virtual table. * fix: forbid prefilter %%trows cases. * fix(stream): sort cid in tsdbVirtalDataReq * fix: forbid prefilter %%trows cases. * fix(stream): add log for virtual table tsdb data * fix(stream): get delete msg for vtable * fix: winRowIndex * Revert "fix: winRowIndex" This reverts commit e08b41cf960bb9ca031b9ea20b4495cbbd4e3ed0. * fix(stream): fix data merge in trigger * test(stream): fix case ans * fix(stream): fix empty calc data pull for period trigger * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix: case issue * fix: crash issue * fix: forbid prefilter %%trows cases. * fix(stream): session case * fix(stream): fix data pull for virtual tables * fix(stream): add log * fix(stream): fix calc req send in batch mode * fix: fix stream UT * fix(stream): tablelist is null for non vtable * fix: mem leak * fix(stream): fix compile error in trigger * fix: return code issue --------- Co-authored-by: dapan1121 <wpan@taosdata.com> Co-authored-by: facetosea <285808407@qq.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: Jinqing Kuang <kuangjinqingcn@gmail.com> Co-authored-by: Tony Zhang <tonyzhang@taosdata.com>
2025-09-25 07:48:14 +00:00
#define MST_SHORT_ISOLATION_DURATION (MND_STREAM_REPORT_PERIOD * MND_STREAM_ISOLATION_PERIOD_NUM / 3)
2025-05-30 10:15:49 +00:00
#define MST_ISOLATION_DURATION (MND_STREAM_REPORT_PERIOD * MND_STREAM_ISOLATION_PERIOD_NUM)
2025-05-10 09:16:39 +00:00
#define MND_STREAM_HEALTH_CHECK_PERIOD_SEC (MND_STREAM_REPORT_PERIOD / 1000)
feat(stream): optimize stream logic (#33027) * fix: remove debug log * fix: remove assert * fix: delete unused code * enh: [TD-37251] Support expr in state window. * feat(stream): support expr in state window trigger * enh: [TD-37251] Fix SCL_IS_CONST_CALC condition. * fix(stream): set ver in wal * fix: print code * fix: increase runner replica num * fix: trigger mem error * fix: sliding _tnext_ts value * fix(stream): disable tagFilterCache in stream reader trigger * fix: crash * Revert "fix(stream): fix history calc finish check" This reverts commit f93d17f1d27f011639d22cb0880637dbeb7e5532. * Revert "fix(stream): fix calc request allocation in trigger" This reverts commit c5410f6da09835303d32967f4b6d02a7e47cd589. * fix(stream): fix calc request allocation in trigger * enh: [TD-37251] External window support more placeholder. * fix(stream): modify size of return from 1000000->4096 * enh: [TD-37251] Modify error msg when stream query do not have from clause. * fix(stream): add log for group not found * fix(stream): do not return gid=0 in walMetaData interface * enh: [TD-37251] Fix missing ts column in vtable query. * fix: test case build failed * fix: invalid read issue * fix(stream): add vtable logic * fix(stream): encode error in wal * fix(stream): add vtable logic * fix(stream): add log * fix: diff funcition crash * Revert "Merge branch 'enh/TD-37251-3.0-dropoutput' into enh/TD-37251-3.0" This reverts commit e93cbd6fd42261527df046c70e0ece7568af187b, reversing changes made to dc3230591d4428c817703f52574aa01d5f10e5fe. * Revert "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit dc3230591d4428c817703f52574aa01d5f10e5fe, reversing changes made to 085e086782896db22acd292816e53497cbecb726. * fix(stream): fix block data len is too large if data type is vchar * fix: drop output table * feat: runner delete output table * process pDropBlock in trigger task. * fix(stream): opti log level * fix(stream): build block for drop table * fix(stream): set gid for normal table * fix(stream): set gid for normal table * feat: Support delete output. * fix(stream): rows error * fix(stream): memory leak * enh: [TD-37251] Fix external window wrong ts column. * fix(stream): fix calc time check in batch mode * fix: merge aligned external window issue * Revert "fix(stream): fix calc time check in batch mode" This reverts commit d895b7f5776cf77c2ce290cdeedca86c206da6ce. * fix(stream): add test case * fix(stream): add insert drop table logic * fix: external window end issue * fix(stream): add test case * fix(stream): fix trigger pull data * fix(stream): fix history calc request * enh: drop table on snode * fix(stream): adjust hash index if data is filtered in wal * fix(stream): rollback * enh: add merge aligned extwin window row idx * fix: drop output table * fix: compile issue * enh: [TD-37251] Add flag to identify interval window is overlapped * fix: overlap * fix(stream): set gid=-1 for initialized * fix(stream): modify log level * fix: trigger slow issue * fix(stream): add basic test for obj pool * fix(stream): fix metadata clear in trigger * fix(stream): fix idle runner allocation in trigger * fix: handle agg output on externalWin * fix: test case * fix(stream): adjust log * fix: reset pCtx pOutput * fix: memory leak * fix: search first win for tsCol * fix(stream): add test case for schema change * fix: mem leak * fix: mem leak * Reapply "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit b508e66958eb95117b1d086a964b87b5ac59a19e. * fix(stream): fix virtual table data pull * fix(stream): fix set table request * fix(stream): process empty uidlist * fix(stream): fix set table request * fix(stream): fix data new request in trigger * fix(stream): tablelist error for vtable * fix(stream): block ver is null * fix(stream): remove version limition for wal * fix(stream): block rows error * fix(stream): fix pending calc param in batch mode * fix(stream): auto create table * fix(stream): fix stream vtable data merge * fix: _tcurrentts * fix(stream): destroy hash * fix(stream): fix trigger status * fix(stream): colId error in vtable * fix(stream): update nrows of vtable data block * fix(stream): fix trigger status * fix(stream): enable low latency calc for period trigger * fix: test case file path * fix: test case file path * fix: string to node in reader * enh: add test log * fix(stream): increase wait time of non-low-latency mode * fix(stream): fix column capacity in scalar calculation * fix(stream): fix column capacity in trigger expr calculation * fix: get origTableInfos * fix(stream): fix calc data pull in trigger * fix(stream): fix calc data cache write in trigger * enh: [TD-37251] Add flag to identify interval wind * fix: external window memory usage issue * fix(stream): fix epxr result column in trigger * fix(stream): add metaCache for calc plan * fix(stream): fix stream obj list clear * fix(stream): rollback * enh: [TD-37251] Add flag to identify interval wind * fix: mem free * fix(stream): add metaCache for calc plan * fix(stream): fix calc data cache write in trigger * fix(stream): fix calc data cache write in trigger * enh: optimize external result block memory * fix(stream): modify logic of judge table for create table * fix(stream): fix event window check in trigger * fix(stream): fix count window check in trigger * fix(stream): colSize=0 while encoding block because pDataCol->hasNull is false in secode time & reload table list if create table * enh: optimize stream memory * fix(stream): trigger tag error * fix: add log * fix(stream): fix calc data write in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix(build): handle return value of function * fix(stream): read gid error if it is child table in stream * fix(stream): fix calc param of history calculation * fix(stream): fix recalc of delete data * fix(stream): fix calc data of period trigger * fix(stream): fix cache read check * fix(stream): filter error in calc plan * fix: reset externla window expr * fix(stream): fix calc parm of max delay * fix: time range and case issues * fix(stream): fix crash in trigger * fix: case issues * fix: fix window node mem leak. * fix(stream): fix meta data clear in trigger * fix(stream): table schema is old in TsdbDataRequest for vtable * fix: fix slingding window place holder check condition. * Revert "fix: fix slingding window place holder check condition." This reverts commit ad864a1dc113961b409e32e2ac7d1feb534b74d6. * fix(stream): null pointer error * fix: case issue * fix(stream): calc data error for vtable * fix(stream): fix data sorter in trigger * fix(stream): add log for delete data * fix(stream): fix start version of realtime calculation * fix(stream): fix cache data merger of vtable * fix: case issues * fix(ci): upgrade stream cases in test_cols_function * fix(stream): gid not found if change tag value * fix: fix slingding window place holder check condition. * fix(stream): fix virt table info request in trigger * fix(stream): set gid = uid if stream table type != SUPER table * fix: clean cache data by group * fix: add block info and case issues * fix: fix heap-buffer-overflow. * fix(stream): fix state window with extend param * fix: fix access null pointer. * fix: case issues * fix: case issue * fix(stream): fix ignore_nodata_trigger option for period trigger * fix(stream): fix pseudo col fetch for calc data * fix: Extend checking time to avoid timeout. * fix: case issues * fix(stream): fix group col fetch for virtual tables * fix(stream): tag is NULL for non vtable * fix(stream): fix sliding check of virtual table * test(stream): check stream status after create all streams * fix: add log * fix(stream): fix wal meta truncate when ignore disorder * fix(stream): gid not found for child table * fix: fix place holder condition pushdown error. * fix(stream): suid not equal when delete data for child table * fix: id issue * fix(stream): disable recalc for count trigger * fix: cast result rowSize error in project * fix(stream): add log for tsdb meta * fix(stream): fix gid in tsdb meta request * fix(stream): fix wend of unclosed windows * fix(stream): fix ignore_nodata_trigger option for period trigger * fix: case issues * fix(stream): fix calc data pull for empty interval window * fix: fix ext window condition. * fix(ci): smaBasic performance check affectd by debug level log * fix(stream): add suid when set table list for vtable * fix: forbid using prefilter when using %%trows an trigger table is virtual table. * fix: forbid prefilter %%trows cases. * fix(stream): sort cid in tsdbVirtalDataReq * fix: forbid prefilter %%trows cases. * fix(stream): add log for virtual table tsdb data * fix(stream): get delete msg for vtable * fix: winRowIndex * Revert "fix: winRowIndex" This reverts commit e08b41cf960bb9ca031b9ea20b4495cbbd4e3ed0. * fix(stream): fix data merge in trigger * test(stream): fix case ans * fix(stream): fix empty calc data pull for period trigger * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix: case issue * fix: crash issue * fix: forbid prefilter %%trows cases. * fix(stream): session case * fix(stream): fix data pull for virtual tables * fix(stream): add log * fix(stream): fix calc req send in batch mode * fix: fix stream UT * fix(stream): tablelist is null for non vtable * fix: mem leak * fix(stream): fix compile error in trigger * fix: return code issue --------- Co-authored-by: dapan1121 <wpan@taosdata.com> Co-authored-by: facetosea <285808407@qq.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: Jinqing Kuang <kuangjinqingcn@gmail.com> Co-authored-by: Tony Zhang <tonyzhang@taosdata.com>
2025-09-25 07:48:14 +00:00
#define MST_MAX_RETRY_DURATION (MST_ISOLATION_DURATION * 20)
2025-04-28 01:11:20 +00:00
2025-05-30 10:15:49 +00:00
#define MST_PASS_ISOLATION(_ts, _n) (((_ts) + (_n) * MST_ISOLATION_DURATION) <= mStreamMgmt.hCtx.currentTs)
feat(stream): optimize stream logic (#33027) * fix: remove debug log * fix: remove assert * fix: delete unused code * enh: [TD-37251] Support expr in state window. * feat(stream): support expr in state window trigger * enh: [TD-37251] Fix SCL_IS_CONST_CALC condition. * fix(stream): set ver in wal * fix: print code * fix: increase runner replica num * fix: trigger mem error * fix: sliding _tnext_ts value * fix(stream): disable tagFilterCache in stream reader trigger * fix: crash * Revert "fix(stream): fix history calc finish check" This reverts commit f93d17f1d27f011639d22cb0880637dbeb7e5532. * Revert "fix(stream): fix calc request allocation in trigger" This reverts commit c5410f6da09835303d32967f4b6d02a7e47cd589. * fix(stream): fix calc request allocation in trigger * enh: [TD-37251] External window support more placeholder. * fix(stream): modify size of return from 1000000->4096 * enh: [TD-37251] Modify error msg when stream query do not have from clause. * fix(stream): add log for group not found * fix(stream): do not return gid=0 in walMetaData interface * enh: [TD-37251] Fix missing ts column in vtable query. * fix: test case build failed * fix: invalid read issue * fix(stream): add vtable logic * fix(stream): encode error in wal * fix(stream): add vtable logic * fix(stream): add log * fix: diff funcition crash * Revert "Merge branch 'enh/TD-37251-3.0-dropoutput' into enh/TD-37251-3.0" This reverts commit e93cbd6fd42261527df046c70e0ece7568af187b, reversing changes made to dc3230591d4428c817703f52574aa01d5f10e5fe. * Revert "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit dc3230591d4428c817703f52574aa01d5f10e5fe, reversing changes made to 085e086782896db22acd292816e53497cbecb726. * fix(stream): fix block data len is too large if data type is vchar * fix: drop output table * feat: runner delete output table * process pDropBlock in trigger task. * fix(stream): opti log level * fix(stream): build block for drop table * fix(stream): set gid for normal table * fix(stream): set gid for normal table * feat: Support delete output. * fix(stream): rows error * fix(stream): memory leak * enh: [TD-37251] Fix external window wrong ts column. * fix(stream): fix calc time check in batch mode * fix: merge aligned external window issue * Revert "fix(stream): fix calc time check in batch mode" This reverts commit d895b7f5776cf77c2ce290cdeedca86c206da6ce. * fix(stream): add test case * fix(stream): add insert drop table logic * fix: external window end issue * fix(stream): add test case * fix(stream): fix trigger pull data * fix(stream): fix history calc request * enh: drop table on snode * fix(stream): adjust hash index if data is filtered in wal * fix(stream): rollback * enh: add merge aligned extwin window row idx * fix: drop output table * fix: compile issue * enh: [TD-37251] Add flag to identify interval window is overlapped * fix: overlap * fix(stream): set gid=-1 for initialized * fix(stream): modify log level * fix: trigger slow issue * fix(stream): add basic test for obj pool * fix(stream): fix metadata clear in trigger * fix(stream): fix idle runner allocation in trigger * fix: handle agg output on externalWin * fix: test case * fix(stream): adjust log * fix: reset pCtx pOutput * fix: memory leak * fix: search first win for tsCol * fix(stream): add test case for schema change * fix: mem leak * fix: mem leak * Reapply "Merge branch 'enh/TD-37251-3.0-vtable' into enh/TD-37251-3.0" This reverts commit b508e66958eb95117b1d086a964b87b5ac59a19e. * fix(stream): fix virtual table data pull * fix(stream): fix set table request * fix(stream): process empty uidlist * fix(stream): fix set table request * fix(stream): fix data new request in trigger * fix(stream): tablelist error for vtable * fix(stream): block ver is null * fix(stream): remove version limition for wal * fix(stream): block rows error * fix(stream): fix pending calc param in batch mode * fix(stream): auto create table * fix(stream): fix stream vtable data merge * fix: _tcurrentts * fix(stream): destroy hash * fix(stream): fix trigger status * fix(stream): colId error in vtable * fix(stream): update nrows of vtable data block * fix(stream): fix trigger status * fix(stream): enable low latency calc for period trigger * fix: test case file path * fix: test case file path * fix: string to node in reader * enh: add test log * fix(stream): increase wait time of non-low-latency mode * fix(stream): fix column capacity in scalar calculation * fix(stream): fix column capacity in trigger expr calculation * fix: get origTableInfos * fix(stream): fix calc data pull in trigger * fix(stream): fix calc data cache write in trigger * enh: [TD-37251] Add flag to identify interval wind * fix: external window memory usage issue * fix(stream): fix epxr result column in trigger * fix(stream): add metaCache for calc plan * fix(stream): fix stream obj list clear * fix(stream): rollback * enh: [TD-37251] Add flag to identify interval wind * fix: mem free * fix(stream): add metaCache for calc plan * fix(stream): fix calc data cache write in trigger * fix(stream): fix calc data cache write in trigger * enh: optimize external result block memory * fix(stream): modify logic of judge table for create table * fix(stream): fix event window check in trigger * fix(stream): fix count window check in trigger * fix(stream): colSize=0 while encoding block because pDataCol->hasNull is false in secode time & reload table list if create table * enh: optimize stream memory * fix(stream): trigger tag error * fix: add log * fix(stream): fix calc data write in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix: drop output table * fix(stream): fix max delay in trigger * fix(build): handle return value of function * fix(stream): read gid error if it is child table in stream * fix(stream): fix calc param of history calculation * fix(stream): fix recalc of delete data * fix(stream): fix calc data of period trigger * fix(stream): fix cache read check * fix(stream): filter error in calc plan * fix: reset externla window expr * fix(stream): fix calc parm of max delay * fix: time range and case issues * fix(stream): fix crash in trigger * fix: case issues * fix: fix window node mem leak. * fix(stream): fix meta data clear in trigger * fix(stream): table schema is old in TsdbDataRequest for vtable * fix: fix slingding window place holder check condition. * Revert "fix: fix slingding window place holder check condition." This reverts commit ad864a1dc113961b409e32e2ac7d1feb534b74d6. * fix(stream): null pointer error * fix: case issue * fix(stream): calc data error for vtable * fix(stream): fix data sorter in trigger * fix(stream): add log for delete data * fix(stream): fix start version of realtime calculation * fix(stream): fix cache data merger of vtable * fix: case issues * fix(ci): upgrade stream cases in test_cols_function * fix(stream): gid not found if change tag value * fix: fix slingding window place holder check condition. * fix(stream): fix virt table info request in trigger * fix(stream): set gid = uid if stream table type != SUPER table * fix: clean cache data by group * fix: add block info and case issues * fix: fix heap-buffer-overflow. * fix(stream): fix state window with extend param * fix: fix access null pointer. * fix: case issues * fix: case issue * fix(stream): fix ignore_nodata_trigger option for period trigger * fix(stream): fix pseudo col fetch for calc data * fix: Extend checking time to avoid timeout. * fix: case issues * fix(stream): fix group col fetch for virtual tables * fix(stream): tag is NULL for non vtable * fix(stream): fix sliding check of virtual table * test(stream): check stream status after create all streams * fix: add log * fix(stream): fix wal meta truncate when ignore disorder * fix(stream): gid not found for child table * fix: fix place holder condition pushdown error. * fix(stream): suid not equal when delete data for child table * fix: id issue * fix(stream): disable recalc for count trigger * fix: cast result rowSize error in project * fix(stream): add log for tsdb meta * fix(stream): fix gid in tsdb meta request * fix(stream): fix wend of unclosed windows * fix(stream): fix ignore_nodata_trigger option for period trigger * fix: case issues * fix(stream): fix calc data pull for empty interval window * fix: fix ext window condition. * fix(ci): smaBasic performance check affectd by debug level log * fix(stream): add suid when set table list for vtable * fix: forbid using prefilter when using %%trows an trigger table is virtual table. * fix: forbid prefilter %%trows cases. * fix(stream): sort cid in tsdbVirtalDataReq * fix: forbid prefilter %%trows cases. * fix(stream): add log for virtual table tsdb data * fix(stream): get delete msg for vtable * fix: winRowIndex * Revert "fix: winRowIndex" This reverts commit e08b41cf960bb9ca031b9ea20b4495cbbd4e3ed0. * fix(stream): fix data merge in trigger * test(stream): fix case ans * fix(stream): fix empty calc data pull for period trigger * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix(stream): col index error for tsdbVirtalDataReq * fix(stream): pTableList is NULL for vtable * test(stream): fix case ans * fix(stream): fix notification in trigger * fix(stream): memory leak * fix(stream): fix virtual data pull in trigger * test(stream): fix case ans * fix: case issue * fix: crash issue * fix: forbid prefilter %%trows cases. * fix(stream): session case * fix(stream): fix data pull for virtual tables * fix(stream): add log * fix(stream): fix calc req send in batch mode * fix: fix stream UT * fix(stream): tablelist is null for non vtable * fix: mem leak * fix(stream): fix compile error in trigger * fix: return code issue --------- Co-authored-by: dapan1121 <wpan@taosdata.com> Co-authored-by: facetosea <285808407@qq.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: Jinqing Kuang <kuangjinqingcn@gmail.com> Co-authored-by: Tony Zhang <tonyzhang@taosdata.com>
2025-09-25 07:48:14 +00:00
#define MST_PASS_SHORT_ISOLATION(_ts, _n) (((_ts) + (_n) * MST_SHORT_ISOLATION_DURATION) <= mStreamMgmt.hCtx.currentTs)
#define MST_STM_STATIC_PASS_SHORT_ISOLATION(_s) (MST_PASS_SHORT_ISOLATION((_s)->updateTime, 1))
2025-05-30 10:15:49 +00:00
#define MST_STM_STATIC_PASS_ISOLATION(_s) (MST_PASS_ISOLATION((_s)->updateTime, 1))
#define MST_STM_PROC_PASS_ISOLATION(_d) (MST_PASS_ISOLATION((_d)->lastActionTs, 1))
#define MST_STM_PASS_ISOLATION(_s, _d) (MST_STM_STATIC_PASS_ISOLATION(_s) && MST_STM_PROC_PASS_ISOLATION(_d))
2025-06-06 01:09:40 +00:00
#define MST_EVENT_HANDLED_CHECK_SET(_ev) (0 == atomic_val_compare_exchange_8((int8_t*)&mStreamMgmt.lastTs[(_ev)].handled, 0, 1))
2025-06-11 08:18:19 +00:00
#define MST_NORMAL_STATUS_NEED_HANDLE() (mstEventPassIsolation(1, STM_EVENT_NORMAL_BEGIN) && mstEventHandledChkSet(STM_EVENT_NORMAL_BEGIN))
#define MST_USER_OP_NEED_HANDLE(_op) (mstEventPassIsolation(5, (_op)) && mstEventHandledChkSet(_op))
2025-06-06 01:09:40 +00:00
#define MST_CREATE_START_STM_NEED_HANDLE() (MST_USER_OP_NEED_HANDLE(STM_EVENT_CREATE_STREAM) || MST_USER_OP_NEED_HANDLE(STM_EVENT_START_STREAM))
#define MST_DROP_STOP_STM_NEED_HANDLE() (MST_USER_OP_NEED_HANDLE(STM_EVENT_DROP_STREAM) || MST_USER_OP_NEED_HANDLE(STM_EVENT_STOP_STREAM))
2025-06-11 08:18:19 +00:00
#define MST_OP_TIMEOUT_NEED_HANDLE(_op) (mstEventPassIsolation(100, (_op)) && mstEventHandledChkSet(_op))
2025-06-21 05:47:30 +00:00
#define MST_STREAM_ERROR_NEED_HANDLE() (mstEventPassIsolation(1, STM_EVENT_STM_TERR) && mstEventHandledChkSet(STM_EVENT_STM_TERR))
2025-06-06 01:09:40 +00:00
#define MST_READY_FOR_SDB_LOOP() (MST_NORMAL_STATUS_NEED_HANDLE() || MST_CREATE_START_STM_NEED_HANDLE() || MST_DROP_STOP_STM_NEED_HANDLE() || MST_OP_TIMEOUT_NEED_HANDLE(STM_EVENT_LOOP_SDB))
#define MST_READY_FOR_MAP_LOOP() (MST_STREAM_ERROR_NEED_HANDLE() || MST_DROP_STOP_STM_NEED_HANDLE() || MST_OP_TIMEOUT_NEED_HANDLE(STM_EVENT_LOOP_MAP))
#define MST_READY_FOR_SNODE_LOOP() (MST_USER_OP_NEED_HANDLE(STM_EVENT_DROP_SNODE) || MST_OP_TIMEOUT_NEED_HANDLE(STM_EVENT_LOOP_SNODE))
2025-05-30 10:15:49 +00:00
2025-04-27 09:53:12 +00:00
#define STREAM_RUNNER_MAX_DEPLOYS
#define STREAM_RUNNER_MAX_REPLICA
2025-06-24 05:21:01 +00:00
#define STREAM_ACT_DEPLOY (1 << 0)
#define STREAM_ACT_UNDEPLOY (1 << 1)
#define STREAM_ACT_START (1 << 2)
2025-06-11 08:18:19 +00:00
#define STREAM_ACT_UPDATE_TRIGGER (1 << 3)
2025-06-24 05:21:01 +00:00
#define STREAM_ACT_RECALC (1 << 4)
2025-04-14 05:20:57 +00:00
#define MND_STREAM_RESERVE_SIZE 64
enh: support indef rows functions in extwindow (#32047) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue * fix: add debug log * fix: conflict * fix: create stream if not exists issue * fix: ahandle memory leak * fix: case issue * fix: exchange issues * fix: crash issue * fix: exchange prefetch issue * fix: snode quit issue * enh: support indef rows func * fix: crash issues * Fix external window collect vector function * fix: external window indef rows issues --------- Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com>
2025-07-19 09:49:48 +00:00
#define MND_STREAM_VER_NUMBER 7
#define MND_STREAM_TRIGGER_NAME_SIZE 20
2025-04-14 05:20:57 +00:00
#define MND_STREAM_DEFAULT_NUM 100
#define MND_STREAM_DEFAULT_TASK_NUM 200
2024-01-25 08:53:30 +00:00
2025-04-25 06:59:41 +00:00
#define MND_SET_RUNNER_TASKIDX(_level, _idx) (((_level) << 16) & (_idx))
#define MND_GET_RUNNER_SUBPLANID(_id) ((_id) &0xFFFFFFFF)
#define MND_STREAM_CREATE_NAME "stream-create"
2025-05-17 02:55:32 +00:00
#define MND_STREAM_START_NAME "stream-start"
#define MND_STREAM_DROP_NAME "stream-drop"
#define MND_STREAM_STOP_NAME "stream-stop"
2025-06-21 10:50:48 +00:00
#define MND_STREAM_RECALC_NAME "stream-recalc"
2024-01-30 01:17:02 +00:00
2025-05-16 06:19:36 +00:00
#define GOT_SNODE(_snodeId) ((_snodeId) != 0)
2025-06-24 05:21:01 +00:00
#define STREAM_IS_RUNNING(_ss) ((_ss)->triggerTask && STREAM_STATUS_RUNNING == (_ss)->triggerTask->status)
2025-05-30 10:15:49 +00:00
#define STREAM_IS_VIRTUAL_TABLE(_type, _flags) (TSDB_VIRTUAL_CHILD_TABLE == (_type) || TSDB_VIRTUAL_NORMAL_TABLE == (_type) || (TSDB_SUPER_TABLE == (_type) && BIT_FLAG_TEST_MASK((_flags), CREATE_STREAM_FLAG_TRIGGER_VIRTUAL_STB)))
2025-06-24 05:21:01 +00:00
#define MST_IS_RUNNER_GETTING_READY(_t) (STREAM_STATUS_INIT == (_t)->status && STREAM_RUNNER_TASK == (_t)->type)
2022-03-10 09:15:45 +00:00
Feat/ts 6100 3.0.pw10 (#31841) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com>
2025-07-14 00:02:58 +00:00
#define MST_COPY_STR(_p) ((_p) ? (taosStrdup(_p)) : NULL)
#define MST_LIST_SIZE(_l) ((_l) ? TD_DLIST_NELES(_l) : 0)
2025-05-23 10:14:34 +00:00
// clang-format off
#define mstFatal(...) do { if (stDebugFlag & DEBUG_FATAL) { taosPrintLog("MSTM FATAL ", DEBUG_FATAL, 255, __VA_ARGS__); }} while(0)
#define mstError(...) do { if (stDebugFlag & DEBUG_ERROR) { taosPrintLog("MSTM ERROR ", DEBUG_ERROR, 255, __VA_ARGS__); }} while(0)
#define mstWarn(...) do { if (stDebugFlag & DEBUG_WARN) { taosPrintLog("MSTM WARN ", DEBUG_WARN, 255, __VA_ARGS__); }} while(0)
#define mstInfo(...) do { if (stDebugFlag & DEBUG_INFO) { taosPrintLog("MSTM INFO ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
#define mstDebug(...) do { if (stDebugFlag & DEBUG_DEBUG) { taosPrintLog("MSTM DEBUG ", DEBUG_DEBUG, stDebugFlag, __VA_ARGS__); }} while(0)
#define mstDebugL(...) do { if (stDebugFlag & DEBUG_DEBUG) { taosPrintLongString("MSTM DEBUG ", DEBUG_DEBUG, stDebugFlag, __VA_ARGS__); }} while(0)
#define mstTrace(...) do { if (stDebugFlag & DEBUG_TRACE) { taosPrintLog("MSTM TRACE ", DEBUG_TRACE, stDebugFlag, __VA_ARGS__); }} while(0)
// clang-format on
#define msttFatal(param, ...) \
2025-05-24 10:15:32 +00:00
mstFatal("%s NODE:%d %" PRIx64 " %s TASK:%" PRIx64 " SID:%" PRId64 " " param, gMndStreamState[mStreamMgmt.state],\
2025-05-23 10:14:34 +00:00
((SStreamTask *)pTask)->nodeId, ((SStreamTask *)pTask)->streamId, gStreamTaskTypeStr[((SStreamTask *)pTask)->type], \
((SStreamTask *)pTask)->taskId, ((SStreamTask *)pTask)->seriousId, __VA_ARGS__)
#define msttError(param, ...) \
2025-05-24 10:15:32 +00:00
mstError("%s NODE:%d %" PRIx64 " %s TASK:%" PRIx64 " SID:%" PRId64 " " param, gMndStreamState[mStreamMgmt.state],\
2025-05-23 10:14:34 +00:00
((SStreamTask *)pTask)->nodeId, ((SStreamTask *)pTask)->streamId, gStreamTaskTypeStr[((SStreamTask *)pTask)->type], \
((SStreamTask *)pTask)->taskId, ((SStreamTask *)pTask)->seriousId, __VA_ARGS__)
#define msttWarn(param, ...) \
2025-05-24 10:15:32 +00:00
mstWarn("%s NODE:%d %" PRIx64 " %s TASK:%" PRIx64 " SID:%" PRId64 " " param, gMndStreamState[mStreamMgmt.state],\
2025-05-23 10:14:34 +00:00
((SStreamTask *)pTask)->nodeId, ((SStreamTask *)pTask)->streamId, gStreamTaskTypeStr[((SStreamTask *)pTask)->type], \
((SStreamTask *)pTask)->taskId, ((SStreamTask *)pTask)->seriousId, __VA_ARGS__)
#define msttInfo(param, ...) \
2025-05-24 10:15:32 +00:00
mstInfo("%s NODE:%d %" PRIx64 " %s TASK:%" PRIx64 " SID:%" PRId64 " " param, gMndStreamState[mStreamMgmt.state],\
2025-05-23 10:14:34 +00:00
((SStreamTask *)pTask)->nodeId, ((SStreamTask *)pTask)->streamId, gStreamTaskTypeStr[((SStreamTask *)pTask)->type], \
((SStreamTask *)pTask)->taskId, ((SStreamTask *)pTask)->seriousId, __VA_ARGS__)
#define msttDebug(param, ...) \
2025-05-24 10:15:32 +00:00
mstDebug("%s NODE:%d %" PRIx64 " %s TASK:%" PRIx64 " SID:%" PRId64 " " param, gMndStreamState[mStreamMgmt.state],\
2025-05-23 10:14:34 +00:00
((SStreamTask *)pTask)->nodeId, ((SStreamTask *)pTask)->streamId, gStreamTaskTypeStr[((SStreamTask *)pTask)->type], \
((SStreamTask *)pTask)->taskId, ((SStreamTask *)pTask)->seriousId, __VA_ARGS__)
#define msttDebugL(param, ...) \
2025-05-24 10:15:32 +00:00
mstDebugL("%s NODE:%d %" PRIx64 " %s TASK:%" PRIx64 " SID:%" PRId64 " " param, gMndStreamState[mStreamMgmt.state],\
2025-05-23 10:14:34 +00:00
((SStreamTask *)pTask)->nodeId, ((SStreamTask *)pTask)->streamId, gStreamTaskTypeStr[((SStreamTask *)pTask)->type], \
((SStreamTask *)pTask)->taskId, ((SStreamTask *)pTask)->seriousId, __VA_ARGS__)
#define msttTrace(param, ...) \
2025-05-24 10:15:32 +00:00
mstTrace("%s NODE:%d %" PRIx64 " %s TASK:%" PRIx64 " SID:%" PRId64 " " param, gMndStreamState[mStreamMgmt.state],\
2025-05-23 10:14:34 +00:00
((SStreamTask *)pTask)->nodeId, ((SStreamTask *)pTask)->streamId, gStreamTaskTypeStr[((SStreamTask *)pTask)->type], \
((SStreamTask *)pTask)->taskId, ((SStreamTask *)pTask)->seriousId, __VA_ARGS__)
#define mstsFatal(param, ...) mstFatal("%s %" PRIx64 " " param, gMndStreamState[mStreamMgmt.state], streamId, __VA_ARGS__)
#define mstsError(param, ...) mstError("%s %" PRIx64 " " param, gMndStreamState[mStreamMgmt.state], streamId, __VA_ARGS__)
#define mstsWarn(param, ...) mstWarn("%s %" PRIx64 " " param, gMndStreamState[mStreamMgmt.state], streamId, __VA_ARGS__)
#define mstsInfo(param, ...) mstInfo("%s %" PRIx64 " " param, gMndStreamState[mStreamMgmt.state], streamId, __VA_ARGS__)
#define mstsDebug(param, ...) mstDebug("%s %" PRIx64 " " param, gMndStreamState[mStreamMgmt.state], streamId, __VA_ARGS__)
#define mstsDebugL(param, ...) mstDebugL("%s %" PRIx64 " " param, gMndStreamState[mStreamMgmt.state], streamId, __VA_ARGS__)
#define mstsTrace(param, ...) mstTrace("%s %" PRIx64 " " param, gMndStreamState[mStreamMgmt.state], streamId, __VA_ARGS__)
2025-05-10 09:16:39 +00:00
typedef struct SStmStreamAction {
int64_t streamId;
char streamName[TSDB_STREAM_FNAME_LEN];
2025-06-24 10:06:20 +00:00
bool userAction;
2025-06-24 05:21:01 +00:00
void* actionParam;
2025-05-10 09:16:39 +00:00
} SStmStreamAction;
typedef struct SStmTaskId {
int64_t taskId; // KEEP IT FIRST
2025-05-12 07:19:22 +00:00
int32_t deployId; // only for runner task
2025-05-10 09:16:39 +00:00
int64_t seriousId;
int32_t nodeId;
int32_t taskIdx;
int64_t uid;
2025-05-10 09:16:39 +00:00
} SStmTaskId;
2025-05-13 06:37:07 +00:00
typedef struct SStmTaskStatus {
SStmTaskId id;
2025-05-30 00:56:34 +00:00
void* pStream;
2025-05-13 06:37:07 +00:00
EStreamTaskType type;
int64_t flags;
EStreamStatus status;
2025-06-24 10:06:20 +00:00
SRWLatch detailStatusLock;
void* detailStatus; // SSTriggerRuntimeStatus*, only for trigger task now
2025-06-17 08:55:32 +00:00
int32_t errCode;
2025-06-12 02:28:10 +00:00
int64_t runningStartTs;
2025-05-13 06:37:07 +00:00
int64_t lastUpTs;
} SStmTaskStatus;
2025-05-10 09:16:39 +00:00
typedef struct SStmTaskAction {
// KEEP IT TOGETHER
int64_t streamId;
SStmTaskId id;
// KEEP IT TOGETHER
2025-05-13 06:37:07 +00:00
// for snode runner redeploy
int32_t deployNum;
int32_t deployId[MND_STREAM_RUNNER_DEPLOY_NUM];
2025-06-06 01:09:40 +00:00
//SStmTaskStatus* triggerStatus;
2025-05-13 06:37:07 +00:00
2025-05-10 09:16:39 +00:00
EStreamTaskType type;
2025-05-27 11:08:07 +00:00
bool multiRunner;
int64_t flag;
2025-05-10 09:16:39 +00:00
} SStmTaskAction;
typedef union {
SStmStreamAction stream;
SStmTaskAction task;
} SStmQAction;
2024-01-26 02:03:54 +00:00
2025-04-22 09:46:17 +00:00
typedef struct SStmQNode {
2025-05-10 09:16:39 +00:00
int32_t type;
bool streamAct;
SStmQAction action;
2025-04-24 01:11:54 +00:00
void* next;
2025-04-22 09:46:17 +00:00
} SStmQNode;
2025-04-14 05:20:57 +00:00
2025-04-22 09:46:17 +00:00
typedef struct SStmActionQ {
2025-04-14 05:20:57 +00:00
bool stopQueue;
SRWLatch lock;
SStmQNode* head;
SStmQNode* tail;
2025-04-14 05:20:57 +00:00
uint64_t qRemainNum;
2025-04-22 09:46:17 +00:00
} SStmActionQ;
2025-04-14 05:20:57 +00:00
2025-05-10 09:16:39 +00:00
typedef struct SVgroupChangeInfo {
SHashObj *pDBMap;
SArray *pUpdateNodeList; // SArray<SNodeUpdateInfo>
} SVgroupChangeInfo;
2025-04-18 11:28:43 +00:00
2025-04-14 05:20:57 +00:00
2025-04-25 06:59:41 +00:00
typedef struct SStmTaskSrcAddr {
bool isFromCache;
2025-04-25 06:59:41 +00:00
int64_t taskId;
int32_t vgId;
int32_t groupId;
SEpSet epset;
} SStmTaskSrcAddr;
2025-06-12 02:28:10 +00:00
typedef struct SStmStat {
int32_t lastError;
} SStmStat;
2025-04-22 09:46:17 +00:00
typedef struct SStmStatus {
2025-05-23 10:14:34 +00:00
// static part
Feat/ts 6100 3.0.pw10 (#31841) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com>
2025-07-14 00:02:58 +00:00
char* streamName;
SCMCreateStreamReq* pCreate;
2025-06-16 03:34:54 +00:00
int32_t trigReaderNum;
int32_t calcReaderNum;
2025-05-23 10:14:34 +00:00
int32_t runnerNum; // task num for one deploy
2025-04-27 09:53:12 +00:00
int32_t runnerDeploys;
int32_t runnerReplica;
2025-05-23 10:14:34 +00:00
fix: grant issues (#32231) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue * fix: add debug log * fix: conflict * fix: create stream if not exists issue * fix: ahandle memory leak * fix: case issue * fix: exchange issues * fix: crash issue * fix: exchange prefetch issue * fix: snode quit issue * enh: support indef rows func * fix: crash issues * Fix external window collect vector function * fix: external window indef rows issues * fix: external window issue * enh: support count always return value in external window * fix: force output when has more result block * fix: runner block retrieve issue * fix: crash issue * fix: count cases issue * fix: reader deploy message issue * fix: task deploy issue * fix: external window scalar issue * fix: compile issue * fix: group cache reset issue * fix: add protection check * fix: add grant check * fix: add disableStream config * fix: notify free issue * fix: case issue * fix: grant issues * fix: memory leak issue * fix: memory leak issue * fix: memory leak issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: facetosea <285808407@qq.com>
2025-07-25 09:05:59 +00:00
int8_t stopped; // 1:runtime error stopped, 2:user stopped, 3:user dropped, 4:grant expired
2025-06-24 05:21:01 +00:00
2025-06-06 01:09:40 +00:00
int64_t deployTimes;
2025-05-28 03:35:54 +00:00
int64_t lastActionTs;
2025-05-28 10:37:21 +00:00
int32_t fatalError;
2025-06-06 01:09:40 +00:00
int64_t fatalRetryDuration;
2025-05-28 10:37:21 +00:00
int64_t fatalRetryTs;
int64_t fatalRetryTimes;
2025-05-27 11:08:07 +00:00
SRWLatch resetLock;
2025-05-27 11:08:07 +00:00
SArray* trigReaders; // SArray<SStmTaskStatus>
SArray* trigOReaders; // SArray<SStmTaskStatus>, virtable table only
SList* calcReaders; // SList<SStmTaskStatus>
2025-05-23 10:14:34 +00:00
SStmTaskStatus* triggerTask;
2025-05-27 11:08:07 +00:00
SArray* runners[MND_STREAM_RUNNER_DEPLOY_NUM]; // SArray<SStmTaskStatus>
2025-06-12 02:28:10 +00:00
2025-06-24 05:21:01 +00:00
int8_t triggerNeedUpdate;
SRWLatch userRecalcLock;
SArray* userRecalcList; // SArray<SStreamRecalcReq>
2025-06-12 02:28:10 +00:00
SStmStat stat;
2025-04-22 09:46:17 +00:00
} SStmStatus;
2025-04-14 05:20:57 +00:00
2025-06-24 05:21:01 +00:00
#define MST_IS_USER_STOPPED(_s) (2 == (_s) || 3 == (_s))
#define MST_IS_ERROR_STOPPED(_s) (1 == (_s))
fix: grant issues (#32231) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue * fix: add debug log * fix: conflict * fix: create stream if not exists issue * fix: ahandle memory leak * fix: case issue * fix: exchange issues * fix: crash issue * fix: exchange prefetch issue * fix: snode quit issue * enh: support indef rows func * fix: crash issues * Fix external window collect vector function * fix: external window indef rows issues * fix: external window issue * enh: support count always return value in external window * fix: force output when has more result block * fix: runner block retrieve issue * fix: crash issue * fix: count cases issue * fix: reader deploy message issue * fix: task deploy issue * fix: external window scalar issue * fix: compile issue * fix: group cache reset issue * fix: add protection check * fix: add grant check * fix: add disableStream config * fix: notify free issue * fix: case issue * fix: grant issues * fix: memory leak issue * fix: memory leak issue * fix: memory leak issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: facetosea <285808407@qq.com>
2025-07-25 09:05:59 +00:00
#define MST_IS_GRANT_STOPPED(_s) (4 == (_s))
2025-05-23 10:14:34 +00:00
2025-04-30 10:39:59 +00:00
typedef struct SStmTaskStatusExt{
int64_t streamId;
SStmTaskStatus* status;
} SStmTaskStatusExt;
2025-05-27 11:08:07 +00:00
typedef struct SStmSnodeStreamStatus {
SStmTaskStatus* trigger;
SArray* runners[MND_STREAM_RUNNER_DEPLOY_NUM]; // SArray<SStmTaskStatus*>
} SStmSnodeStreamStatus;
typedef struct SStmSnodeStatus {
2025-04-27 09:53:12 +00:00
int32_t runnerThreadNum; // runner thread num in snode
2025-05-10 09:16:39 +00:00
int64_t lastUpTs;
2025-05-27 11:08:07 +00:00
SHashObj* streamTasks; // streamId => SStmSnodeStreamStatus
} SStmSnodeStatus;
2025-04-17 02:45:06 +00:00
2025-05-24 10:15:32 +00:00
typedef struct SStmVgStreamStatus {
SArray* trigReaders; // SArray<SStmTaskStatus*>
SArray* calcReaders; // SArray<SStmTaskStatus*>
} SStmVgStreamStatus;
typedef struct SStmVgroupStatus {
2025-06-12 02:28:10 +00:00
int64_t lastUpTs;
2025-05-24 10:15:32 +00:00
SHashObj* streamTasks; // streamId => SStmVgStreamStatus
} SStmVgroupStatus;
2025-04-14 05:20:57 +00:00
2025-05-10 09:16:39 +00:00
typedef struct SStmTaskToDeployExt {
volatile bool deployed;
2025-05-12 07:19:22 +00:00
int32_t deployId; // only for runner task
2025-05-10 09:16:39 +00:00
SStmTaskDeploy deploy;
} SStmTaskToDeployExt;
2025-04-18 11:28:43 +00:00
2025-05-10 09:16:39 +00:00
typedef struct SStmVgTasksToDeploy {
2025-04-18 11:28:43 +00:00
SRWLatch lock;
int64_t streamVer;
int32_t deployed;
2025-05-10 09:16:39 +00:00
SArray* taskList; // SArray<SStmTaskToDeployExt>
} SStmVgTasksToDeploy;
2025-04-18 11:28:43 +00:00
2025-04-22 09:46:17 +00:00
typedef struct SStmSnodeTasksDeploy {
2025-04-18 11:28:43 +00:00
SRWLatch lock;
int32_t triggerDeployed;
int32_t runnerDeployed;
2025-05-10 09:16:39 +00:00
SArray* triggerList; // SArray<SStmTaskToDeployExt>
SArray* runnerList; // SArray<SStmTaskToDeployExt>
2025-04-22 09:46:17 +00:00
} SStmSnodeTasksDeploy;
2025-04-18 11:28:43 +00:00
2025-04-30 10:39:59 +00:00
typedef struct SStmStreamUndeploy{
SArray* taskList; // SArray<SStreamTask*>
int8_t doCheckpoint;
int8_t doCleanup;
} SStmStreamUndeploy;
2025-06-04 01:32:26 +00:00
typedef struct SStmStreamStart {
SStmTaskId triggerId;
} SStmStreamStart;
2025-06-24 05:21:01 +00:00
typedef struct SStmStreamRecalc {
SArray* recalcList; // SArray<SStreamRecalcReq>
} SStmStreamRecalc;
2025-04-30 10:39:59 +00:00
typedef struct SStmAction {
int32_t actions;
2025-06-04 01:32:26 +00:00
SStmStreamStart start;
2025-04-30 10:39:59 +00:00
SStmStreamDeploy deploy;
SStmStreamUndeploy undeploy;
2025-06-24 05:21:01 +00:00
SStmStreamRecalc recalc;
2025-04-30 10:39:59 +00:00
} SStmAction;
typedef struct SStmGrpCtx {
SMnode* pMnode;
int64_t currTs;
SStreamHbMsg* pReq;
SMStreamHbRspMsg* pRsp;
2025-05-06 02:27:12 +00:00
int32_t tidx;
2025-04-30 10:39:59 +00:00
// status update
2025-05-06 02:27:12 +00:00
int32_t taskNum;
2025-05-07 11:16:56 +00:00
// reserved for trigger task deploy
int64_t triggerTaskId;
int32_t triggerNodeId;
2025-05-06 02:27:12 +00:00
SHashObj* deployStm;
SHashObj* actionStm;
2025-04-30 10:39:59 +00:00
} SStmGrpCtx;
2025-04-22 09:46:17 +00:00
typedef struct SStmThreadCtx {
2025-04-30 10:39:59 +00:00
SStmGrpCtx grpCtx[STREAM_MAX_GROUP_NUM];
2025-04-22 09:46:17 +00:00
SHashObj* deployStm[STREAM_MAX_GROUP_NUM]; // streamId => SStmStreamDeploy
2025-04-30 10:39:59 +00:00
SHashObj* actionStm[STREAM_MAX_GROUP_NUM]; // streamId => SStmAction
2025-04-22 09:46:17 +00:00
} SStmThreadCtx;
2025-04-18 11:28:43 +00:00
typedef struct SStmHealthCheckCtx {
2025-05-12 07:19:22 +00:00
int32_t slotIdx;
int64_t currentTs;
} SStmHealthCheckCtx;
2025-05-23 10:14:34 +00:00
typedef struct SStmRuntimeStat {
int64_t activeTimes;
int64_t inactiveTimes;
} SStmRuntimeStat;
typedef struct SStmWatchCtx {
int8_t ending;
int8_t taskRemains;
int32_t processing;
} SStmWatchCtx;
typedef struct SStmCheckStatusCtx {
int32_t code;
int32_t handledNum;
int32_t checkedNum;
} SStmCheckStatusCtx;
2025-05-28 10:37:21 +00:00
typedef struct SStmLastTs {
int64_t ts;
bool handled;
} SStmLastTs;
2025-05-30 00:56:34 +00:00
#define MND_STREAM_SET_LAST_TS(_op, _ts) do { \
mStreamMgmt.lastTs[(_op)].ts = (_ts); \
mStreamMgmt.lastTs[(_op)].handled = false; \
2025-06-11 08:18:19 +00:00
mstDebug("update event %s lastTs to %" PRId64, gMndStreamEvent[(_op)], (_ts)); \
2025-05-30 00:56:34 +00:00
} while (0)
#define MND_STREAM_GET_LAST_TS(_op) mStreamMgmt.lastTs[(_op)].ts
#define MND_STREAM_CLR_LAST_TS(_op) mStreamMgmt.lastTs[(_op)].handled = true
2025-05-29 03:43:17 +00:00
2025-04-22 09:46:17 +00:00
typedef struct SStmRuntime {
2025-05-23 10:14:34 +00:00
int8_t active;
fix: grant issues (#32231) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue * fix: add debug log * fix: conflict * fix: create stream if not exists issue * fix: ahandle memory leak * fix: case issue * fix: exchange issues * fix: crash issue * fix: exchange prefetch issue * fix: snode quit issue * enh: support indef rows func * fix: crash issues * Fix external window collect vector function * fix: external window indef rows issues * fix: external window issue * enh: support count always return value in external window * fix: force output when has more result block * fix: runner block retrieve issue * fix: crash issue * fix: count cases issue * fix: reader deploy message issue * fix: task deploy issue * fix: external window scalar issue * fix: compile issue * fix: group cache reset issue * fix: add protection check * fix: add grant check * fix: add disableStream config * fix: notify free issue * fix: case issue * fix: grant issues * fix: memory leak issue * fix: memory leak issue * fix: memory leak issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: facetosea <285808407@qq.com>
2025-07-25 09:05:59 +00:00
int8_t grantExpired;
SRWLatch runtimeLock;
2025-06-06 01:09:40 +00:00
SStmLastTs lastTs[STM_EVENT_MAX_VALUE];
2025-05-23 10:14:34 +00:00
int8_t state;
2025-05-28 10:37:21 +00:00
int64_t lastTaskId;
2025-04-29 07:31:33 +00:00
SRWLatch actionQLock;
SStmActionQ* actionQ;
2025-04-18 11:28:43 +00:00
int32_t threadNum;
2025-04-22 09:46:17 +00:00
SStmThreadCtx* tCtx;
2025-04-14 05:20:57 +00:00
2025-04-30 10:39:59 +00:00
// ST
2025-04-29 03:01:27 +00:00
SHashObj* streamMap; // streamId => SStmStatus
2025-04-22 09:46:17 +00:00
SHashObj* taskMap; // streamId + taskId => SStmTaskStatus*
2025-05-24 10:15:32 +00:00
SHashObj* vgroupMap; // vgId => SStmVgroupStatus (only reader tasks)
2025-05-27 11:08:07 +00:00
SHashObj* snodeMap; // snodeId => SStmSnodeStatus (only trigger and runner tasks)
2025-04-17 02:45:06 +00:00
SHashObj* dnodeMap; // dnodeId => lastUpTs
2025-04-18 11:28:43 +00:00
2025-04-30 10:39:59 +00:00
// TD
2025-04-18 11:28:43 +00:00
int32_t toDeployVgTaskNum;
2025-05-10 09:16:39 +00:00
SHashObj* toDeployVgMap; // vgId => SStmVgTasksToDeploy (only reader tasks)
2025-04-18 11:28:43 +00:00
int32_t toDeploySnodeTaskNum;
2025-05-10 09:16:39 +00:00
SHashObj* toDeploySnodeMap; // snodeId => SStmSnodeTasksDeploy (only trigger and runner tasks)
2025-04-29 11:22:25 +00:00
2025-04-30 10:39:59 +00:00
// UP
2025-05-07 05:42:53 +00:00
int32_t toUpdateScanNum;
SHashObj* toUpdateScanMap; // streamId + subplanId => SStmTaskSrcAddr (only scan's target runner tasks)
// HEALTH
2025-05-30 10:15:49 +00:00
SStmHealthCheckCtx hCtx;
2025-05-23 10:14:34 +00:00
SStmWatchCtx watch;
SStmRuntimeStat stat;
2025-04-22 09:46:17 +00:00
} SStmRuntime;
2024-01-30 01:17:02 +00:00
2025-04-22 09:46:17 +00:00
extern SStmRuntime mStreamMgmt;
2024-07-22 02:07:18 +00:00
int32_t mndInitStream(SMnode *pMnode);
void mndCleanupStream(SMnode *pMnode);
int32_t mndAcquireStream(SMnode *pMnode, char *streamName, SStreamObj **pStream);
2025-05-27 11:08:07 +00:00
int32_t mndAcquireStreamById(SMnode *pMnode, int64_t streamId, SStreamObj **pStream);
2024-07-22 02:07:18 +00:00
void mndReleaseStream(SMnode *pMnode, SStreamObj *pStream);
int32_t mndDropStreamByDb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb);
2024-01-30 01:17:02 +00:00
2025-04-30 10:39:59 +00:00
int32_t mstGetStreamsNumInDb(SMnode *pMnode, char *dbName, int32_t *pNumOfStreams);
2024-01-30 01:17:02 +00:00
int32_t setTransAction(STrans *pTrans, void *pCont, int32_t contLen, int32_t msgType, const SEpSet *pEpset,
int32_t retryCode, int32_t acceptCode);
2024-07-22 05:31:57 +00:00
int32_t doCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnConflct conflict, const char *name,
const char *pMsg, STrans **pTrans1);
2024-01-30 01:17:02 +00:00
int32_t mndPersistTransLog(SStreamObj *pStream, STrans *pTrans, int32_t status);
SSdbRaw *mndStreamActionEncode(SStreamObj *pStream);
2024-01-26 02:03:54 +00:00
int32_t mndGetStreamObj(SMnode *pMnode, int64_t streamId, SStreamObj **pStream);
2024-10-09 02:07:08 +00:00
int32_t mndCheckForSnode(SMnode *pMnode, SDbObj *pSrcDb);
2024-09-19 10:13:46 +00:00
2024-07-22 05:31:57 +00:00
int32_t mndProcessStreamHb(SRpcMsg *pReq);
int32_t mndStreamSetDropAction(SMnode *pMnode, STrans *pTrans, SStreamObj *pStream);
int32_t mndStreamSetDropActionFromList(SMnode *pMnode, STrans *pTrans, SArray *pList);
int32_t mndStreamSetStopStreamTasksActions(SMnode* pMnode, STrans *pTrans, uint64_t dbUid);
2025-04-24 01:11:54 +00:00
int32_t msmInitRuntimeInfo(SMnode *pMnode);
int32_t mndStreamTransAppend(SStreamObj *pStream, STrans *pTrans, int32_t status);
int32_t mndStreamCreateTrans(SMnode *pMnode, SStreamObj *pStream, SRpcMsg *pReq, ETrnConflct conflict, const char *name, STrans **ppTrans);
2025-06-17 08:55:32 +00:00
int32_t mstSetStreamAttrResBlock(SMnode *pMnode, SStreamObj *pStream, SSDataBlock *pBlock, int32_t numOfRows);
int32_t mstSetStreamTasksResBlock(SStreamObj* pStream, SSDataBlock* pBlock, int32_t* numOfRows, int32_t rowsCapacity);
2025-06-24 10:06:20 +00:00
int32_t mstSetStreamRecalculatesResBlock(SStreamObj* pStream, SSDataBlock* pBlock, int32_t* numOfRows, int32_t rowsCapacity);
int32_t mstGetScanUidFromPlan(int64_t streamId, void* scanPlan, int64_t* uid);
2025-06-24 05:21:01 +00:00
int32_t mstAppendNewRecalcRange(int64_t streamId, SStmStatus *pStream, STimeWindow* pRange);
2025-04-30 10:39:59 +00:00
int32_t mstCheckSnodeExists(SMnode *pMnode);
2025-05-23 10:14:34 +00:00
void mstSetTaskStatusFromMsg(SStmGrpCtx* pCtx, SStmTaskStatus* pTask, SStmTaskStatusMsg* pMsg);
2025-04-29 11:22:25 +00:00
void msmClearStreamToDeployMaps(SStreamHbMsg* pHb);
2025-04-24 01:11:54 +00:00
void msmCleanStreamGrpCtx(SStreamHbMsg* pHb);
2025-06-16 03:34:54 +00:00
int32_t msmHandleStreamHbMsg(SMnode* pMnode, int64_t currTs, SStreamHbMsg* pHb, SRpcMsg *pReq, SRpcMsg* pRspMsg);
void msmEncodeStreamHbRsp(int32_t code, SRpcHandleInfo *pRpcInfo, SMStreamHbRspMsg* pRsp, SRpcMsg* pMsg);
fix: grant issues (#32231) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue * fix: add debug log * fix: conflict * fix: create stream if not exists issue * fix: ahandle memory leak * fix: case issue * fix: exchange issues * fix: crash issue * fix: exchange prefetch issue * fix: snode quit issue * enh: support indef rows func * fix: crash issues * Fix external window collect vector function * fix: external window indef rows issues * fix: external window issue * enh: support count always return value in external window * fix: force output when has more result block * fix: runner block retrieve issue * fix: crash issue * fix: count cases issue * fix: reader deploy message issue * fix: task deploy issue * fix: external window scalar issue * fix: compile issue * fix: group cache reset issue * fix: add protection check * fix: add grant check * fix: add disableStream config * fix: notify free issue * fix: case issue * fix: grant issues * fix: memory leak issue * fix: memory leak issue * fix: memory leak issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: facetosea <285808407@qq.com>
2025-07-25 09:05:59 +00:00
int32_t msmHandleGrantExpired(SMnode *pMnode, int32_t errCode);
2025-04-24 01:11:54 +00:00
bool mndStreamActionDequeue(SStmActionQ* pQueue, SStmQNode **param);
void msmHandleBecomeLeader(SMnode *pMnode);
void msmHandleBecomeNotLeader(SMnode *pMnode);
fix: memory leak and trigger redeploy issue (#32398) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue * fix: add debug log * fix: conflict * fix: create stream if not exists issue * fix: ahandle memory leak * fix: case issue * fix: exchange issues * fix: crash issue * fix: exchange prefetch issue * fix: snode quit issue * enh: support indef rows func * fix: crash issues * Fix external window collect vector function * fix: external window indef rows issues * fix: external window issue * enh: support count always return value in external window * fix: force output when has more result block * fix: runner block retrieve issue * fix: crash issue * fix: count cases issue * fix: reader deploy message issue * fix: task deploy issue * fix: external window scalar issue * fix: compile issue * fix: group cache reset issue * fix: add protection check * fix: add grant check * fix: add disableStream config * fix: notify free issue * fix: case issue * fix: grant issues * fix: memory leak issue * fix: memory leak issue * fix: memory leak issue * fix: stbJoin issue * fix: rpc send issue * fix: rsp stream group id issue * fix: redeploy stream issue * fix: cases issues * fix: memory leak issue * fix: snode quit issue * fix: invalid read issue * fix: memory leak issue * fix: split dead loop issue * fix: crash issue * fix: acquire task issue * fix: memory leak and trigger redeploy issue * fix: taosd crash issue * fix: return code issues * fix: return code issues * fix: return code issue * fix: return code issues * fix: return code issue * fix: mnode crash and dead lock issue * fix: memory and crash issues --------- Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: facetosea <285808407@qq.com>
2025-08-12 00:39:14 +00:00
void msmUndeployStream(SMnode* pMnode, int64_t streamId, char* streamName);
2025-06-24 05:21:01 +00:00
int32_t msmRecalcStream(SMnode* pMnode, int64_t streamId, STimeWindow* timeRange);
2025-05-06 02:27:12 +00:00
int32_t mstIsStreamDropped(SMnode *pMnode, int64_t streamId, bool* dropped);
2025-06-04 02:22:12 +00:00
bool mstWaitLock(SRWLatch* pLock, bool readLock);
2025-05-30 10:15:49 +00:00
void msmHealthCheck(SMnode *pMnode);
2025-06-24 10:06:20 +00:00
void mstPostStreamAction(SStmActionQ* actionQ, int64_t streamId, char* streamName, void* param, bool userAction, int32_t action);
2025-06-24 05:21:01 +00:00
void mstPostTaskAction(SStmActionQ* actionQ, SStmTaskAction* pAction, int32_t action);
2025-05-17 02:55:32 +00:00
int32_t msmAssignRandomSnodeId(SMnode* pMnode, int64_t streamId);
2025-05-17 08:36:35 +00:00
int32_t msmCheckSnodeReassign(SMnode *pMnode, SSnodeObj* pSnode, SArray** ppRes);
2025-06-24 05:21:01 +00:00
void mstLogSStreamObj(char* tips, SStreamObj* p);
void mstLogSStmStatus(char* tips, int64_t streamId, SStmStatus* p);
2025-05-27 11:08:07 +00:00
void mstDestroySStmVgStreamStatus(void* p);
void mstDestroyVgroupStatus(SStmVgroupStatus* pVgStatus);
void mstDestroySStmSnodeStreamStatus(void* p);
2025-06-24 05:21:01 +00:00
int32_t mstBuildDBVgroupsMap(SMnode* pMnode, SSHashObj** ppRes);
int32_t mstGetTableVgId(SSHashObj* pDbVgroups, char* dbFName, char *tbName, int32_t* vgId);
void mstDestroyDbVgroupsHash(SSHashObj *pDbVgs);
void mndStreamUpdateTagsRefFlag(SMnode *pMnode, int64_t suid, SSchema* pTags, int32_t tagNum);
void mstCheckDbInUse(SMnode *pMnode, char *dbFName, bool *dbStream, bool *vtableStream, bool ignoreCurrDb);
2025-06-11 08:18:19 +00:00
void mstDestroySStmSnodeTasksDeploy(void* param);
void mstResetSStmStatus(SStmStatus* pStatus);
2025-06-11 08:18:19 +00:00
void mstDestroySStmStatus(void* param);
void mstDestroySStmAction(void* param);
void mstClearSStmStreamDeploy(SStmStreamDeploy* pDeploy);
2025-06-11 08:18:19 +00:00
void mstDestroySStmVgroupStatus(void* param);
void mstDestroySStmSnodeStatus(void* param);
void mstDestroySStmVgTasksToDeploy(void* param);
void mstDestroySStmTaskToDeployExt(void* param);
void mstDestroyScanAddrList(void* param);
2025-06-24 10:27:02 +00:00
int32_t msmGetTriggerTaskAddr(SMnode *pMnode, int64_t streamId, SStreamTaskAddr* pAddr);
fix: grant issues (#32231) * enh: add operator reset func * fix: merge join reset issue * fix: memory issues * fix: add debug assert * fix: memory issues * fix: memory leak * fix: memory issues * fix taos log miss * fix: case issue * fix: case issue * fix: case issues * fix: drop dnode issue * fix: memory issues * fix: memory issues * fix: memory leak issues * fix: recalculate time range issue * fix: add debug log * fix: memory issues * fix: enable case asan * Update streamlist_for_ci.task * fix: case asan issue * fix: stream name issue * fix: external window compile issues * fix: deploy memory issue * fix: ahandle issue * fix: ahandle issue * fix: ahandle issue * fix: virtual table reader list issue * fix: log info * fix: msg error * fix: virtual table addr list issue * fix: memory issues * fix: memory leak issue * fix: memory issues * fix: memory free issues * fix: memory issues * fix: snode deploy issue * fix: mnode reader issue * fix: memory issues * fix: add debug test * enh: add ignore nodata trigger * fix: memory leaks * fix: configuration issue * fix: memory issue * fix: external window issue * fix: external window issues * fix: external window placeholder issue * fix: placeholder function init issues * fix: memory leak issue * fix: add debug log * fix: compile issues * fix: double free issue * fix: runner addr update issue * fix: msg rsp issue * fix: external window reset issue * fix: configuration issue * fix: deploy msg issue * fix: compile issue * fix: external window idx issue * fix: ci issues * fix: ci case issues * fix: drop dnode issue * fix: add debug log * fix: conflict * fix: create stream if not exists issue * fix: ahandle memory leak * fix: case issue * fix: exchange issues * fix: crash issue * fix: exchange prefetch issue * fix: snode quit issue * enh: support indef rows func * fix: crash issues * Fix external window collect vector function * fix: external window indef rows issues * fix: external window issue * enh: support count always return value in external window * fix: force output when has more result block * fix: runner block retrieve issue * fix: crash issue * fix: count cases issue * fix: reader deploy message issue * fix: task deploy issue * fix: external window scalar issue * fix: compile issue * fix: group cache reset issue * fix: add protection check * fix: add grant check * fix: add disableStream config * fix: notify free issue * fix: case issue * fix: grant issues * fix: memory leak issue * fix: memory leak issue * fix: memory leak issue --------- Co-authored-by: huohong <sallyhuo@taosdata.com> Co-authored-by: Jing Sima <simondominic9997@outlook.com> Co-authored-by: facetosea <285808407@qq.com>
2025-07-25 09:05:59 +00:00
void msmDestroyRuntimeInfo(SMnode *pMnode);
2022-03-10 09:15:45 +00:00
#ifdef __cplusplus
}
#endif
#endif /*_TD_MND_STREAM_H_*/