You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/09/04 15:54:04 UTC

[GitHub] [shardingsphere-elasticjob] TeslaCN opened a new issue #1437: DDL will be executed every time when using PostgreSQL as tracing storage

TeslaCN opened a new issue #1437:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1437


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere-elastic-job-lite/issues).
   - Read documentation: [ElasticJob Doc](http://shardingsphere.apache.org/elasticjob/docs/elastic-job-lite/00-overview/).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ElasticJob did you use?
   master
   ### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?
   ElasticJob-Lite
   ### Environment
   ```
   DBMS: PostgreSQL (ver. 12.3 (Debian 12.3-1.pgdg100+1))
   Case sensitivity: plain=lower, delimited=exact
   Driver: PostgreSQL JDBC Driver (ver. 42.2.5, JDBC4.2)
   ```
   ```java
       private static final String EVENT_RDB_STORAGE_DRIVER = "org.postgresql.Driver";
       private static final String EVENT_RDB_STORAGE_URL = "jdbc:postgresql://pg.local.wwj.icu:5432/elasticjob";
       private static final String EVENT_RDB_STORAGE_USERNAME = "postgres";
       private static final String EVENT_RDB_STORAGE_PASSWORD = "postgres";
   ```
   ### Expected behavior
   No errors.
   ### Actual behavior
   ```
   [ERROR] 2020-09-04 23:35:54,217 --main-- [org.apache.shardingsphere.elasticjob.tracing.JobEventBus] Elastic job: create tracing listener failure, error is:  
   org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException: org.postgresql.util.PSQLException: ERROR: relation "job_execution_log" already exists
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration.createTracingListener(RDBTracingListenerConfiguration.java:37) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration.createTracingListener(RDBTracingListenerConfiguration.java:30) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerFactory.getListener(TracingListenerFactory.java:56) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.JobEventBus.register(JobEventBus.java:67) [classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.JobEventBus.<init>(JobEventBus.java:55) [classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.internal.schedule.LiteJobFacade.<init>(LiteJobFacade.java:71) [classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler.<init>(JobScheduler.java:85) [classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap.<init>(ScheduleJobBootstrap.java:43) [classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.example.MyJavaMain.setUpSimpleJob(MyJavaMain.java:105) [classes/:na]
   	at org.apache.shardingsphere.elasticjob.lite.example.MyJavaMain.main(MyJavaMain.java:70) [classes/:na]
   Caused by: org.postgresql.util.PSQLException: ERROR: relation "job_execution_log" already exists
   	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440) ~[postgresql-42.2.5.jar:42.2.5]
   	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) ~[postgresql-42.2.5.jar:42.2.5]
   	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) ~[postgresql-42.2.5.jar:42.2.5]
   	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) ~[postgresql-42.2.5.jar:42.2.5]
   	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) ~[postgresql-42.2.5.jar:42.2.5]
   	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143) ~[postgresql-42.2.5.jar:42.2.5]
   	at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132) ~[postgresql-42.2.5.jar:42.2.5]
   	at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) ~[commons-dbcp-1.4.jar:1.4]
   	at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172) ~[commons-dbcp-1.4.jar:1.4]
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage.createJobExecutionTable(RDBJobEventStorage.java:133) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage.createJobExecutionTableAndIndexIfNeeded(RDBJobEventStorage.java:101) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage.initTablesAndIndexes(RDBJobEventStorage.java:92) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage.<init>(RDBJobEventStorage.java:75) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListener.<init>(RDBTracingListener.java:36) ~[classes/:na]
   	at org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration.createTracingListener(RDBTracingListenerConfiguration.java:35) ~[classes/:na]
   	... 9 common frames omitted
   
   ```
   ### Reason analyze (If you can)
   PostgreSQL will convert uppercases string without quotes to lowercase. Constants of table name are uppercase, so it cannot find tables which has already existed in DatabaseMetaData and execute DDL again. 
   ### Steps to reproduce the behavior.
   Every application startup after initialization.
   ### Example codes for reproduce this issue (such as a github link).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] terrymanu closed issue #1437: DDL will be executed every time when using PostgreSQL as tracing storage

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #1437:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1437


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org