taosBenchmark批量往超表写入数据,配置了childtable_offset,auto_create_table不生效

【TDengine 使用环境】
生产环境 /测试/ Poc/预生产环境

【TDengine 版本】

3.4.1.13.community

【操作系统以及版本】

【部署方式】容器/非容器部署

容器部署

【集群节点数】

3

【集群副本数】

3

【描述业务影响】

【问题复现路径/shan】做过哪些操作出现的问题

【遇到的问题:问题现象及影响】

【资源配置】

【报错完整截图】(不要大段的粘贴报错代码,论坛直接看报错代码不直观)

json文件配置

{
“filetype”: “insert”,
“cfgdir”: “/etc/taos”,
“thread_count”: 1,
“databases”: [
{
“dbinfo”: {
“name”: “db_pm_perf_td_uedm”,
“drop”: “no”,
“precision”: “ms”
},
“super_tables”: [
{
“name”: “r32_uedm_device_ac_ahu_1min”,
“childtable_count”: 500,
“childtable_prefix”: “deviceid”,
“insert_rows”: 120,
“interlace_rows”: 0,
“auto_create_table”: “no”,
“childtable_exists”: “yes”,
“childtable_offset” : 500,
“timestamp_step”: 60000,
“start_timestamp”: “2026-06-11 00:00:00.000”,
“columns”: [
{ “type”: “FLOAT”, “name”: “cell_failed_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “celldisunityprotect_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “dischg_loop_invalid”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “temphigh_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “single_temp_sensor_inv_ala”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “cell_poor_consis_prt”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “charg_circuit_fail”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “workstatus”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “theft_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “locked”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “device_soh”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “templow_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “cell_poor_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “comm_state”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “overloadprotect_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “disch_circuit_switch_fail_ala”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “rever_conn_pro”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “cell_fault”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “bdu_bus_volt_low_prt”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “fuse_fault”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “overload_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “cellresinconsistent_fault”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “bdu_comm_fail”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “cellresistance_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “charge_cur_limit_loop_fail”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “heating_fault”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “shake_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “bdu_eeprom_alm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “device_fault”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “templow_alarm_level”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “under_volt_protect_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “tempinvalid_alarm_level”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “curr_lim_loop_invalid”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “missing_alarm”, “min”: 0, “max”: 100 },
{ “type”: “FLOAT”, “name”: “vollow_alarm_level”, “min”: 0, “max”: 100 }
],
“tags”: [
{ “name”: “device_id”, “type”: “VARCHAR”, “len”: 64 }
]
}
]
}
]
}

执行命令:taosBenchmark -f “tdinsert.json”

报错日志:

[07/02 20:15:21.249624] ERROR: Call engine failed. error code: 0x8000061d, reason: Table already exists in other stables command CREATE TABLE IF NOT EXISTS db_pm_perf_td_uedm.deviceid0 USING db_pm_perf_td_uedm.r32_uedm_device_ac_ahu_1min TAGS (‘KY99t1DSuTmj9aekC5OcMLL’) IF NOT EXISTS db_pm_perf_td_uedm.deviceid1 USING db_pm_perf_td_uedm.r32_uedm_device_ac_ahu_1min TAGS (‘NrgZRQ5rC3oUQRC9AMixKkFdejfQSOPv7TiNxc3Y3gIGWaFkMLHmVbnXiqEZ’) IF NOT EXISTS db_pm_perf_td_uedm.deviceid2 USING db_pm_perf_td_uedm.r32_uedm_device_ac_ahu_1min TAGS (‘hkX1tyntqbkvJOhHhrhSXsBYDp7URVLY5yMlWXCcXKxupC3wU8dHpEv’) IF NOT EXISTS db_pm_perf_td_uedm.deviceid3 USING db_pm
[07/02 20:15:21.249904] INFO: thread[7] start creating table from 438 to 499
[07/02 20:15:21.252275] ERROR: Call engine failed. error code: 0x8000061d, reason: Table already exists in other stables command CREATE TABLE IF NOT EXISTS db_pm_perf_td_uedm.deviceid126 USING db_pm_perf_td_uedm.r32_uedm_device_ac_ahu_1min TAGS (‘Q0CWFQ2tcMTJxrSjAEYpmd3eoJTACAZgxp426Uk6v4EQjlZHNLW1PO32lJpNaeU’) IF NOT EXISTS db_pm_perf_td_uedm.deviceid127 USING db_pm_perf_td_uedm.r32_uedm_device_ac_ahu_1min TAGS (‘sLmltwhOoJvxS’) IF NOT EXISTS db_pm_perf_td_uedm.deviceid128 USING db_pm_perf_td_uedm.r32_uedm_device_ac_ahu_1min TAGS (‘5wUOkxrcoCJEgH’) IF NOT EXISTS db_pm_perf_td_uedm.deviceid129 USING db_pm_perf_td_uedm.r32_uedm_device_ac_ahu_1mi

疑问:为什么auto_create_table,childtable_offset这个参数完全没用,还是从device0开始建表

1.auto_create_table:仅当 insert_mode 为 taosc、stmt、stmt2 并且 child_table_exists 为 “no” 时生效,该参数为 “yes” 表示 taosBenchmark 在插入数据时会自动创建不存在的表;为 “no” 则表示先提前建好所有表再进行插入。
2.childtable_offset:仅当 child_table_exists 为 yes 时生效,指定从超级表获取子表列表时的偏移量,即从第几个子表开始。
3.childtable_exists是child_table_exists
4.offset只在 childtable_limit > 0 时才参与表名发现(且是SQL OFFSET语义,不是命名偏移
修改参考:
“childtable_count”: 500,
“childtable_prefix”: “deviceid”,
“auto_create_table”: “no”,
“child_table_exists”: “yes”,
“childtable_limit”: 500,

这个场景是什么呢? 是这个超级表下已经有了子表,想往这些子表里写入数据吗?并且是取 offset =500以后的 500 个子表。是这样吗?
childtable_offset: 对新建表的场景没有作用,而是对已经创建好的子表写入时才有用。