seatunnel icon indicating copy to clipboard operation
seatunnel copied to clipboard

The sink is MySQL. After running in STREAMING mode for a period of time, it throws the error "No operations allowed after statement closed". How can I resolve this issue?

Open NaughtyYang opened this issue 3 months ago • 25 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

What happened

In MySQL‑CDC mode with MySQL as the sink in STREAMING mode, this error occurs after running for a period of time. It is presumed that the connection becomes invalid, yet Seatunnel still tries to use this connection without mechanisms such as connection liveness detection.

SeaTunnel Version

2.3.12

SeaTunnel Config

sink {
  jdbc {
      url = "jdbc:mysql://localhost:3306/a?useSSL=false&serverTimezone=Asia/Shanghai"
      driver = "com.mysql.cj.jdbc.Driver"
      user = "xx"
      password = "xx"
	  max_retries = 5
      
      table = "${table_name}"
      generate_sink_sql = true
	  
	  connection_check_timeout_sec = 1800
	  properties {
		connection-test-query = "select 1"
		validation-timeout = 3000
		max-lifetime = 600000
		leak-detection-threshold = 60000
	  }
      
      database = a
      
      primary_keys = ["${primary_key}"]
      
      
  }
}

Running Command

./seatunnel.sh --config ../config/a.conf

Error Exception

Caused by: java.sql.SQLException:No operations allowed after statement closed

Zeta or Flink or Spark Version

No response

Java or Scala Version

No response

Screenshots

No response

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

NaughtyYang avatar Aug 12 '26 01:08 NaughtyYang

This issue is caused by the connection-test-query config in the properties block not being properly applied to the HikariCP connection pool. The addDataSourceProperty() method passes properties to the JDBC DataSource, not to HikariCP's pool configuration — the setConnectionTestQuery() method must be used instead.

I've submitted PR #11771 that fixes this: the applyConnectionValidation() method now checks the user's properties config for connectionTestQuery/connection-test-query keys and applies them to the HikariCP pool directly.

Note: The similar issue #7998 was partially fixed by PR #10793 (recovery path), but the prevention path (proper connection test query configuration) was still missing.

waterWang avatar Aug 12 '26 03:08 waterWang

可能这些配置都需要 hikari: maximum-pool-size: 15 connection-timeout: 30000 max-lifetime: 1800000 #30min,务必小于mysql wait_timeout idle-timeout: 600000 #10min keepalive-time: 1200000 #20min,空闲连接保活探测 connection-test-query: SELECT 1

NaughtyYang avatar Aug 12 '26 04:08 NaughtyYang

Thanks for the follow-up, and thanks to @waterWang for opening PR #11771.

I checked the current dev sink code before replying here, and the issue description is grounded: JdbcSinkWriter applies pool-level validation only through applyConnectionValidation(...), while user properties are later forwarded with addDataSourceProperty(...). That means connection-test-query in the properties block is not actually configuring HikariCP's pool validation path, so the current root-cause direction in #11771 looks correct.

For review, please keep the boundary focused on the pool-level contract:

  1. honor both connection-test-query and connectionTestQuery from user config;
  2. keep the existing recovery-path behavior untouched;
  3. do not silently reinterpret unrelated Hikari/DataSource properties;
  4. add a focused regression test around the user-configured validation-query path.

Also, because this issue is currently written mainly in Chinese, please update the issue summary in English when you have a moment so the wider SeaTunnel community can follow the reproduction and fix path. After that, the next step is review on #11771.

DanielLeens avatar Aug 12 '26 12:08 DanielLeens

After modification as you described, this error still occurs in the test environment. This change should not resolve the issue. @waterWang @DanielLeens

NaughtyYang avatar Aug 17 '26 02:08 NaughtyYang

