View Issue Details

IDProjectCategoryView StatusLast Update
0003288SymmetricDSBugpublic2017-11-06 13:13
Reportermmichalek Assigned Tommichalek  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.8.0 
Target Version3.8.31Fixed in Version3.8.31 
Summary0003288: The cancellation of pending heartbeat batches can cause a deadlock on SQL Server
DescriptionThis change attempts to do a dirty read of the batch id's which need updated, and then update them one-by-one, in attempt to do less locking on the database. Below is the stacktrace that was observed with this problem:

2017-10-17 06:59:31,222 ERROR [nodeId] [HeartbeatJob] [nodeId-job-15] StackTraceKey.init [SqlException:3213895714]
org.jumpmind.db.sql.SqlException: Transaction (Process ID 65) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
                at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:300)
                at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:291)
                at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:493)
                at org.jumpmind.db.sql.JdbcSqlTemplate.update(JdbcSqlTemplate.java:342)
                at org.jumpmind.db.sql.AbstractSqlTemplate.update(AbstractSqlTemplate.java:224)
                at org.jumpmind.symmetric.service.impl.OutgoingBatchService.markAllChannelAsSent(OutgoingBatchService.java:160)
                at org.jumpmind.symmetric.job.PushHeartbeatListener.heartbeat(PushHeartbeatListener.java:92)
                at org.jumpmind.symmetric.service.impl.DataService.heartbeat(DataService.java:1995)
                at org.jumpmind.symmetric.job.HeartbeatJob.doJob(HeartbeatJob.java:56)
                at org.jumpmind.symmetric.job.AbstractJob.invoke(AbstractJob.java:175)
                at org.jumpmind.symmetric.job.AbstractJob.run(AbstractJob.java:219)
                at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
                at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
                at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Transaction (Process ID 65) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
                at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
                at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2894)
                at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2334)
                at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:643)
                at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:614)
                at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:573)
                at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.execute(JtdsPreparedStatement.java:761)
                at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
                at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
                at org.jumpmind.db.sql.JdbcSqlTemplate$5.execute(JdbcSqlTemplate.java:374)
                at org.jumpmind.db.sql.JdbcSqlTemplate$5.execute(JdbcSqlTemplate.java:342)
                at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:491)
                ... 16 more
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.8 e06317dc

2017-10-20 14:59:03

mmichalek

Details Diff
0003288: The cancellation of pending heartbeat batches can cause a
deadlock on SQL Server
Affected Issues
0003288
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchService.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/OutgoingBatchServiceSqlMap.java Diff File

Issue History

Date Modified Username Field Change
2017-10-20 18:58 mmichalek New Issue
2017-10-20 18:58 mmichalek Status new => assigned
2017-10-20 18:58 mmichalek Assigned To => mmichalek
2017-10-20 19:00 mmichalek Changeset attached => SymmetricDS 3.8 e06317dc
2017-10-20 19:01 mmichalek Status assigned => resolved
2017-10-20 19:01 mmichalek Resolution open => fixed
2017-10-20 19:01 mmichalek Fixed in Version => 3.8.31
2017-11-06 13:13 chenson Status resolved => closed