[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Journal Cleanup and Journal Compactor (Repost)
clebert.suconic@jboss.com
do-not-reply at jboss.com
Wed Jun 24 16:46:41 EDT 2009
Since now I don't need the transaction summary any more (just number of records associated with the transaction at the currentFile), I will be able to move pending transactions. And for doing that I will need to keep all the transaction IDs and everything else.
For doing that, I will need to use temporary files, and rename them as you suggested.
- I will open a journal file with a temporary name. (Open here, means gets it from the cached files, or create a new one).
- As I read the journal files I add the valid records to the temporary file. (I will off course open new files as I fill the file).
- Add a temporary small file when I start renaming the files, and deleting the old files. and delete that file when I'm done.
The only issue I have now is allowing concurrent appends to the journal, as I'm compacting the files.
The problem is, when deleteing or updating a record, I don't know where the AddRecord is going to be located at. So, I don't know where to add the negative value to.
So, what I'm thinking as a solution is:
- During compacting, all Adds, updates and deletes are stored to the current-file, as we aways do.
- But instead of discounting POSFiles right away, I cache those IDs on a collection. When I'm done compacting I do a fast operation applying the reference counts accordingly.
- Case the server is interrupted during reload, the delete or update will take the original location of the record.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239872#4239872
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4239872
More information about the jboss-dev-forums
mailing list