Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalidated report should be archived #16594

Closed
tsteur opened this issue Oct 20, 2020 · 2 comments · Fixed by #16610
Closed

Invalidated report should be archived #16594

tsteur opened this issue Oct 20, 2020 · 2 comments · Fixed by #16610
Assignees
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Oct 20, 2020

@diosmosis I'm thinking there may be an issue around invalidation.

When executing eg CoreAdminHomeApi::getInstance()->invalidateArchivedReports($idsite =1, 'today', 'day', false, false); then it generates 4 entries in the archive invalidations table:
image

When I then run the CLI archiver, it only processes the first archive for the day. All other ones are ignored in usableArchiveExists because it found a usable archive for these periods.

image

This archive is invalidated though
image

and therefore it should reprocess the archive and not consider it as usable as such AFAIK.

In this case the invalidation was specifically requested and therefore it has to be reprocessed. FYI In my case in Matomo for WordPress I have these TTLs configured:

time_before_today_archive_considered_outdated = 1800
time_before_week_archive_considered_outdated = 3500
time_before_month_archive_considered_outdated = 7100
time_before_year_archive_considered_outdated = 14300
time_before_range_archive_considered_outdated = 3600

It is different when:

  • User tracks data for today
  • Thus Matomo stores a record to remember to invalidate a report
  • But an existing archive should actually only be invalidated after the configured TTL.
  • After the configured ttl of say 1800s after the report was archived last then it should actually invalidate the report
  • And then it should rearchive the report.

This I think works already.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Oct 20, 2020
@tsteur tsteur added this to the 4.0.0-RC milestone Oct 20, 2020
@diosmosis diosmosis self-assigned this Oct 26, 2020
@diosmosis
Copy link
Member

I'm currently testing this, but I noticed 'today'/'yesterday'/'now' etc. aren't allowed in CoreAdminHomeApi::getInstance()->invalidateArchivedReports() because of https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/CoreAdminHome/API.php#L329. Just an FYI, will change in a PR.

@tsteur
Copy link
Member Author

tsteur commented Oct 26, 2020

👍 I'm using today's date string in https://github.com/matomo-org/wp-matomo/blob/1.3.1/classes/WpMatomo/Admin/SystemReport.php#L95-L100 was more like to clarify that I'm using today's date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants