Skip to content

[FIX-Bug #3845][Ambari Plugin] Start Ambari report an error: Table 't_ds_process_definition_version' already exists#3846

Merged
EricJoy2048 merged 3 commits intoapache:devfrom
yangruochen:dev
Sep 28, 2020
Merged

[FIX-Bug #3845][Ambari Plugin] Start Ambari report an error: Table 't_ds_process_definition_version' already exists#3846
EricJoy2048 merged 3 commits intoapache:devfrom
yangruochen:dev

Conversation

@yangruochen
Copy link
Copy Markdown
Contributor

fix bug(#3845 ) Start Ambari report an error: Table 't_ds_process_definition_version' already exists

Copy link
Copy Markdown
Member

@EricJoy2048 EricJoy2048 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Copy Markdown
Member

@EricJoy2048 EricJoy2048 Sep 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Copy Markdown
Member

@EricJoy2048 EricJoy2048 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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` (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine ,Before version 1.3.3,This table does not exist.

这样是可以的,这个表在1.3.3之前是不存在的。

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine ,Before version 1.3.3,This table does not exist.

这样是可以的,这个表在1.3.3之前是不存在的。

Ok !

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Copy Markdown
Contributor

@felix-thinkingdata felix-thinkingdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job

Copy link
Copy Markdown
Member

@EricJoy2048 EricJoy2048 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@EricJoy2048 EricJoy2048 merged commit 42c88a7 into apache:dev Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants