Fix ingested file and direcotry not being sync#5435
Fix ingested file and direcotry not being sync#5435yiwu-arbug wants to merge 10 commits intofacebook:masterfrom yiwu-arbug:sync_ingest
Conversation
Signed-off-by: Yi Wu <yiwu@pingcap.com>
Signed-off-by: Yi Wu <yiwu@pingcap.com>
|
@siying @riversand963 IMO this is a critical fix. PTAL. Thanks. @ajkr If you have suggestion for test that's welcome. Thanks as well. |
Signed-off-by: Yi Wu <yiwu@pingcap.com>
|
@riversand963 Do you have more comments? thanks! |
riversand963
left a comment
There was a problem hiding this comment.
Thanks @yiwu-arbug for the fix. I have taken a pass and left a few comments.
Signed-off-by: Yi Wu <yiwu@pingcap.com>
|
The AppVeyor error should have been fixed in master, and I believe it's irrelevant to this PR. |
|
@riversand963 sure, I'll add the test. |
Signed-off-by: Yi Wu <yiwu@pingcap.com>
|
@riversand963 test added. mind take another look? Thanks. |
Signed-off-by: Yi Wu <yiwu@pingcap.com>
|
I didn't notice I left some debug log and failing CI. Fixed. @riversand963 mind take another look? Thanks. |
|
@riversand963 kindly ping |
|
I think there is compilation error: |
Signed-off-by: Yi Wu <yiwu@pingcap.com>
|
sorry. fixed. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@riversand963 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
LGTM |
|
@riversand963 merged this pull request in 2730fe6. |
Summary: It it not safe to assume application had sync the SST file before ingest it into DB. Also the directory to put the ingested file needs to be fsync, otherwise the file can be lost. For integrity of RocksDB we need to sync the ingested file and directory before apply the change to manifest. Also syncing after writing global sequence when write_global_seqno=true was removed in facebook#4172. Adding it back. Fixes facebook#5287. Pull Request resolved: facebook#5435 Test Plan: Test ingest file with ldb command and observe fsync/fdatasync in strace output. Tried both move_files=true and move_files=false. https://gist.github.com/yiwu-arbug/650a4023f57979056d83485fa863bef9 More test suggestions are welcome. Differential Revision: D15941675 Pulled By: riversand963 fbshipit-source-id: 389533f3923065a96df2cdde23ff4724a1810d78
Summary:
It it not safe to assume application had sync the SST file before ingest it into DB. Also the directory to put the ingested file needs to be fsync, otherwise the file can be lost. For integrity of RocksDB we need to sync the ingested file and directory before apply the change to manifest.
Also syncing after writing global sequence when write_global_seqno=true was removed in #4172. Adding it back.
Fixes #5287.
Test Plan:
Test ingest file with ldb command and observe fsync/fdatasync in strace output. Tried both move_files=true and move_files=false.
https://gist.github.com/yiwu-arbug/650a4023f57979056d83485fa863bef9
More test suggestions are welcome.