We have configured Auto-Archiving to run every 60 minutes. On one of our sites, we are using 39 segments which are configured to be pre-processed in cron.
Starting 3 weeks ago, each week on Sunday night, the archiving job started to take 24h instead of 15 minutes - 2h as it takes in other days.
In logs I can see that the difference happens after the “Scheduler: executing task Piwik\Plugins\CoreAdminHome\Tasks.purgeOrphanedArchives” runs, which deletes data for the 15th of every month with data from the database, like:
Deleted 4620 rows in archive tables (numeric + blob) for deleted segments for 2018-01-15.
Deleted 1103 rows in archive tables (numeric + blob) for deleted segments for 2018-08-15."
The purgeOrphanedArchives task does this every week, with different number of rows each week.
I did not find any deleted segments in the database, nor do I know of segments that were deleted. I am not sure why the purging started.
After the purging, the next archiving re-processes all the segment reports - daily, weekly, monthly and yearly, last 2, which takes >20h.
Does anyone know why the some data is deleted and then fully re-processed for all the segments? Is there a way to stop this ? Is this normal matomo behavior ?