Issue
When trying to migrate large archive, e.g. journal archive, routing may hang after 100k of routed items.
Explanation
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.

SQL:
--DIRECTORY DB
SELECT * FROM ContainerContentOperations WHERE ContainerId = @containerId
SELECT * FROM ContainerMappingContentOperations cmco WHERE cmco.ContainerMappingId = @containerMapping
--ITEM DB
SELECT COUNT(Item.ItemId)
FROM Item
WHERE ContainerId = @containerId
AND DeletedDateUtc IS NULL
SELECT COUNT(Item.ItemId)
FROM Item
WHERE ContainerId = @containerId
AND DeletedDateUtc IS NULL
AND ContainerMappingId = @mappingId
AND ArchivedDateUtc < @ArchivedDateUtcvalue1 AND ArchivedDateUtc >= @ArchivedDateUtcvalue2
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

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.
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.
Solution
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
Once LastFullCollectionStartedDateUtc and LastFullCollectionDateUtc are missing triggering routing manually in table ContainerMappingContentOperations by setting RunRoutingNow for specific mapping won´t work.

Print Friendly, PDF & Email