Using Log Files to Determine What Happens During Process Recovery
Sometimes when Data Hub is doing a load, compose, or publication process and Data Hub server, application, or supporting services fail, the process is interrupted. However, Data Hub recovers from this interruption automatically by restarting these processes. If you want to know what is happening during a process recovery, read the following information to find out how.
Go to /opt/datahub/config. There is a file there called logback.xml. The file contains the logging configuration for Data Hub. If you want to capture all the information Data Hub generates during a load or compose or publication process recovery, do the following. Change the logger setting for com.hybris.datahub from debug to info.
The following logger output demonstrates what Data Hub logs when recovering from an interrupted composition process.
At the beginning of the log listing, you can see Data Hub and Tomcat completing their restart after processing was interrupted. Data Hub then cleans up composition action 502, which was interrupted. From there, following the chain of events down to the restart of the composition action and the processing of the first 1000 items is pretty straightforward.
Nov 11, 2016 6:45:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 11, 2016 6:45:30 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Nov 11, 2016 6:45:30 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 58101 ms
2016-11-11 06:45:41,348 [INFO] [c.h.d.s.i.DefaultCanonicalItemDecompositionService] Deleting canonical - raw item cross reference deletion for composition action 502.
2016-11-11 06:45:42,363 [DEBUG] [c.h.d.s.i.DefaultCanonicalItemDecompositionService] Deleted 42000 canonical - raw item cross references.
2016-11-11 06:45:42,363 [INFO] [c.h.d.s.i.DefaultCanonicalItemDecompositionService] Deleting canonical items for composition action 502.
2016-11-11 06:45:47,420 [DEBUG] [c.h.d.s.i.DefaultCanonicalItemDecompositionService] Resetting composition action 502 to PENDING.
2016-11-11 06:45:47,669 [DEBUG] [c.h.d.l.i.i.InProgressCompositionsRestartHandler] In Progress Composition Recovery completed in 21666 ms.
2016-11-11 06:45:47,673 [DEBUG] [c.h.d.c.i.DefaultAutoCompositionDecisionStrategy] Querying for Raw Items in pool GLOBAL remaining in PENDING state.
2016-11-11 06:45:48,658 [INFO] [c.h.d.l.i.i.PoolActionRestartHandler] Adding CompositionActionEntity{id=502, status=PENDING, pool=DataHubPoolEntity{id=0, name=GLOBAL}} to the processing queue
2016-11-11 06:45:48,661 [INFO] [c.h.d.l.i.DefaultInitializationService] **************************
2016-11-11 06:45:48,661 [INFO] [c.h.d.l.i.DefaultInitializationService] * Ending Integrity Check *
2016-11-11 06:45:48,661 [INFO] [c.h.d.l.i.DefaultInitializationService] **************************
2016-11-11 06:45:48,663 [DEBUG] [c.h.d.s.i.DefaultEventPublicationService] Publishing data hub event : com.hybris.datahub.api.event.DataHubInitializationCompletedEvent@75657054
2016-11-11 06:45:48,669 [INFO] [c.h.d.e.DataHubEssentialDataListener] Executing the data initialization
2016-11-11 06:45:48,674 [DEBUG] [c.h.d.p.i.DefaultProcessMonitor] Registered Composition #502: 1 processes running
2016-11-11 06:45:48,677 [DEBUG] [c.h.d.s.i.DefaultEventPublicationService] Publishing data hub event : CompositionStartedEvent{actionId=502}
2016-11-11 06:45:49,559 [DEBUG] [c.h.d.s.i.DefaultRawTypeComposerService] 1000 items found for composition of type RawProduct
2016-11-11 06:45:49,738 [DEBUG] [c.h.d.c.i.CompositionChainRunnerStrategy] Integration Key generation for canonical item CanonicalItem{id='null', integrationKey='null', status=ERROR, dataPool='DataHubPoolEntity{id=0, name=GLOBAL}', fields='{identifier=null, product=900992770, size=null, styleDescription=null, style=null, SKU=null}'} failed.