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

[#1290] improvement(operator): Avoid accidentally deleting data of other services when misconfiguring the mounting directory #1291

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

qijiale76
Copy link
Contributor

@qijiale76 qijiale76 commented Nov 2, 2023

What changes were proposed in this pull request?

Only delete rssdata directory.

Why are the changes needed?

Fix: #1290

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Tested in our cluster.

  1. Mount /data/hdfs1/rssdata1 dir for shuffle server,the server will create /data/hdfs1/rssdata1/rssdata/
  2. Create files manually at host machine
touch /data/hdfs1/rssdata1/a.txt
touch /data/hdfs1/rssdata1/rssdata/b.txt
  1. Update crd to terminate this shuffle server.
  2. Without this pr, both a.txt, b.txt and rssdata dir are deleted
  3. With this pr, only b.txt is deleted

@qijiale76 qijiale76 marked this pull request as ready for review November 2, 2023 07:57
@codecov-commenter
Copy link

codecov-commenter commented Nov 2, 2023

Codecov Report

Merging #1291 (7284617) into master (b47c3d4) will decrease coverage by 0.08%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master    #1291      +/-   ##
============================================
- Coverage     53.83%   53.75%   -0.08%     
  Complexity     2691     2691              
============================================
  Files           401      401              
  Lines         23418    23419       +1     
  Branches       1992     1992              
============================================
- Hits          12606    12590      -16     
- Misses        10036    10054      +18     
+ Partials        776      775       -1     
Files Coverage Δ
...pkg/controller/sync/shuffleserver/shuffleserver.go 83.54% <0.00%> (ø)
...oy/kubernetes/operator/pkg/controller/util/util.go 40.60% <0.00%> (-0.25%) ⬇️

... and 1 file with indirect coverage changes

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

Copy link
Contributor

@advancedxy advancedxy left a comment

Choose a reason for hiding this comment

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

Would you mind to add a UT for this behavior if not too much trouble?

It’s a generally an improvement.

@jerqi
Copy link
Contributor

jerqi commented Nov 15, 2023

@zhengchenyu Could you help review this pr?

Copy link
Contributor

@advancedxy advancedxy 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 for your contribution.

@advancedxy advancedxy merged commit be10697 into apache:master Nov 18, 2023
36 checks passed
xianjingfeng pushed a commit that referenced this pull request Nov 20, 2023
…her services when misconfiguring the mounting directory (#1291)

### What changes were proposed in this pull request?

Only delete `rssdata` directory.

### Why are the changes needed?

Fix: #1290

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Tested in our cluster.

1. Mount `/data/hdfs1/rssdata1` dir for shuffle server,the server will create `/data/hdfs1/rssdata1/rssdata/`
2. Create files manually at host machine
```
touch /data/hdfs1/rssdata1/a.txt
touch /data/hdfs1/rssdata1/rssdata/b.txt
```
3. Update crd to terminate this shuffle server.
4. Without this pr, both `a.txt`, `b.txt` and `rssdata` dir are deleted
5. With this pr, only `b.txt` is deleted

Co-authored-by: 齐家乐(26731624) <qijiale001@ke.com>
(cherry picked from commit be10697)
zuston pushed a commit to zuston/incubator-uniffle that referenced this pull request Jan 18, 2024
… of other services when misconfiguring the mounting directory (apache#1291)

### What changes were proposed in this pull request?

Only delete `rssdata` directory.

### Why are the changes needed?

Fix: apache#1290

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Tested in our cluster.

1. Mount `/data/hdfs1/rssdata1` dir for shuffle server,the server will create `/data/hdfs1/rssdata1/rssdata/`
2. Create files manually at host machine
```
touch /data/hdfs1/rssdata1/a.txt
touch /data/hdfs1/rssdata1/rssdata/b.txt
```
3. Update crd to terminate this shuffle server.
4. Without this pr, both `a.txt`, `b.txt` and `rssdata` dir are deleted
5. With this pr, only `b.txt` is deleted

Co-authored-by: 齐家乐(26731624) <qijiale001@ke.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants