View Issue Details

IDProjectCategoryView StatusLast Update
0006814SymmetricDS ProBugpublic2025-05-06 02:56
Reporterpmarzullo Assigned Topmarzullo  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.13.0 
Target Version3.16.2Fixed in Version3.16.2 
Summary0006814: Initial load fails with DB concurrent error
DescriptionInitial load fails with the next error:
2020-11-19 14:46:44,890 ERROR [Primary-EED0D853-1771-2C49-B8CF-B25FE290ED67] [InitialLoadService] [Primary-EED0D853-1771-2C49-B8CF-B25FE290ED67-job-16] Error while queuing initial loads StackTraceKey.init [SqlException:985884203] org.jumpmind.db.sql.SqlException: ERROR: could not serialize access due to concurrent update
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:306)
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:295)
        at org.jumpmind.db.sql.JdbcSqlTransaction.executeCallback(JdbcSqlTransaction.java:398)
        at org.jumpmind.db.sql.JdbcSqlTransaction.prepareAndExecute(JdbcSqlTransaction.java:364)
        at org.jumpmind.symmetric.service.impl.DataService.insertReloadEvents(DataService.java:1046)
        at org.jumpmind.symmetric.service.impl.InitialLoadService.processTableRequestLoads(InitialLoadService.java:282)
        at org.jumpmind.symmetric.service.impl.InitialLoadService.queueLoads(InitialLoadService.java:98)
        at org.jumpmind.symmetric.job.InitialLoadJob.doJob(InitialLoadJob.java:43)
        at org.jumpmind.symmetric.job.AbstractJob.invoke(AbstractJob.java:227)
        at org.jumpmind.symmetric.job.AbstractJob.run(AbstractJob.java:298)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:319)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:191)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.lang.Thread.run(Thread.java:818)
Caused by: org.postgresql.util.PSQLException: ERROR: could not serialize access due to concurrent update
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
        at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:153)
        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.JdbcSqlTransaction$6.execute(JdbcSqlTransaction.java:374)
        at org.jumpmind.db.sql.JdbcSqlTransaction$6.execute(JdbcSqlTransaction.java:364)
        at org.jumpmind.db.sql.JdbcSqlTransaction.executeCallback(JdbcSqlTransaction.java:396)
        ... 15 more

The actual place where it fails is (DataService.java, 1046 line):
transaction.prepareAndExecute(getSql("updateTableReloadStatusFinalizeCount"), finalizeBatchCount, new Date(), loadId);

I checked the isolation level for Postgres JDBC transactions and it was TRANSACTION_READ_COMMITTED = 2. I also noticed that when setting the parameter: datareload.batch.insert.transactional from TRUE to FALSE initial load finishes.
Steps To ReproduceDB: Postgres 10.5
2 nodes.
Fully default symmetric configuration.
Tagsdialect: postgresql, initial/partial load

Relationships

related to 0004643 closedpmarzullo SymmetricDS Initial load fails with DB concurrent error 

Activities

pbelov

2025-05-06 02:56

manager   ~0002934

Included in the 3.16.2 release

Issue History

Date Modified Username Field Change
2025-04-10 13:17 pmarzullo New Issue
2025-04-10 13:17 pmarzullo Status new => assigned
2025-04-10 13:17 pmarzullo Assigned To => pmarzullo
2025-04-10 13:17 pmarzullo Tag Attached: dialect: postgresql
2025-04-10 13:17 pmarzullo Tag Attached: initial/partial load
2025-04-10 13:17 pmarzullo Relationship added related to 0004643
2025-04-14 13:17 pmarzullo Status assigned => resolved
2025-04-14 13:17 pmarzullo Fixed in Version => 3.16.2
2025-04-14 13:18 pmarzullo Resolution open => fixed
2025-04-14 13:18 pmarzullo Status resolved => new
2025-04-14 13:18 pmarzullo Resolution fixed => reopened
2025-04-14 13:19 pmarzullo Status new => resolved
2025-04-14 13:19 pmarzullo Resolution reopened => fixed
2025-05-06 02:56 pbelov Note Added: 0002934
2025-05-06 02:56 pbelov Status resolved => closed