Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix] Fix database initialize late in standalone. #10296

Merged
merged 1 commit into from
May 31, 2022

Conversation

ruanwenjun
Copy link
Member

Purpose of the pull request

When I start StandaloneServer, find the master will throw exception:

[ERROR] 2022-05-30 18:37:34.967 +0800 org.apache.dolphinscheduler.server.master.registry.ServerNodeManager:[221] - WorkerNodeInfoAndGroupDbSyncTask error:
org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "t_ds_worker_group" not found; SQL statement:
select *
        from t_ds_worker_group
        order by update_time desc [42102-200]
### The error may exist in file [/Users/ruanwenjun/Project/Github/dolphinscheduler/dolphinscheduler-dao/target/classes/org/apache/dolphinscheduler/dao/mapper/WorkerGroupMapper.xml]
### The error may involve org.apache.dolphinscheduler.dao.mapper.WorkerGroupMapper.queryAllWorkerGroup
### The error occurred while executing a query
### SQL: select *         from t_ds_worker_group         order by update_time desc
### Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "t_ds_worker_group" not found; SQL statement:
select *
        from t_ds_worker_group
        order by update_time desc [42102-200]
; bad SQL grammar []; nested exception is org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "t_ds_worker_group" not found; SQL statement:
select *
        from t_ds_worker_group
        order by update_time desc [42102-200]

This is caused by the h2 database is not initialized when we query the work group.

Brief change log

Inject the DataSourceScriptDatabaseInitializer to make sure the database is initialized after we can get connector.

Verify this pull request

Start StandaloneServer, find there is no exception.

@ruanwenjun ruanwenjun changed the title Fix database initialize late in standalone. [hotfix] Fix database initialize late in standalone. May 30, 2022
@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label May 30, 2022
@SbloodyS SbloodyS requested a review from caishunfeng May 30, 2022 10:45
@sonarcloud
Copy link

sonarcloud bot commented May 30, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@caishunfeng caishunfeng left a comment

Choose a reason for hiding this comment

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

LGTM

@caishunfeng caishunfeng merged commit 3a9e673 into apache:dev May 31, 2022
@zhongjiajie zhongjiajie added this to the 3.0.0-beta-2 milestone May 31, 2022
@ruanwenjun ruanwenjun deleted the dev_wenjun_patch8432 branch May 31, 2022 07:10
devosend pushed a commit that referenced this pull request Jun 17, 2022
ITBOX-ITBOY pushed a commit to ITBOX-ITBOY/dolphinscheduler that referenced this pull request Jul 8, 2022
@MilkWangStudio
Copy link

I saw this bug in 2.0.6 version. The same error message.

@ruanwenjun
Copy link
Member Author

Fix database initialize late in standalone. (

You can follow this PR #10296.

@MilkWangStudio
Copy link

Fix database initialize late in standalone. (

You can follow this PR #10296.

Thanks, it works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend improvement make more easy to user or prompt friendly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants