Allow invalidating non-day periods even if the period is for a date that had logs purged #17530
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
When invalidating data, we check for dates that are before the configured log data deletion month count, and ignore them. This is a safety mechanism to make sure we do not invalidate day periods that have archive data, but for whom log data was deleted. This safety mechanism, however, breaks the GoogleAnalyticsImporter, when importing data that is before log data deletion threshold.
The importer imports day periods, then invalidates week periods and above to calculate the rest. If the data is before the log deletion threshold, the higher periods are never recomputed.
Fixed in this PR by only applying the check for day periods. If a week period is invalidated and there is no log data, the day periods should used.
TODO: check if week periods will trigger rearchiving of the day if the day is for some reason invalidated.
FYI @tsteur
Review