0 Replies Latest reply on Mar 20, 2012 2:03 PM by rahook

    Extract data from journal/paging files?

    rahook

      Ok, I've spent quite some time today digging over the documentation and forums, and can't see if this is a use case that has been dealt with, so hopefully the combined wisdom can shake something loose.

       

      With respect to https://community.jboss.org/thread/171992 let me get the obvious questions out of the way first - yes, I know we should have hornetq and jboss configured for high availability and we should not have gotten into this mess. But we don't (yet), and are left with a bunch of data that I very (very) much want to recover. Let's just posit that I'm a donkey, and move onto the second part.

       

      The issue is that we've got a bunch of journal and page files that hornetq believes are broken - recovering the files into a hornetq instance inside JBoss 6.1.0 results in Hornetq getting very upset as it starts up

       

      14:34:26,893 SEVERE [HornetQServerImpl] Failure in initialisation: java.lang.NullPointerException

                at org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl.getPageInfo(PageSubscriptionImpl.java:726) [:6.1.0.Final]

                at org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl.getPageInfo(PageSubscriptionImpl.java:712) [:6.1.0.Final]

                at org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl.processReload(PageSubscriptionImpl.java:655) [:6.1.0.Final]

                at org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl.processReload(PageCursorProviderImpl.java:241) [:6.1.0.Final]

                at org.hornetq.core.paging.impl.PagingStoreImpl.processReload(PagingStoreImpl.java:355) [:6.1.0.Final]

                at org.hornetq.core.paging.impl.PagingManagerImpl.processReload(PagingManagerImpl.java:250) [:6.1.0.Final]

       

      and as a result we cannot get at the data that's in those journal and page files.

       

      We know exactly the format of the objects that were placed on the queue - luckily for us they are trivial java HashMap<String, String> instances - so it seems likely that if were possible to just pop the files open and rip the raw data out of them we could recover that data back out into HashMaps and thus recover it back into our system.

       

      I have used the PrintData/PrintPages classes to be able to dump information about the files, and the export utility described in 15.7 of the user manual (http://docs.jboss.org/hornetq/2.2.5.Final/user-manual/en/html_single/index.html#persistence.importexport), and all three tools have cheerfully read the files, so they are sufficiently well formed to at least examine them.

       

      And of course I do have the HornetQ source, so I guess it's more or less feasible for me to grok that code and build something to read the files and get the data out... but I'm really hoping that somebody will say "sure, there's an existing easy way to rip the data out".

       

      As an aside, it's not entirely clear how our queue data got messed up to start with. It looks from our JBoss logs as though parts of JBoss were partially shut down, and partially restarted, before the instance was summarily killed with a SIGKILL (-9). The next server start then reported the HornetQ error. I'm guessing that there's a data inconsistency between the journal and paging files as a result of the forced halt of the processes. Suffice to say that I will be strongly discouraging people from SIGKILLing the production server...