[1139833582773075969] 2026-08-16 00:30:04,931 WARN [.a.s.s.c.z.h.p.ProxyConnection] [st-multi-table-sink-writer-2] - HikariPool-82 - Connection com.mysql.cj.jdbc.ConnectionImpl@680d5258 marked as broken because of SQLSTATE(08S01), ErrorCode(0) com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 84,340,459 milliseconds ago. The last packet sent successfully to the server was 84,340,479 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1403) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1388) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:403) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:800) ~[mysql-connector-java-8.0.27.jar:8.0.27] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:127) ~[?:?] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.executeBatch(FieldNamedPreparedStatement.java:540) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.executeBatch(SimpleBatchStatementExecutor.java:54) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.executeBatch(BufferReducedBatchStatementExecutor.java:80) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.attemptFlush(JdbcOutputFormat.java:172) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:136) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:106) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:154) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:44) ~[?:?] at org.apache.seatunnel.api.sink.multitablesink.MultiTableWriterRunnable.run(MultiTableWriterRunnable.java:67) ~[seatunnel-starter.jar:2.3.12] at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43) ~[seatunnel-starter.jar:2.3.12] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_272] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_272] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272] Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 84,340,459 milliseconds ago. The last packet sent successfully to the server was 84,340,479 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_272] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_272] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:567) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:622) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:137) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.sendCommand(NativeSession.java:279) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:599) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1395) ~[mysql-connector-java-8.0.27.jar:8.0.27] ... 20 more Caused by: java.net.SocketException: Broken pipe (Write failed) at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_272] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) ~[?:1.8.0_272] at java.net.SocketOutputStream.write(SocketOutputStream.java:155) ~[?:1.8.0_272] at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[?:1.8.0_272] at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) ~[?:1.8.0_272] at com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:558) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:622) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:137) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.sendCommand(NativeSession.java:279) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:599) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1395) ~[mysql-connector-java-8.0.27.jar:8.0.27] ... 20 more [1139833582773075969] 2026-08-16 00:30:04,934 ERROR [o.a.s.c.s.j.i.JdbcOutputFormat] [st-multi-table-sink-writer-2] - JDBC executeBatch error, retry times = 0 com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 84,340,459 milliseconds ago. The last packet sent successfully to the server was 84,340,479 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1403) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1388) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:403) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:800) ~[mysql-connector-java-8.0.27.jar:8.0.27] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:127) ~[?:?] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.executeBatch(FieldNamedPreparedStatement.java:540) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.executeBatch(SimpleBatchStatementExecutor.java:54) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.executeBatch(BufferReducedBatchStatementExecutor.java:80) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.attemptFlush(JdbcOutputFormat.java:172) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:136) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:106) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:154) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:44) ~[?:?] at org.apache.seatunnel.api.sink.multitablesink.MultiTableWriterRunnable.run(MultiTableWriterRunnable.java:67) ~[seatunnel-starter.jar:2.3.12] at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43) ~[seatunnel-starter.jar:2.3.12] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_272] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_272] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272] Caused by: com.mysql.cj.exceptions.CJCommunicationsException: The last packet successfully received from the server was 84,340,459 milliseconds ago. The last packet sent successfully to the server was 84,340,479 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_272] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_272] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:567) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:622) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:137) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.sendCommand(NativeSession.java:279) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:599) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1395) ~[mysql-connector-java-8.0.27.jar:8.0.27] ... 20 more Caused by: java.net.SocketException: Broken pipe (Write failed) at java.net.SocketOutputStream.socketWrite0(Native Method) ~[?:1.8.0_272] at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111) ~[?:1.8.0_272] at java.net.SocketOutputStream.write(SocketOutputStream.java:155) ~[?:1.8.0_272] at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[?:1.8.0_272] at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) ~[?:1.8.0_272] at com.mysql.cj.protocol.a.SimplePacketSender.send(SimplePacketSender.java:55) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.TimeTrackingPacketSender.send(TimeTrackingPacketSender.java:50) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.send(NativeProtocol.java:558) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:622) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.protocol.a.NativeProtocol.sendCommand(NativeProtocol.java:137) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.sendCommand(NativeSession.java:279) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.NativeSession.queryServerVariable(NativeSession.java:599) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ConnectionImpl.isReadOnly(ConnectionImpl.java:1395) ~[mysql-connector-java-8.0.27.jar:8.0.27] ... 20 more [1139833582773075969] 2026-08-16 00:30:04,939 ERROR [o.a.s.c.s.j.i.JdbcOutputFormat] [st-multi-table-sink-writer-2] - JDBC connection is not valid, and reestablish connection failed. org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[JDBC-10], ErrorDescription:[Data type cast failed] - error field:descendant at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:225) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:48) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:33) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.executeBatch(BufferReducedBatchStatementExecutor.java:77) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.closeStatements(BufferReducedBatchStatementExecutor.java:101) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.updateExecutor(JdbcOutputFormat.java:207) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:147) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:106) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:154) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:44) ~[?:?] at org.apache.seatunnel.api.sink.multitablesink.MultiTableWriterRunnable.run(MultiTableWriterRunnable.java:67) ~[seatunnel-starter.jar:2.3.12] at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43) ~[seatunnel-starter.jar:2.3.12] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_272] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_272] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272] Caused by: java.sql.SQLException: No operations allowed after statement closed. at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:82) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.checkBounds(ClientPreparedStatement.java:1405) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.getCoreParameterIndex(ClientPreparedStatement.java:1409) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.setInt(ClientPreparedStatement.java:1597) ~[mysql-connector-java-8.0.27.jar:8.0.27] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setInt(HikariProxyPreparedStatement.java) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.setInt(FieldNamedPreparedStatement.java:95) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.setValueToStatementByDataType(AbstractJdbcRowConverter.java:253) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:216) ~[?:?] ... 16 more Caused by: com.mysql.cj.exceptions.StatementIsClosedException: No operations allowed after statement closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_272] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_272] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.StatementImpl.checkClosed(StatementImpl.java:341) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.checkBounds(ClientPreparedStatement.java:1391) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.getCoreParameterIndex(ClientPreparedStatement.java:1409) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.setInt(ClientPreparedStatement.java:1597) ~[mysql-connector-java-8.0.27.jar:8.0.27] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setInt(HikariProxyPreparedStatement.java) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.setInt(FieldNamedPreparedStatement.java:95) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.setValueToStatementByDataType(AbstractJdbcRowConverter.java:253) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:216) ~[?:?] ... 16 more [1139833582773075969] 2026-08-16 00:30:04,939 ERROR [a.s.m.MultiTableWriterRunnable] [st-multi-table-sink-writer-2] - MultiTableWriterRunnable error when write row SeaTunnelRow{tableId=base_bank_server.bank_dept_relation, kind=-D, fields=[7497, 7678]} org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[COMMON-08], ErrorDescription:[Sql operation failed, such as (execute,addBatch,close) etc...] - Writing records to JDBC failed. at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:109) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:154) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.sink.JdbcSinkWriter.write(JdbcSinkWriter.java:44) ~[?:?] at org.apache.seatunnel.api.sink.multitablesink.MultiTableWriterRunnable.run(MultiTableWriterRunnable.java:67) ~[seatunnel-starter.jar:2.3.12] at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43) ~[seatunnel-starter.jar:2.3.12] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_272] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_272] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_272] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_272] Caused by: org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[JDBC-04], ErrorDescription:[Connector database failed] - Reestablish JDBC connection failed at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:153) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:106) ~[?:?] ... 9 more Caused by: org.apache.seatunnel.connectors.seatunnel.jdbc.exception.JdbcConnectorException: ErrorCode:[JDBC-10], ErrorDescription:[Data type cast failed] - error field:descendant at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:225) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:48) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:33) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.executeBatch(BufferReducedBatchStatementExecutor.java:77) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.closeStatements(BufferReducedBatchStatementExecutor.java:101) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.updateExecutor(JdbcOutputFormat.java:207) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:147) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:106) ~[?:?] ... 9 more Caused by: java.sql.SQLException: No operations allowed after statement closed. at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:82) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.checkBounds(ClientPreparedStatement.java:1405) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.getCoreParameterIndex(ClientPreparedStatement.java:1409) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.setInt(ClientPreparedStatement.java:1597) ~[mysql-connector-java-8.0.27.jar:8.0.27] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setInt(HikariProxyPreparedStatement.java) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.setInt(FieldNamedPreparedStatement.java:95) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.setValueToStatementByDataType(AbstractJdbcRowConverter.java:253) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:216) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:48) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:33) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.executeBatch(BufferReducedBatchStatementExecutor.java:77) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.closeStatements(BufferReducedBatchStatementExecutor.java:101) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.updateExecutor(JdbcOutputFormat.java:207) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:147) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:106) ~[?:?] ... 9 more Caused by: com.mysql.cj.exceptions.StatementIsClosedException: No operations allowed after statement closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_272] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_272] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_272] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_272] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.StatementImpl.checkClosed(StatementImpl.java:341) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.checkBounds(ClientPreparedStatement.java:1391) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.getCoreParameterIndex(ClientPreparedStatement.java:1409) ~[mysql-connector-java-8.0.27.jar:8.0.27] at com.mysql.cj.jdbc.ClientPreparedStatement.setInt(ClientPreparedStatement.java:1597) ~[mysql-connector-java-8.0.27.jar:8.0.27] at org.apache.seatunnel.shade.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setInt(HikariProxyPreparedStatement.java) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.FieldNamedPreparedStatement.setInt(FieldNamedPreparedStatement.java:95) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.setValueToStatementByDataType(AbstractJdbcRowConverter.java:253) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.converter.AbstractJdbcRowConverter.toExternal(AbstractJdbcRowConverter.java:216) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:48) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.SimpleBatchStatementExecutor.addToBatch(SimpleBatchStatementExecutor.java:33) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.executeBatch(BufferReducedBatchStatementExecutor.java:77) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.executor.BufferReducedBatchStatementExecutor.closeStatements(BufferReducedBatchStatementExecutor.java:101) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.updateExecutor(JdbcOutputFormat.java:207) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.flush(JdbcOutputFormat.java:147) ~[?:?] at org.apache.seatunnel.connectors.seatunnel.jdbc.internal.JdbcOutputFormat.writeRecord(JdbcOutputFormat.java:106) ~[?:?] ... 9 more

