You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/03/16 11:54:00 UTC

[GitHub] [dolphinscheduler] github-actions[bot] commented on issue #8935: [Bug] [SQL] When upgrading from 2.0.1 to 2.0.5, the task is always running and cannot be deleted

github-actions[bot] commented on issue #8935:
URL: https://github.com/apache/dolphinscheduler/issues/8935#issuecomment-1069044585


   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   After I upgraded from version 2.0.1 to version 2.0.5, I found that the task has been running and cannot be deleted, so I went to check the log and found that there was a field missing in the database, I went to check the following, which was not mentioned in the released version Regarding the update of metadata, it is found that the restart_time field is missing in the t_ds_process_instance table by comparing the installation documentation. I am using Mysql for metadata storage. The error log is as follows:
   ````
   [ERROR] 2022-03-16 18:36:59.599 org.apache.dolphinscheduler.server.master.runner.FailoverExecuteThread:[82] - MASTER server failover failed, host:172.16.1.70:5678
   org.springframework.jdbc.BadSqlGrammarException:
   ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'restart_time' in 'field list'
   ### The error may exist in class path resource [org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml]
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: select id, name, process_definition_version, process_definition_code, state, recovery, start_time, end_time, run_times, host, command_type, command_param, task_depend_type, max_try_times, failure_strategy, warning_type, warning_group_id, schedule_time, command_start_time, global_params, flag, update_time, is_sub_process, executor_id, history_cmd, process_instance_priority, worker_group,environment_code, timeout, tenant_id, var_pool, dry_run, restart_time from t_ds_process_instance where 1=1 and host=? and state in ( ? , ? , ? , ? , ? ) order by id asc
   ### Cause: java.sql.SQLSyntaxErrorException: Unknown column 'restart_time' in 'field list'
   ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column 'restart_time' in 'field list'
           at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
           at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
           at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74)
           at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
           at com.sun.proxy.$Proxy91.selectList(Unknown Source)
           at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
           at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158)
           at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76)
           at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61)
           at com.sun.proxy.$Proxy100.queryByHostAndStatus(Unknown Source)
           at org.apache.dolphinscheduler.service.process.ProcessService.queryNeedFailoverProcessInstances(ProcessService.java:1844)
           at org.apache.dolphinscheduler.service.process.ProcessService$$FastClassBySpringCGLIB$$ed138739.invoke(<generated>)
           at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
           at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
           at org.apache.dolphinscheduler.service.process.ProcessService$$EnhancerBySpringCGLIB$$43d96e87.queryNeedFailoverProcessInstances(<generated>)
           at org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient.failoverMaster(MasterRegistryClient.java:423)
           at org.apache.dolphinscheduler.server.master.runner.FailoverExecuteThread.run(FailoverExecuteThread.java:80)
   Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'restart_time' in 'field list'
           at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
           at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
           at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
           at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:371)
           at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
           at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
           at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
           at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
           at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
           at com.sun.proxy.$Proxy130.query(Unknown Source)
           at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67)
           at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
           at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
           at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:136)
           at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
           at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
           at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:498)
           at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
           ... 13 common frames omitted
   ````
   
   ### What you expected to happen
   
   The metadata in the SQL table is not updated in time.
   
   ### How to reproduce
   
   Upgrade 2.0.1 to 2.0.5 via official documentation.
   
   
   ### Anything else
   
   Solution:
   1. Find the library that stores dolphinscheduler in mysql
   2. Use the library
   3. Execute the following SQL
   ````
   alter table t_ds_process_instance add `restart_time` datetime DEFAULT NULL COMMENT 'process instance restart time';
   ````
   
   ### Version
   
   2.0.5
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

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