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

(fix) use atomic move to avoid file corruption #745

Merged
merged 1 commit into from
Dec 21, 2021
Merged

(fix) use atomic move to avoid file corruption #745

merged 1 commit into from
Dec 21, 2021

Conversation

yuyang0423
Copy link
Contributor

Motivation:

fix #604 , after few month test it's works fine.
RCA: temporary kv.zip isn't sync to disk when finished append meta in archive, should use atomic move than rename

@yuyang0423 yuyang0423 changed the title use atomic move to avoid file corruption (fix) use atomic move to avoid file corruption Dec 17, 2021
@sofastack-bot sofastack-bot bot added bug Something isn't working cla:no labels Dec 17, 2021
@killme2008
Copy link
Contributor

@yuyang0423 Please sign the CLA

@killme2008
Copy link
Contributor

LGTM

@yuyang0423
Copy link
Contributor Author

@yuyang0423 Please sign the CLA

@yuyang0423 Please sign the CLA

Sorry, already signed, How can I trigger another build??

@killme2008 killme2008 closed this Dec 20, 2021
@killme2008 killme2008 reopened this Dec 20, 2021
@sofastack-bot
Copy link

sofastack-bot bot commented Dec 20, 2021

Hi @yuyang0423, welcome to SOFAStack community, Please sign Contributor License Agreement!

After you signed CLA, we will automatically sync the status of this pull request in 3 minutes.

@killme2008
Copy link
Contributor

@yuyang0423 你重新 sign 试下,显示还是没有

@yuyang0423 yuyang0423 closed this Dec 20, 2021
@yuyang0423 yuyang0423 reopened this Dec 20, 2021
@yuyang0423
Copy link
Contributor Author

yuyang0423 commented Dec 20, 2021

@yuyang0423 你重新 sign 试下,显示还是没有

这下好像可以了,我们认为这个issue比较紧急,请确认一下如下情况,主要往archive插入 meta 前是sync 的, 插入meta之后因为修改过了, 并没有sync,之前的rename 把temp zip转成final zip之后,等于是没有sync 的文件成了唯一文件,因为原kv.zip已经删除了,新的kv.zip实际是没有落盘,这个时候crash 的话,重新解压文件就不一致了。

@killme2008
Copy link
Contributor

@fengjiachun 可以看下,我觉的可以合并

Copy link
Contributor

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

@fengjiachun
Copy link
Contributor

Thank you @yuyang0423

@fengjiachun fengjiachun merged commit 1a9df32 into sofastack:master Dec 21, 2021
@yuyang0423 yuyang0423 deleted the yy_enhance_rename branch December 21, 2021 08:06
@fengjiachun fengjiachun mentioned this pull request Mar 17, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla:no cla:yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RheaKV snapshot inconsistent if node panic during compress save.
3 participants