[FIX-Bug #3845][Ambari Plugin] Start Ambari report an error: Table 't_ds_process_definition_version' already exists#3846
Conversation
…s_definition_version' already exists apache#3845
EricJoy2048
left a comment
There was a problem hiding this comment.
I think the problem is in the schema file. Not here.
| Execute(init_cmd, user=params.dolphin_user) | ||
|
|
||
| #upgrade | ||
| upgrade_cmd=format("sh " + params.dolphin_home + "/script/upgrade-dolphinscheduler.sh") |
There was a problem hiding this comment.
I think the problem is in the schema file. Not here.
In order to ensure that the table structure metadata is up to date, we need to execute the upgrade-dolphinscheduler.sh script at startup. This script will automatically check the current version number and execute the corresponding upgrade sql file.
Therefore, we require that the sql file in the schema must meet the ability of repeatable execution.
In order to achieve this goal, if we need to create the table t_ds_process_definition_version, then we should use
create table IF NOT EXISTS t_ds_process_definition_version;
or
drop table if exists t_ds_process_definition_version;
create table t_ds_process_definition_version;
…s_process_definition_version' already exists apache#3845" This reverts commit 56e030e
…s_definition_version' already exists apache#3845
EricJoy2048
left a comment
There was a problem hiding this comment.
I don’t know why the author of this stored procedure wants to recreate t_ds_process_definition_version here. Maybe recreate is necessary.
| CREATE PROCEDURE ct_dolphin_T_t_ds_process_definition_version() | ||
| BEGIN | ||
| CREATE TABLE `t_ds_process_definition_version` ( | ||
| CREATE TABLE IF NOT EXISTS `t_ds_process_definition_version` ( |
There was a problem hiding this comment.
I don’t know why the author of this stored procedure wants to recreate t_ds_process_definition_version here. If this is necessary, I think it`s better to modify it to
drop table if exists xxx;
create table xxx;
There was a problem hiding this comment.
I don’t know why the author of this stored procedure wants to recreate t_ds_process_definition_version here. If this is necessary, I think it`s better to modify it to
drop table if exists xxx; create table xxx;
I am a newer for dolphinscheduler. I just worry about that there store some values in this table. So I add IF NOT EXISTS.
There was a problem hiding this comment.
There was a problem hiding this comment.
That's fine ,Before version 1.3.3,This table does not exist.
这样是可以的,这个表在1.3.3之前是不存在的。
There was a problem hiding this comment.
That's fine ,Before version 1.3.3,This table does not exist.
这样是可以的,这个表在1.3.3之前是不存在的。
Ok !
|
Kudos, SonarCloud Quality Gate passed!
|
fix bug(#3845 ) Start Ambari report an error: Table 't_ds_process_definition_version' already exists