Skiplist stuff

Bron Gondwana brong at fastmail.fm
Sun Nov 11 08:34:34 EST 2007


On Sun, Nov 11, 2007 at 02:31:45PM +1100, Bron Gondwana wrote:
> * the one buggy skiplist I actually still have a copy of, the "logstart"
>   value in the header is wrong, causing recovery to fail with only a few
>   of the records still reachable because it hits another INORDER record
>   rather than the ADD record and drops out.  I've got the monitoring
>   system set up to let me know if it finds any other skiplist errors and
>   take a copy of the offending file.

Ok, so attached is the patch that deals with this one particular
case and adds a bit more debugging as well.  It will log an ERROR
if it sees the case that would previously cause a total bailout.

NOTE - there's still heaps of "add this value read from file to
this mmap base pointer and dereference with impunity" scattered
through this code, which is the sort of accident waiting to happen
I've been trying to remove from everything else along with the
CRC32 stuff I keep promising.

I also wrote a much bigger patch which you don't get to see yet
because someone might be silly enough to try and use it.  It does
some variable renaming, refactoring, etc.

At least there's some signed vs unsigned fuzziness I'm still not
happy with here, and a naming policy that made it clearer when
a variable contained network-byte-order and when it contained
host-byte-order would be peachy too.  My big patch does that.
Sadly it also infinite loops during recovery, which suggests I
did something pretty stupid in it somewhere!  Too late to debug
that tonight.


Anyway - here it is.  A "recovery()" that copes if the logstart
parameter in the database header is wrong.  No, I don't have a
clue how that happened unless lseek() lied.  Maybe it sometimes
lies, I don't know.  I'll be writing a test case for that soon
too!

Bron.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus-skiplist-debug-2.3.10.diff
Type: text/x-diff
Size: 1547 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20071112/00c40619/attachment.bin 


More information about the Info-cyrus mailing list