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

[bug][db] Table relation_project_user have duplicate record #9536

Merged
merged 8 commits into from
Apr 27, 2022

Conversation

leiwingqueen
Copy link
Contributor

@leiwingqueen leiwingqueen commented Apr 17, 2022

Purpose of the pull request

refer to issue close #9290

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2022

Codecov Report

Merging #9536 (b6817d0) into dev (a5bbf78) will increase coverage by 0.04%.
The diff coverage is 90.90%.

@@             Coverage Diff              @@
##                dev    #9536      +/-   ##
============================================
+ Coverage     39.98%   40.02%   +0.04%     
- Complexity     4432     4477      +45     
============================================
  Files           831      835       +4     
  Lines         33314    33583     +269     
  Branches       3677     3715      +38     
============================================
+ Hits          13320    13443     +123     
- Misses        18766    18886     +120     
- Partials       1228     1254      +26     
Impacted Files Coverage Δ
...inscheduler/api/service/impl/UsersServiceImpl.java 80.67% <90.90%> (+0.14%) ⬆️
...r/plugin/registry/zookeeper/ZookeeperRegistry.java 48.21% <0.00%> (-8.04%) ⬇️
...lphinscheduler/api/controller/UsersController.java 59.25% <0.00%> (-2.28%) ⬇️
...er/api/controller/ProcessDefinitionController.java 45.34% <0.00%> (-2.22%) ⬇️
...cheduler/api/service/impl/ExecutorServiceImpl.java 40.62% <0.00%> (-1.35%) ⬇️
...api/service/impl/ProcessDefinitionServiceImpl.java 31.07% <0.00%> (-0.67%) ⬇️
...i/service/impl/ProcessTaskRelationServiceImpl.java 21.03% <0.00%> (-0.64%) ⬇️
...scheduler/api/service/impl/ProjectServiceImpl.java 77.12% <0.00%> (-0.54%) ⬇️
...server/master/runner/task/CommonTaskProcessor.java 4.34% <0.00%> (-0.20%) ⬇️
...r/api/service/impl/ProcessInstanceServiceImpl.java 60.10% <0.00%> (-0.12%) ⬇️
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5bbf78...b6817d0. Read the comment docs.

@@ -57,3 +57,8 @@ d//
delimiter ;
CALL uc_dolphin_T_t_ds_alert_R_sign;
DROP PROCEDURE uc_dolphin_T_t_ds_alert_R_sign;

-- add unique key to t_ds_relation_project_user
ALTER TABLE t_ds_relation_project_user ADD UNIQUE KEY uniq_uid_pid(user_id,project_id);
Copy link
Member

Choose a reason for hiding this comment

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

i think we should add to new SQL directory named 3.0.0?

Copy link
Member

Choose a reason for hiding this comment

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

i think we should add to new SQL directory named 3.0.0?

It's a bug fix. I think it should be included in 2.0.6-release. WDYT? @zhongjiajie

Copy link
Member

Choose a reason for hiding this comment

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

In general, I think change targe branch with dev database change should add to 3.0.0_schema, and committer judge whether should release in bug fix version. If it is only put in 2.0.5 and not in 3.0.0, it may be that the 3.0.0-bate release will miss this commit.

But in case, dev branch without 3.0.0_schema folder,(and that is my wrong, i forgot to add it after 3.0.0-release) so i think it could change into 2.0.6 or 3.0.0

Copy link
Member

Choose a reason for hiding this comment

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

In general, I think change targe branch with dev database change should add to 3.0.0_schema, and committer judge whether should release in bug fix version. If it is only put in 2.0.5 and not in 3.0.0, it may be that the 3.0.0-bate release will miss this commit.

But in case, dev branch without 3.0.0_schema folder,(and that is my wrong, i forgot to add it after 3.0.0-release) so i think it could change into 2.0.6 or 3.0.0

I agree with you. @zhongjiajie

@zhongjiajie
Copy link
Member

code LGTM, but we still have discussion in #9536 (comment)

Copy link
Contributor

@litiliu litiliu left a comment

Choose a reason for hiding this comment

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

not necessarily to change

// 4. maintain the relationship between project and user if not exists
ProjectUser projectUser = projectUserMapper.queryProjectRelation(project.getId(), userId);
if (projectUser == null) {
final Date today = new Date();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the final identifier is not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I try to remove it

@sonarcloud
Copy link

sonarcloud bot commented Apr 25, 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 0 Code Smells

87.5% 87.5% Coverage
0.0% 0.0% Duplication

Copy link
Member

@zhongjiajie zhongjiajie left a comment

Choose a reason for hiding this comment

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

LGTM, thanks~

@zhongjiajie zhongjiajie merged commit c837580 into apache:dev Apr 27, 2022
@zhongjiajie zhongjiajie changed the title bugfix:relation_project_user duplicate [bug][db] Table relation_project_user have duplicate record Apr 27, 2022
SnowMoon-Dev pushed a commit to SnowMoon-Dev/dolphinscheduler that referenced this pull request Apr 27, 2022
Tianqi-Dotes pushed a commit to Tianqi-Dotes/dolphinscheduler that referenced this pull request Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend first time contributor First-time contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [t_ds_relation_project_user] Duplicate data exists
5 participants