When trying to migrate large archive, e.g. journal archive, routing may hang after 100k of routed items.
Below SQL queries can help to investigate this specific issue. Especially missing dates LastFullCollectionStartedDateUtc and LastFullCollectionDateUtc in table [ContainerContentOperations].
If those fields are missing routing cannot continue. LastFullCollectionStartedDateUtc is filled in case we do not have any checkpoint id for the container. It is filled within the first item collection and it doesn’t make difference if the first Item collection was Full or Delta. This value is never erased in our code.
SQL Queries:
--For AS DIRECTORY DB
SELECT * FROM ContainerContentOperations WHERE ContainerId = @containerId
SELECT * FROM ContainerMappingContentOperations cmco WHERE cmco.ContainerMappingId = @containerMapping
--For AS ITEM DB
SELECT COUNT(Item.ItemId)
FROM Item
WHERE ContainerId = @containerId
AND DeletedDateUtc IS NULL
SELECT ContainerMappingId, ISNULL(SUM(RoutedCount), 0) as RoutedCount, ISNULL(SUM(CASE WHEN RoutedSizeCompressed > RoutedSizeOriginal THEN RoutedSizeCompressed ELSE RoutedSizeOriginal END), 0) as RoutedSizeOriginal FROM ItemRoutingStatistics WHERE ContainerMappingId IN (@mappingId0) GROUP BY ContainerMappingId
LastFullCollectionDateUtc is filled only when collection finished. It doesn’t matter if Full or Delta. The restart of the module could affect logic here, but also during restart, we have checkpoint id filled, so after restart collection continues from this checkpoint and sometimes in the future will finish and update this value.
There are 2 solutions:
1. Run Item collection again for affected containers. This will fill values, but because the archive is large, e.g. more than 100 million items, it can take ages.
2. Update this value manually. Basically, the time can be for example today at midnight if the collection was really done.
Note:
If LastFullCollectionStartedDateUtc and LastFullCollectionDateUtc are missing, manually triggering routing by setting RunRoutingNow for a specific mapping in the [ContainerMappingContentOperations] table will not work.