[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Sweet life on the journal...

clebert.suconic@jboss.com do-not-reply at jboss.com
Wed Jul 16 13:57:29 EDT 2008


anonymous wrote : Question: on the record sequence number - how can you be sure on old sequence number from a reclaimed file doesn't by chance match the correct sequence number - in this case you wouldn't be able to detect failure right?

Also... at the end of every record I'm also writing the used size, to validate the "health" of the record.

A record to be considered healthy needs the record type between 10 and 19, the currentFileId at the second Position to match the currentFileId being used (to validate it was not from a previous usage) and the checkSize at the end matching to the exact number of bytes written. This is also an extra check for APPEND and Update records.

If those conditions are not met, the record is considered broken, and I keep moving byte by byte on the journal file till I can find another byte between 10 and 19 where all the above conditions are met.

One possibility: We could "maybe" replace the checkSize by a hash calculation over the byte array content. That would eliminate any small possibility of coincidences like messages being magically created by crashed files. 

And BTW: One thing I was wondering.. just fixing terminology. From now on.. I will say Reload to reading the journal files back to memory. And I will keep the word Recovery for the transaction only.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4164822#4164822

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4164822



More information about the jboss-dev-forums mailing list