00543: Commiting a change when disk is full loses data
Description: When the disk was full, a user tried to update a page, and as a result the page was truncated to a size of 0 and <Group>.RecentChanges and <Group>.AllRecentChanges were also truncated to a size of 0.
Reproducibility: Unknown
Steps to reproduce: 1) Fill up hd 2) Try editing a page and submitting changes
We luckily had a backup of the server data, but it might be a good idea (for in the future) to allow some kind of revision system to handle page changes, at least as an option for people who want extra assurance that nothing will be lost.
Contact: jeremy_AT_1stplayable_DOT_com
There almost has to be something else going on here -- PmWiki already does lots of checks to make sure that pages aren't truncated by disk full errors:
- When saving a page, the new data is saved to a page file with a ",new" extension. The existing page file is not replaced until the ,new file has been written successfully.
- Every open, write, and close operation is checked for an error; if any errors occur while writing the ,new file, then the existing file is left alone.
- Since beta37, after the ,new page file has been written and closed, PmWiki checks that its filesize is at least 95% of the expected size; if not, then the original page file is not replaced.
While I can imagine that the ,new file was created with zero bytes (there are some PHP and OS installations that do not correctly report write errors), I don't see how it's possible for the file to have gotten past the filesize check from #3 above. So, there must be something else happening here.
- Are you certain that you're running beta38?
- Can you send me a copy of your pmwiki.php and/or index.php file so I can look at them?
Thanks!
Pm