You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Andrew Wasilczuk <an...@netdev.co.uk> on 2010/09/16 13:12:53 UTC

KahaDB, detecting corrupt index file

Hi there,

I have a shared file system master-slave setup and I'm currently
testing how KahaDB handles corruption (it's important since it's a
single point of failure).  

In one of the tests I corrupt the index file while the broker is running
(there are a few pending messages in a test queue):

dd if=/dev/random of=/var/lib/activemq/data/kahadb/db.data bs=512 count=20

While the broker is running everything seems to work fine.  I can
connect a consumer and receive the pending messages.  I guess this is
because the index is cached in the memory.

However, if I restart the broker after corrupting the index file, the
persisted message counter will show 0 and I'm unable to consume the
pending messages.  There's nothing in the logs that would indicate a
problem.

When I rebuild the index (stop broker, remove db.data, start broker) the
old messages re-appear.  This is cool, but I have no way of telling when
the index needs recovering if this happens on a real life system.

Is there a way to detect a corrupt index on startup?  Something like
checkForCorruptJournalFiles but for the index?  


Many thanks,

Andrew.
-- 
[ Andrew Wasilczuk   | Service Support Engineer ]
[ NetDev Limited     | http://netdev.co.uk/     ]