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

[#571][FOLLOWUP] fix: optimize base dir init process #616

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

advancedxy
Copy link
Contributor

@advancedxy advancedxy commented Feb 16, 2023

What changes were proposed in this pull request?

optimize the base dir init logic, it now skips recreate base dir if it's already an dir

Why are the changes needed?

handles some corner cases such as the base dir is an mount point root path.

Does this PR introduce any user-facing change?

rss shuffle server can use mounted path as base dir directly.

How was this patch tested?

Existing UTs.

@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2023

Codecov Report

Merging #616 (3bb35d3) into master (d0ef827) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master     #616      +/-   ##
============================================
+ Coverage     60.87%   60.90%   +0.03%     
+ Complexity     1802     1799       -3     
============================================
  Files           214      214              
  Lines         12388    12381       -7     
  Branches       1045     1042       -3     
============================================
  Hits           7541     7541              
+ Misses         4442     4437       -5     
+ Partials        405      403       -2     
Impacted Files Coverage Δ
...rg/apache/uniffle/storage/common/LocalStorage.java 51.31% <100.00%> (+2.25%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@kaijchen kaijchen 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 @advancedxy. Can you add a test to cover your change?

@advancedxy
Copy link
Contributor Author

LGTM, thanks @advancedxy. Can you add a test to cover your change?

Let me check that. This behavior should already been covered by existing UTs.

@kaijchen
Copy link
Contributor

The diff coverage is 33.33%.

To my surprise, the else branch is not covered.

image

@kaijchen kaijchen changed the title [#571][FOLLOWUP] don't recreate base dir if it's already an dir [#571][FOLLOWUP] fix: don't recreate base dir if it's already an dir Feb 16, 2023
@jerqi
Copy link
Contributor

jerqi commented Feb 17, 2023

Should this pr be included in version 0.7?

@advancedxy
Copy link
Contributor Author

Should this pr be included in version 0.7?

Yes.

@jerqi
Copy link
Contributor

jerqi commented Feb 17, 2023

Should this pr be included in version 0.7?

Yes.

If this pr is merged, we should backport this pr to 0.7.

Copy link
Contributor

@kaijchen kaijchen left a comment

Choose a reason for hiding this comment

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

Thanks for updating the PR @advancedxy. Some nits here.

@jerqi
Copy link
Contributor

jerqi commented Feb 17, 2023

cc @zuston

@zuston
Copy link
Member

zuston commented Feb 17, 2023

If this pr is merged, we should backport this pr to 0.7.

It's OK for me.

Copy link
Contributor

@kaijchen kaijchen left a comment

Choose a reason for hiding this comment

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

Thanks @advancedxy, this is a lot better than previous. Just some minor comments.

@advancedxy advancedxy changed the title [#571][FOLLOWUP] fix: don't recreate base dir if it's already an dir [#571][FOLLOWUP] fix: optimize base dir init process Feb 17, 2023
@advancedxy
Copy link
Contributor Author

If this pr is merged, we should backport this pr to 0.7.

It's OK for me.

thanks @zuston, I will raise PR to branch-0.7, once this is merged.

Copy link
Contributor

@kaijchen kaijchen 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 @advancedxy.

@advancedxy advancedxy merged commit 6d9cf9e into apache:master Feb 17, 2023
advancedxy added a commit to advancedxy/incubator-uniffle that referenced this pull request Feb 17, 2023
…he#616)

### What changes were proposed in this pull request?
optimize the base dir init logic, it now skips recreate base dir if it's already an dir

### Why are the changes needed?
handles some corner cases such as the base dir is an mount point root path.

### Does this PR introduce _any_ user-facing change?
rss shuffle server can use mounted path as base dir directly.

### How was this patch tested?
Existing UTs.
advancedxy added a commit that referenced this pull request Feb 17, 2023
#622)

### What changes were proposed in this pull request?
optimize the base dir init logic, it now skips recreate base dir if it's already an dir

### Why are the changes needed?
handles some corner cases such as the base dir is an mount point root path.

### Does this PR introduce _any_ user-facing change?
rss shuffle server can use mounted path as base dir directly.

### How was this patch tested?
Existing UTs.
@advancedxy advancedxy deleted the issue_571 branch February 17, 2023 13:29
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.

5 participants