View Issue Details

IDProjectCategoryView StatusLast Update
0004567SymmetricDSBugpublic2022-08-30 13:04
Reporterkraynopp Assigned Toemiller  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.12.3 
Target Version3.14.1Fixed in Version3.14.1 
Summary0004567: sync.table.prefix parameter ignores for sequence in PostgreSQL
DescriptionSymmetricDS uses sym_data_data_id_seq name for sequence and ignores sync.table.prefix parameter for PostgreSQL.
Steps To Reproduce1. I have installed old 3.9.2 SymmetricDS with sync.table.prefix=tst. SymmetricDS has created sequence named tst_data_data_id_seq.
2. I have tried to upgrade to the last 3.12.3 version. In my log file I can see exception - sequence sym_data_data_id_seq does not exists.
Additional Information1. Workaround - sequence can be manually renamed before upgrade. But I suppose sync.table.prefix parameter should work for all SymmetricDS objects including sequence.
2. For Oracle database and sync.table.prefix=tst parameter SymmetricDS creates sequence SEQ_TST_DATA_DATA_ID. And it works well after upgrade, no need to rename sequence.
Tagsconfiguration

Activities

elong

2020-09-23 17:32

developer   ~0001780

Pretty sure it's always named the sequence with seq (since 2012) and it doesn't use the sync.table.prefix. But it probably should be using the prefix, so we can use the issue to fix the prefix on sequences.

kraynopp

2020-09-24 06:19

reporter   ~0001785

Some additional information. I have made fresh install SymmetricDS with sync.table.prefix=tst. During installation sequence tst_data_data_id_seq has been created, but this installation is not workable. I can see following in log file:

2020-09-24 09:09:09,734 ERROR [pgsql-000] [RouterJob] [pgsql-000-job-1] Exception while executing job 'Routing' StackTraceKey.init [SqlException:3262606664] org.jumpmind.db.sql.SqlException: ERROR: relation "sym_data_data_id_seq" does not exist
  Position: 24
        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.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:519)
        at org.jumpmind.db.sql.JdbcSqlTemplate.queryForObject(JdbcSqlTemplate.java:172)
        at org.jumpmind.db.sql.AbstractSqlTemplate.queryForLong(AbstractSqlTemplate.java:72)
        at org.jumpmind.symmetric.db.postgresql.PostgreSqlSymmetricDialect.getCurrentSequenceValue(PostgreSqlSymmetricDialect.java:281)
        at org.jumpmind.symmetric.service.impl.DataService.findMaxDataId(DataService.java:3001)
        at org.jumpmind.symmetric.service.impl.DataService.fixLastDataGap(DataService.java:3032)
        at org.jumpmind.symmetric.service.impl.RouterService.routeData(RouterService.java:204)
        at org.jumpmind.symmetric.job.RouterJob.doJob(RouterJob.java:49)
        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:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        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:748)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "sym_data_data_id_seq" does not exist
  Position: 24
        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.executeQuery(PgPreparedStatement.java:114)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
        at org.jumpmind.db.sql.JdbcSqlTemplate$1.execute(JdbcSqlTemplate.java:184)
        at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:517)
        ... 17 more

So, I suppose it is not upgrade issue.

Related Changesets

SymmetricDS: 3.14 96ce0b59

2022-08-04 19:30:13

evan-miller-jumpmind

Details Diff
0004567: Fixed SqlException when using sync.table.prefix Affected Issues
0004567
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/db/AbstractSymmetricDialect.java Diff File

Issue History

Date Modified Username Field Change
2020-09-23 13:03 kraynopp New Issue
2020-09-23 17:32 elong Status new => confirmed
2020-09-23 17:32 elong Note Added: 0001780
2020-09-24 06:19 kraynopp Note Added: 0001785
2022-08-02 20:08 elong Tag Attached: configuration
2022-08-04 19:30 emiller Assigned To => emiller
2022-08-04 19:30 emiller Status confirmed => resolved
2022-08-04 19:30 emiller Resolution open => fixed
2022-08-04 19:30 emiller Fixed in Version => 3.14.1
2022-08-04 20:00 Changeset attached => SymmetricDS 3.14 96ce0b59
2022-08-30 13:04 admin Status resolved => closed