[CONJ-728] An SQL statement suddenly fails to execute Created: 2019-09-04  Updated: 2020-03-06  Resolved: 2020-03-06

Status: Closed
Project: MariaDB Connector/J
Component/s: Failover
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: xiaohua zhou Assignee: Diego Dupin
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

springboot + HikariCP + mariadb
jdbc:mariadb:aurora://rds-other.production.net:3306/temp


Attachments: Text File exception.log    

 Description   

When the system consumes the message in SQS, it is ready to update a record, the result of the update fails to report an error, and then it is always reported error during repeated consumption (this SQL statement should be executed very quickly, just update a field according to the primary key id). As a result, the SQS is pressed a lot of messages and cannot be consumed until the service is restarted, and the message in the queue is consumed. At this point the database is normal, other data queries and inserts are normal. The error message is as follows

      1. The error may exist in com/test/repository/ProductRepository.java (mapper)
      2. The error may involve com.test.repository.ProductRepository.__update_by_id_ignore_null-Inline
      3. The error occurred while setting parameters
      4. SQL: update product_sales SET end_date=? where id = ?
      5. Cause: java.sql.SQLNonTransientConnectionException: (conn=581116) Communications link failure with primary host rds-other.production.net:3306. Connection timed out
        ; (conn=581116) Communications link failure with primary host rds-other.production.net:3306. Connection timed out; nested exception is java.sql.SQLNonTransientConnectionException: (conn=581116) Communications link failure with primary host rds-other.production.net:3306. Connection timed out

See the file for complete error messages.



 Comments   
Comment by Diego Dupin [ 2019-09-04 ]

Error message "Communications link failure with primary host rds-other.production.net" means that connection to database has failed. Even if hikaricp validate connection before giving it to application, nothing prevent to have network outage / server issue ...

There is different failover possibility, but for the exact one listed here, connector cannot know the state of the server record: update has been sent to server, and connection is down before receiving ok/ko from server. So server can have receive and execute query ... or not.

I would check server error at these exact time to identify why this error occur

Comment by Diego Dupin [ 2019-09-20 ]

Changing priority to major since connection that might fail can always be expected. even if in this case this is one of the badest issues that can occur

Comment by Diego Dupin [ 2020-03-06 ]

Closing since not a bug.
When socket fail during update, it cannot ensure that server received and handle the update. Some case like this cannot be handle by the driver, but saving and replaying the whole transaction. And that is a new feature.

Generated at Thu Feb 08 03:17:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.