fix(stream):fix memory leak and update test cases.
This commit is contained in:
parent
3b537367c9
commit
781b644a8c
|
@ -1154,6 +1154,7 @@ static int32_t mndCheckTaskAndNodeStatus(SMnode *pMnode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
removeTasksInBuf(pInvalidList, &execInfo);
|
removeTasksInBuf(pInvalidList, &execInfo);
|
||||||
|
taosArrayDestroy(pInvalidList);
|
||||||
|
|
||||||
taosThreadMutexUnlock(&execInfo.lock);
|
taosThreadMutexUnlock(&execInfo.lock);
|
||||||
return ready ? 0 : -1;
|
return ready ? 0 : -1;
|
||||||
|
|
|
@ -1,66 +1,80 @@
|
||||||
{
|
{
|
||||||
"filetype": "insert",
|
"filetype": "insert",
|
||||||
"cfgdir": "/etc/taos",
|
"cfgdir": "/etc/taos",
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"port": 6030,
|
"port": 6030,
|
||||||
"rest_port": 6041,
|
"rest_port": 6041,
|
||||||
"user": "root",
|
"user": "root",
|
||||||
"password": "taosdata",
|
"password": "taosdata",
|
||||||
"thread_count": 100,
|
"thread_count": 100,
|
||||||
"create_table_thread_count": 24,
|
"create_table_thread_count": 24,
|
||||||
"result_file": "taosBenchmark_result.log",
|
"result_file": "taosBenchmark_result.log",
|
||||||
"confirm_parameter_prompt": "no",
|
"confirm_parameter_prompt": "no",
|
||||||
"insert_interval": 0,
|
"insert_interval": 0,
|
||||||
"num_of_records_per_req": 1000000,
|
"num_of_records_per_req": 1000000,
|
||||||
"max_sql_len": 1024000,
|
"max_sql_len": 1024000,
|
||||||
"databases": [
|
"databases": [
|
||||||
{
|
|
||||||
"dbinfo": {
|
|
||||||
"name": "db4096",
|
|
||||||
"drop": "yes",
|
|
||||||
"replica": 1,
|
|
||||||
"duration": 10,
|
|
||||||
"precision": "ms",
|
|
||||||
"keep": 3650,
|
|
||||||
"comp": 2,
|
|
||||||
"vgroups": 2,
|
|
||||||
"buffer": 1000
|
|
||||||
},
|
|
||||||
"super_tables": [
|
|
||||||
{
|
{
|
||||||
"name": "stb0",
|
"dbinfo": {
|
||||||
"child_table_exists": "no",
|
"name": "db4096",
|
||||||
"childtable_count":2,
|
"drop": "yes",
|
||||||
"childtable_prefix": "ctb0",
|
"replica": 1,
|
||||||
"escape_character": "no",
|
"duration": 10,
|
||||||
"auto_create_table": "no",
|
"precision": "ms",
|
||||||
"batch_create_tbl_num": 500,
|
"keep": 3650,
|
||||||
"data_source": "rand",
|
"comp": 2,
|
||||||
"insert_mode": "taosc",
|
"vgroups": 2,
|
||||||
"rollup": null,
|
"buffer": 1000
|
||||||
"interlace_rows": 0,
|
},
|
||||||
"line_protocol": null,
|
"super_tables": [
|
||||||
"tcp_transfer": "no",
|
{
|
||||||
"insert_rows": 10,
|
"name": "stb0",
|
||||||
"childtable_limit": 0,
|
"child_table_exists": "no",
|
||||||
"childtable_offset": 0,
|
"childtable_count": 2,
|
||||||
"rows_per_tbl": 0,
|
"childtable_prefix": "ctb0",
|
||||||
"max_sql_len": 1048576,
|
"escape_character": "no",
|
||||||
"disorder_ratio": 0,
|
"auto_create_table": "no",
|
||||||
"disorder_range": 1000,
|
"batch_create_tbl_num": 500,
|
||||||
"timestamp_step": 1000,
|
"data_source": "rand",
|
||||||
"start_timestamp": "2022-10-22 17:20:36",
|
"insert_mode": "taosc",
|
||||||
"sample_format": "csv",
|
"rollup": null,
|
||||||
"sample_file": "./sample.csv",
|
"interlace_rows": 0,
|
||||||
"tags_file": "",
|
"line_protocol": null,
|
||||||
"columns": [{ "type": "INT","count": 4093}],
|
"tcp_transfer": "no",
|
||||||
"tags": [{"type": "TINYINT", "count": 1},{"type": "NCHAR","count": 1}]
|
"insert_rows": 10,
|
||||||
|
"childtable_limit": 0,
|
||||||
|
"childtable_offset": 0,
|
||||||
|
"rows_per_tbl": 0,
|
||||||
|
"max_sql_len": 1048576,
|
||||||
|
"disorder_ratio": 0,
|
||||||
|
"disorder_range": 1000,
|
||||||
|
"timestamp_step": 1000,
|
||||||
|
"start_timestamp": "2022-10-22 17:20:36",
|
||||||
|
"sample_format": "csv",
|
||||||
|
"sample_file": "./sample.csv",
|
||||||
|
"tags_file": "",
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"type": "INT",
|
||||||
|
"count": 4093
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"type": "TINYINT",
|
||||||
|
"count": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "NCHAR",
|
||||||
|
"count": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
"prepare_rand": 10000,
|
||||||
],
|
"chinese": "no",
|
||||||
"prepare_rand": 10000,
|
"streams": false,
|
||||||
"chinese": "no",
|
"test_log": "/root/testlog/"
|
||||||
"streams": false,
|
}
|
||||||
"test_log": "/root/testlog/"
|
|
||||||
}
|
|
|
@ -1270,15 +1270,14 @@ class TDTestCase:
|
||||||
def test_drop_tsma(self):
|
def test_drop_tsma(self):
|
||||||
function_name = sys._getframe().f_code.co_name
|
function_name = sys._getframe().f_code.co_name
|
||||||
tdLog.debug(f'-----{function_name}------')
|
tdLog.debug(f'-----{function_name}------')
|
||||||
self.create_tsma('tsma1', 'test', 'meters', [
|
self.create_tsma('tsma1', 'test', 'meters', ['avg(c1)', 'avg(c2)'], '5m')
|
||||||
'avg(c1)', 'avg(c2)'], '5m')
|
|
||||||
self.create_recursive_tsma('tsma1', 'tsma2', 'test', '15m', 'meters')
|
self.create_recursive_tsma('tsma1', 'tsma2', 'test', '15m', 'meters')
|
||||||
|
|
||||||
# drop recursive tsma first
|
# drop recursive tsma first
|
||||||
tdSql.error('drop tsma test.tsma1', -2147482491)
|
tdSql.error('drop tsma test.tsma1', -2147482491)
|
||||||
tdSql.execute('drop tsma test.tsma2', queryTimes=1)
|
tdSql.execute('drop tsma test.tsma2', queryTimes=1)
|
||||||
tdSql.execute('drop tsma test.tsma1', queryTimes=1)
|
tdSql.execute('drop tsma test.tsma1', queryTimes=1)
|
||||||
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
|
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
|
||||||
tdSql.execute('drop database test', queryTimes=1)
|
tdSql.execute('drop database test', queryTimes=1)
|
||||||
|
|
||||||
self.init_data()
|
self.init_data()
|
||||||
|
@ -1319,7 +1318,7 @@ class TDTestCase:
|
||||||
'create tsma tsma1 on nsdb.meters function(avg(c1), avg(c2), avg(t3)) interval(5m)', -2147471096)
|
'create tsma tsma1 on nsdb.meters function(avg(c1), avg(c2), avg(t3)) interval(5m)', -2147471096)
|
||||||
|
|
||||||
tdSql.execute('alter table nsdb.meters drop tag t3', queryTimes=1)
|
tdSql.execute('alter table nsdb.meters drop tag t3', queryTimes=1)
|
||||||
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
|
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
|
||||||
tdSql.execute('drop database nsdb')
|
tdSql.execute('drop database nsdb')
|
||||||
|
|
||||||
# drop norm table
|
# drop norm table
|
||||||
|
@ -1346,7 +1345,7 @@ class TDTestCase:
|
||||||
# test drop stream
|
# test drop stream
|
||||||
tdSql.error('drop stream tsma1', -2147471088) ## TSMA must be dropped first
|
tdSql.error('drop stream tsma1', -2147471088) ## TSMA must be dropped first
|
||||||
|
|
||||||
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
|
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
|
||||||
tdSql.execute('drop database test', queryTimes=1)
|
tdSql.execute('drop database test', queryTimes=1)
|
||||||
self.init_data()
|
self.init_data()
|
||||||
|
|
||||||
|
@ -1449,7 +1448,7 @@ class TDTestCase:
|
||||||
|
|
||||||
tdSql.error(
|
tdSql.error(
|
||||||
'create tsma tsma1 on test.meters function(avg(c1), avg(c2)) interval(2h)', -2147471097)
|
'create tsma tsma1 on test.meters function(avg(c1), avg(c2)) interval(2h)', -2147471097)
|
||||||
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-checkpo')
|
self.wait_query('show transactions', 0, 10, lambda row: row[3] != 'stream-chkpt-u')
|
||||||
tdSql.execute('drop database nsdb')
|
tdSql.execute('drop database nsdb')
|
||||||
|
|
||||||
def test_create_tsma_on_norm_table(self):
|
def test_create_tsma_on_norm_table(self):
|
||||||
|
|
|
@ -68,7 +68,7 @@ class TDTestCase:
|
||||||
# create stream
|
# create stream
|
||||||
tdSql.execute("use db", queryTimes=100)
|
tdSql.execute("use db", queryTimes=100)
|
||||||
tdSql.execute("create stream stream1 fill_history 1 into sta as select count(*) as cnt from meters interval(10a);",show=True)
|
tdSql.execute("create stream stream1 fill_history 1 into sta as select count(*) as cnt from meters interval(10a);",show=True)
|
||||||
time.sleep(5)
|
time.sleep(10)
|
||||||
|
|
||||||
sql = "select count(*) from sta"
|
sql = "select count(*) from sta"
|
||||||
# loop wait max 60s to check count is ok
|
# loop wait max 60s to check count is ok
|
||||||
|
|
Loading…
Reference in New Issue