SA Bugzilla – Bug 1888
Bayes db v2 will not expire
Last modified: 2003-05-10 09:29:43 UTC
On converting from v1 to v2 db, I have over 185000 tokens, so tried to manually expire. This failed with illegal divide by zero on line 516 of BayesStore.pm. This is because $magic[9] is 0. In line 502, there is a test which only sets $newdelta is $magic[9] > 0, which indicates that 0 is an acceptable value for this token.
doh! yeah, 0 is a valid number. it shouldn't happen in actual usage after an expire has run, but it's definately the value until the first expire runs. I've added check to make sure that the value is greater than 0. This will make the $ratio variable == 0 which is fine. It's used to figure out if the last expire count and the current goal expire count are wildly different (ie: the last expire expired 100k tokens, but now we want to expire 20k tokens). If they're different enough (>50%) the expire system will figure there was a wierd surge and it should recompute the appropriate expiry atime. fix committed. :) I also found a few other bugs that I fixed as well.