NaughtyYang avatar Aug 17 '26 07:08 NaughtyYang

Thanks for the new logs. I re-checked the current dev JDBC sink path before replying again, and the thread now shows that the issue is broader than only the connection-test-query path discussed in PR #11771.

That PR still looks like a valid narrow fix for one gap: today JdbcSinkWriter applies pool validation before forwarding user properties, so a connection-test-query inside the properties block does not actually configure HikariCP's pool validation path on current dev.

But the stack you pasted shows a second failure path after the connection is already broken:

  1. Hikari marks the connection broken with SQLSTATE 08S01 / MySQL wait_timeout symptoms;
  2. JdbcOutputFormat.flush() enters the reconnect branch and calls updateExecutor(true) when it sees connection / statement-closed errors;
  3. the retry still ends up at FieldNamedPreparedStatement.setInt(...) with StatementIsClosedException, wrapped later as Data type cast failed.

So I would keep PR #11771 scoped as the validation-query prevention fix, but I would not treat it as the full fix for this issue anymore. The current logs now point to a separate reconnect / buffered-row replay gap in the JDBC sink path.

The most useful next step would be:

  1. keep #11771 limited to the connection-test-query prevention path;
  2. add a follow-up fix (or extend the same work if the PR author agrees) that reproduces the 08S01 -> reconnect -> statement closed on replay path with a focused JdbcOutputFormat / buffered-executor regression test;
  3. update the issue summary in English with whether the failing run is multi-table + generate_sink_sql = true, because that helps narrow the replay path.

