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

etcdserver: remove temp files in snap dir when etcdserver starting #12846

Merged
merged 1 commit into from
Apr 17, 2021
Merged

etcdserver: remove temp files in snap dir when etcdserver starting #12846

merged 1 commit into from
Apr 17, 2021

Conversation

pyiyun
Copy link
Contributor

@pyiyun pyiyun commented Apr 9, 2021

When etcd exits abnormally, tmp files will remain in snap dir, so clean up tmp files in snap dir when etcdserver starting.

Fixes #12837

server/etcdserver/server.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Apr 15, 2021

Codecov Report

Merging #12846 (8f3d20d) into master (bad0b4d) will decrease coverage by 18.19%.
The diff coverage is 33.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #12846       +/-   ##
===========================================
- Coverage   63.74%   45.54%   -18.20%     
===========================================
  Files         407      348       -59     
  Lines       33241    29154     -4087     
===========================================
- Hits        21190    13279     -7911     
- Misses       9990    14215     +4225     
+ Partials     2061     1660      -401     
Flag Coverage Δ
all 45.54% <33.33%> (-18.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/etcdserver/server.go 59.06% <33.33%> (-15.40%) ⬇️
client/pkg/v3/types/id.go 0.00% <0.00%> (-100.00%) ⬇️
client/v3/ordering/util.go 0.00% <0.00%> (-100.00%) ⬇️
client/pkg/v3/logutil/zap.go 0.00% <0.00%> (-100.00%) ⬇️
client/pkg/v3/fileutil/dir_unix.go 0.00% <0.00%> (-100.00%) ⬇️
client/pkg/v3/fileutil/sync_linux.go 0.00% <0.00%> (-100.00%) ⬇️
client/v3/naming/endpoints/endpoints.go 0.00% <0.00%> (-100.00%) ⬇️
client/pkg/v3/transport/timeout_dialer.go 0.00% <0.00%> (-100.00%) ⬇️
...ver/proxy/grpcproxy/adapter/lock_client_adapter.go 0.00% <0.00%> (-100.00%) ⬇️
client/v3/leasing/util.go 0.00% <0.00%> (-98.04%) ⬇️
... and 231 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 bad0b4d...8f3d20d. Read the comment docs.

server/etcdserver/server.go Outdated Show resolved Hide resolved
client/pkg/fileutil/fileutil_test.go Outdated Show resolved Hide resolved
client/pkg/fileutil/fileutil_test.go Outdated Show resolved Hide resolved
client/pkg/fileutil/fileutil.go Outdated Show resolved Hide resolved
client/pkg/fileutil/fileutil.go Outdated Show resolved Hide resolved
When etcd exits abnormally, tmp files will remain in snap dir, so clean up tmp files in snap dir when etcdserver starting.

Fixes #12837
Copy link
Contributor

@ptabor ptabor left a comment

Choose a reason for hiding this comment

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

Thank you !

@ptabor ptabor added this to the etcd-v3.5 milestone Apr 17, 2021
@ptabor ptabor merged commit 06ba0fc into etcd-io:master Apr 17, 2021
@pyiyun pyiyun deleted the fix-snaptmpfile-bug branch April 20, 2021 11:38
@ahrtr ahrtr mentioned this pull request Jul 19, 2022
25 tasks
@ahrtr
Copy link
Member

ahrtr commented Jul 19, 2022

@pyiyun can you please backport this PR to 3.4? FYI. #14232

vivekpatani added a commit to vivekpatani/etcd that referenced this pull request Jul 20, 2022
vivekpatani added a commit to vivekpatani/etcd that referenced this pull request Jul 20, 2022
- Backporting: etcd-io#12846
- Reference: etcd-io#14232

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
vivekpatani added a commit to vivekpatani/etcd that referenced this pull request Jul 20, 2022
- Backporting: etcd-io#12846
- Reference: etcd-io#14232

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
vivekpatani added a commit to vivekpatani/etcd that referenced this pull request Jul 20, 2022
- Backporting: etcd-io#12846
- Reference: etcd-io#14232

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
vivekpatani added a commit to vivekpatani/etcd that referenced this pull request Jul 21, 2022
- Backporting: etcd-io#12846
- Reference: etcd-io#14232

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
tjungblu pushed a commit to tjungblu/etcd that referenced this pull request Sep 8, 2022
- Backporting: etcd-io#12846
- Reference: etcd-io#14232

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

a lot of tmp file in snap dir as a result of etcd restart
5 participants