[pmwiki-users] Questions on release 2.0.0 (PageStore class)
Patrick R. Michaud
pmichaud at pobox.com
Fri Sep 2 15:58:18 CDT 2005
On Fri, Sep 02, 2005 at 04:29:57PM -0400, Radu wrote:
> When calculating risk, it has to be compounded by the amount of loss
> possible in the worst case scenario. I lost several documentation
> hours that way. So I suggest that if you decide to comment that line
> out in the core, you at least make it a configuration option for us
> people on fickle servers.
We have to be careful here -- it's not immediately clear what
such a configuration option would look like.
Put another way, what percentage of the uncompressed file size
would be considered sufficient to assume that the entire file was
Just to provide some statistics, I did a test compression on the
wiki.d/ files on pmwiki.org, and many of the files had 90-95%
compression results. So, the resulting line in the gzpagestore
would have to look something like
$s = $s && (filesize("$pagefile,new") > $sz * 0.05);
which says that as long as the size of the saved (compressed) file
is at least 5% of the uncompressed total, then it's considered
good. That doesn't seem like a test with much accuracy (false
negatives), since it's also very possible that the file didn't
compress well and truncated to a size larger than 5% of the original.
And any pages that managed to compress better than 95% would always
be treated as "not saved".
So it seems to me that in order for gzpagestore to provide this
level of reliability, it would have to re-read and uncompress the file
that was just written to check its contents and length. That sort
of check could probably be provided by default, or as an option.
> At 02:01 PM 9/2/2005, Patrick R. Michaud wrote:
> >Of course, this filesize check won't really work for gzipped files,
> >since they typically compress to far less than 95% of the original
> >size. So, commenting it out is probably the right approach. However,
> >it also means that anyone who ends up on a system that doesn't
> >correctly report disk write errors will be at a small risk of losing
More information about the pmwiki-users