As an operational mitigation, it is still worth keeping Hikari maxLifetime / keepaliveTime below MySQL wait_timeout, but source-wise I think this issue should remain open until the reconnect path is fixed as well.

DanielLeens avatar Aug 17 '26 12:08 DanielLeens

Yes, The failing run is multi‑table scenario with generate_sink_sql = true @DanielLeens

NaughtyYang avatar Aug 18 '26 03:08 NaughtyYang

Thanks, that narrows the reproduction further.

I re-checked the current dev JDBC sink path with your clarification in mind. The important point is that this is not only a generic reconnect case anymore; it is the multi-table JDBC sink path with generate_sink_sql = true.

On current dev, we do have reconnect coverage in JdbcOutputFormatReconnectTest, but those tests only prove that flush() can detect 08xxx / statement closed SQLExceptions, call updateExecutor(true), and re-prepare statements. They do not cover a multi-table writer rebuilding statements and replaying buffered rows correctly after reconnect under generated-SQL mode.

So your new detail is useful because it gives us a much tighter regression target for the second fix. I would keep #11771 scoped to the pool-validation gap, and track the remaining fix here as:

  1. reproduce the failure with multi-table + generate_sink_sql = true;
  2. verify statement rebuild + buffered-row replay after reconnect on the active table path;
  3. keep this issue open until that path has a focused regression test and fix.

