【TDengine 使用环境】
预生产环境
【TDengine 版本】
3.3.3.0
【操作系统以及版本】
Ubuntu 20.04.3 LTS
【部署方式】容器/非容器部署
容器
【集群节点数】
1
【集群副本数】
1
建库语句:CREATE DATABASE IF NOT EXISTS pm_kpi KEEP 180 DURATION 10 BUFFER 16 WAL_LEVEL 1;
【描述业务影响】
插入数据前的建表操作频繁失败
【问题复现路径/shan】做过哪些操作出现的问题
定期自动插入数据前,自动检查表是否存在,不存在则自动创建超级表和子表
【遇到的问题:问题现象及影响】
插入数据前的建表操作频繁失败,单次执行都是正常,貌似并发时才频繁出现
【资源配置】
spring:
tdengine:
url: jdbc:TAOS-RS://${AIUMS_TAOS_ADDR:127.0.0.1:6041}/pm_kpi?charset=UTF-8&locale=en_US.UTF-8&timezone=UTC-8
username: ${AIUMS_TAOS_USER_NAME:root}
password: ${AIUMS_TAOS_PASSWORD:AIUMSDB@123456}
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
hikari:
auto-commit: true
minimum-idle: 10
maximum-pool-size: 10
connection-timeout: 10000
idle-timeout: 10
max-lifetime: 3600
connection-test-query: SELECT 1
【报错完整截图】
异常日志:
2025-07-08T16:03:01.731+08:00 [ERROR] [192.168.30.80] [ailink-pm] [PmFileParserThread-3] c.ailink.pm.handlers.AbstractNrTr069PmFileHandler [183] - parse pm xml file exception, xmlFileName:/var/lib/http-file-server/files/kpi/bbu/1/A_NR_20250708.1115 0800-1120 0800_48BF74.1202000534228JB0008-NR.xml, exception:
org.springframework.jdbc.UncategorizedSQLException:
Error updating database. Cause: java.sql.SQLException: TDengine ERROR (3d3): sql: CREATE STABLE IF NOT EXISTS pm_kpi.s_measdata_bcb_nbs3927d_ho_switch_slice
(
start_time TIMESTAMP
,
end_time TIMESTAMP
,
frequency INT
,
ho_attoutexecinterfreqslice INT
,
ho_attoutpreintrasysslice INT
,
ho_succoutinterfreqslice INT
)
TAGS
(
ne_id INT
,
mo_id VARCHAR(32)
,
moi_id VARCHAR(128)
);, desc: Conflict transaction not completed
The error may exist in URL [jar:file:/data/ailink-pm.jar!/BOOT-INF/classes!/com/ailink/pm/mapper/tdengine/TdengineKpiMapper.xml]
The error may involve com.ailink.pm.mapper.tdengine.TdengineKpiMapper.createSuperTable-Inline
The error occurred while setting parameters
SQL: CREATE STABLE IF NOT EXISTS pm_kpi.s_measdata_bcb_nbs3927d_ho_switch_slice ( start_time TIMESTAMP , end_time TIMESTAMP , frequency INT , ho_attoutexecinterfreqslice INT , ho_attoutpreintrasysslice INT , ho_succoutinterfreqslice INT ) TAGS ( ne_id INT , mo_id VARCHAR(32) , moi_id VARCHAR(128) );
Cause: java.sql.SQLException: TDengine ERROR (3d3): sql: CREATE STABLE IF NOT EXISTS pm_kpi.s_measdata_bcb_nbs3927d_ho_switch_slice
(
start_time TIMESTAMP
,
end_time TIMESTAMP
,
frequency INT
,
ho_attoutexecinterfreqslice INT
,
ho_attoutpreintrasysslice INT
,
ho_succoutinterfreqslice INT
)
TAGS
(
ne_id INT
,
mo_id VARCHAR(32)
,
moi_id VARCHAR(128)
);, desc: Conflict transaction not completed
; uncategorized SQLException; SQL state ; error code [979]; TDengine ERROR (3d3): sql: CREATE STABLE IF NOT EXISTS pm_kpi.s_measdata_bcb_nbs3927d_ho_switch_slice
(
start_time TIMESTAMP
,
end_time TIMESTAMP
,
frequency INT
,
ho_attoutexecinterfreqslice INT
,
ho_attoutpreintrasysslice INT
,
ho_succoutinterfreqslice INT
)
TAGS
(
ne_id INT
,
mo_id VARCHAR(32)
,
moi_id VARCHAR(128)
);, desc: Conflict transaction not completed; nested exception is java.sql.SQLException: TDengine ERROR (3d3): sql: CREATE STABLE IF NOT EXISTS pm_kpi.s_measdata_bcb_nbs3927d_ho_switch_slice
(
start_time TIMESTAMP
,
end_time TIMESTAMP
,
frequency INT
,
ho_attoutexecinterfreqslice INT
,
ho_attoutpreintrasysslice INT
,
ho_succoutinterfreqslice INT
)
TAGS
(
ne_id INT
,
mo_id VARCHAR(32)
,
moi_id VARCHAR(128)
);, desc: Conflict transaction not completed
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:93)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439)
at com.sun.proxy.$Proxy149.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:288)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:64)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:152)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy184.createSuperTable(Unknown Source)
at com.ailink.pm.service.impl.PmMuDataServiceImpl.checkAndCreateTable(PmMuDataServiceImpl.java:259)
at com.ailink.pm.handlers.AbstractNrTr069PmFileHandler.autonomousTransferComplete(AbstractNrTr069PmFileHandler.java:167)
at com.ailink.pm.handlers.NrTr069PmFileCompositeHandlerImpl.autonomousTransferComplete(NrTr069PmFileCompositeHandlerImpl.java:66)
at com.ailink.pm.task.pm.HistoryPmFileProcessor.processPmFiles(HistoryPmFileProcessor.java:114)
at com.ailink.pm.task.pm.HistoryPmFileParseTask.run(HistoryPmFileParseTask.java:31)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.sql.SQLException: TDengine ERROR (3d3): sql: CREATE STABLE IF NOT EXISTS pm_kpi.s_measdata_bcb_nbs3927d_ho_switch_slice
(
start_time TIMESTAMP
,
end_time TIMESTAMP
,
frequency INT
,
ho_attoutexecinterfreqslice INT
,
ho_attoutpreintrasysslice INT
,
ho_succoutinterfreqslice INT
)
TAGS
(
ne_id INT
,
mo_id VARCHAR(32)
,
moi_id VARCHAR(128)
);, desc: Conflict transaction not completed
at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:76)
at com.taosdata.jdbc.rs.RestfulStatement.execute(RestfulStatement.java:77)
at com.taosdata.jdbc.rs.RestfulPreparedStatement.execute(RestfulPreparedStatement.java:216)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:48)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:75)
at sun.reflect.GeneratedMethodAccessor266.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
at com.sun.proxy.$Proxy237.update(Unknown Source)
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at sun.reflect.GeneratedMethodAccessor265.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:106)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59)
at com.sun.proxy.$Proxy236.update(Unknown Source)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
at sun.reflect.GeneratedMethodAccessor267.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:425)
… 16 common frames omitted