Please do not remove temp2 file before renaming final file if temp is a different location from final destination #4612
greg-fischer
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed in the logs that the chia removes the temp2 file before it renames the final plot file at the destination. This has been a minor problem and some plots have been lost when the destination disk is full. If we were to rename the final plot at before removing the temp2 file we would at least have a chance at salvaging all the work and we could manually copy to a new location. Maybe there's a reason chia needs to remove temp2 before renaming final plot? Seems like it would be better to reverse that.
Here's what I see in the logs.
`Copied final file from "/Volumes/chiatmp850/tmp850/plot-k32-2021-05-11-03-21-c3ee37ba7db41d4859a731eda8a4a945afe7cabad971c0b97c6fbe8203f65d26.plot.2.tmp" to "/Volumes/chia41/farm41/plot-k32-2021-05-11-03-21-c3ee37ba7db41d4859a731eda8a4a945afe7cabad971c0b97c6fbe8203f65d26.plot.2.tmp"
Removed temp2 file "/Volumes/chiatmp850/tmp850/plot-k32-2021-05-11-03-21-c3ee37ba7db41d4859a731eda8a4a945afe7cabad971c0b97c6fbe8203f65d26.plot.2.tmp"? 1
Renamed final file from "/Volumes/chia41/farm41/plot-k32-2021-05-11-03-21-c3ee37ba7db41d4859a731eda8a4a945afe7cabad971c0b97c6fbe8203f65d26.plot.2.tmp" to "/Volumes/chia41/farm41/plot-k32-2021-05-11-03-21-c3ee37ba7db41d4859a731eda8a4a945afe7cabad971c0b97c6fbe8203f65d26.plot"`
In the case above the destination was full and the file was only 8G is size. I'm not sure why it thinks it successfully copied the file. But in any case, if that final renaming happened before the removal of the temp2 we'd have a chance to recover the plot from the tmp file.
EDIT/Notes;
I'm just realizing that chia copied the file and thinks it's all good. Whether the file renamed or not probably doesn't matter since chia thinks it was a success, but it wasn't. So I suppose that's the real issue, chia would need to know if the final file is correct, maybe at least for a file size test?
Beta Was this translation helpful? Give feedback.
All reactions