If someone extends the implementation, please make the regression target this exact configuration rather than only a generic single-table reconnect case.

DanielLeens avatar Aug 18 '26 12:08 DanielLeens

@DanielLeens I traced this against current dev. The functional reconnect handling is already present through #9942 and #10793, but the exact multi-table and generated SQL path was not covered.

I added a regression test with two JDBC table writers. It simulates 08S01, the stale statement failure during buffer replay, reconnects the active writer, rebuilds its statements, and verifies both buffered rows are written once. The test fails if the #9942 handling is removed. #11879

It would still be useful to retry the original job against current dev or a release containing #9942 and #10793.

goutamadwant avatar Aug 19 '26 06:08 goutamadwant

I would like to work on this issue.

zhang-arvin avatar Aug 19 '26 13:08 zhang-arvin

Thanks @goutamadwant, that is exactly the regression target we discussed. A two-table writer test that simulates 08S01, fails on the stale statement during buffer replay, reconnects the active writer, rebuilds statements, and asserts both buffered rows are written exactly once covers the gap I described for the multi-table + generate_sink_sql = true path. The fact that the test fails when the #9942 handling is removed is a good signal that it is actually pinning the behavior we want. I will review #11879.

@NaughtyYang, could you please retry the original failing job against current dev (or a release containing #9942 and #10793) and report back whether the 08S01 -> reconnect -> statement closed on replay failure still reproduces? That result decides whether this issue can be closed once #11879 lands, or whether there is still a functional gap beyond missing test coverage.

@zhang-arvin, thanks for offering to help. Since @goutamadwant has already opened #11879 for the regression test, please coordinate with them there rather than starting parallel work. If NaughtyYang's retry shows the failure still reproduces on current dev, there will be a functional fix to pick up on top of that test.

Concrete remaining asks:

  1. @NaughtyYang: retry against current dev and share the result (logs if it still fails);
  2. review of #11879 to confirm it targets the exact multi-table + generate_sink_sql = true replay path;
  3. keep this issue open until both the retry result and the regression test are in.

#11771 stays scoped to the connection-test-query pool-validation prevention path as agreed earlier in this thread.

SEZ9 avatar Aug 20 '26 15:08 SEZ9

Thanks, I will retest the original failing job with the dev branch and feedback the result. @goutamadwant @SEZ9 @zhang-arvin

NaughtyYang avatar Aug 21 '26 06:08 NaughtyYang

I already had patch #9942 applied when hitting this failure, so #9942 alone does not fix this issue. I plan to test with patch #10793 to see whether it improves the situation. @SEZ9

NaughtyYang avatar Aug 21 '26 07:08 NaughtyYang

Thanks for offering to help, @zhang-arvin — happy to have you on this.

Before starting new work, please note where things currently stand in this thread:

  • @goutamadwant has already traced the multi-table + generate_sink_sql = true path against current dev and opened a regression test covering the 08S01 -> reconnect -> buffered-row replay scenario with two table writers.
  • @NaughtyYang is retesting the original failing job against dev, and has reported that the first reconnect patch alone did not fix the failure; they still plan to test with the second patch applied.

So the concrete asks:

  1. @zhang-arvin, please coordinate with @goutamadwant first so we don't duplicate effort — the most useful contribution right now would be picking up whatever fix work remains if @NaughtyYang's retest on dev still reproduces the failure, rather than starting a parallel investigation.
  2. @NaughtyYang, once you have the retest results (both plain dev and with the additional patch), please post them here so we know whether there is still an open gap for @zhang-arvin to work on.

Once we have that retest feedback, we can assign the remaining work clearly. Thanks all for staying on this.

SEZ9 avatar Aug 22 '26 15:08 SEZ9

Hi,After verification, neither #9942 nor #10793 helps. The error described above still persists. @SEZ9

NaughtyYang avatar Aug 24 '26 03:08 NaughtyYang

Thanks for rechecking this against the newer patch set. That result is important: it confirms this issue is not fully covered by #9942 or #10793, so there is still an open functional gap on current dev.

The issue should stay open for the current repair path:

  1. #11879 keeps the regression test for the multi-table replay path;
  2. #11883 is the active functional-fix candidate for the MySQL sink connection leak / stale-statement behavior.

@zhang-arvin, please keep the fix scoped to the reproduce path discussed here and continue linking the exact failing/recovered path back to this issue as the PR evolves.

@NaughtyYang, if possible, please add the exact dev commit or build you retested, plus the relevant failing log snippet around the 08S01 and replay step. That will help us compare the remaining runtime gap directly against the current PR behavior.

DanielLeens avatar Aug 24 '26 12:08 DanielLeens

@NaughtyYang thanks for taking the time to verify — that's exactly the confirmation we needed. Your result shows that neither #9942 nor #10793 closes this failure, so the reconnect handling from those patches is not sufficient for the multi-table + generate_sink_sql = true path you reported. The issue will stay open and is now the tracking point for the remaining functional gap.

Current status on our side:

  • #11879 covers the regression test for the multi-table buffered-row replay path, per goutamadwant's work;
  • #11883 is the active functional-fix candidate, and zhang-arvin has volunteered to keep driving the fix scoped to this reproduce path.

To close the loop on your verification, echoing what DanielLeens asked, could you please share:

  1. the exact dev commit or build you retested with #9942 and #10793 applied;
  2. the failing log snippet around the 08S01 error and the replay step.

With those two pieces we can compare your runtime failure directly against the behavior of the current fix candidate and confirm whether #11883 actually resolves your scenario before merging. Thanks again for the thorough retesting.

SEZ9 avatar Aug 25 '26 10:08 SEZ9

thank you,I tested on tag 2.3.12 with PR #9942 and #10793 patches manually applied. The error is still identical to the log snippet I attached above, the failure message has not changed. I think we can consider adopting the changes from #11883. @SEZ9

NaughtyYang avatar Aug 26 '26 09:08 NaughtyYang

Thanks for confirming that the issue still reproduces on tag 2.3.12 even with #9942 and #10793 applied manually.

That is useful because it shows those two patches are still not sufficient for your scenario. At the same time, it is still different from validating the current dev branch or the active fix branch directly, so we should keep the merge decision tied to the current repair path rather than to a 2.3.12 cherry-pick result alone.

For this thread the active path is still:

  1. #11879 for the regression test covering the multi-table replay path;
  2. #11883 as the current functional-fix candidate for the stale-statement / connection-leak behavior.

So yes, #11883 remains the right PR to evaluate here.

If you can, one more very helpful check would be:

  1. the exact failing log snippet around the 08S01 / reconnect / replay step from your test run;
  2. whether the same scenario still reproduces when you validate against the current #11883 branch, or a dev build that includes it.

That will let us compare the remaining runtime gap directly against the active fix candidate before merge.

DanielLeens avatar Aug 26 '26 12:08 DanielLeens

Got it. I will perform the test on the #11883 branch, and I will share the error logs if the problem still reproduces. @SEZ9 @DanielLeens

NaughtyYang avatar Aug 27 '26 08:08 NaughtyYang