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

Only invalidate in past for segments that belong to the site … #16896

Merged
merged 2 commits into from Dec 8, 2020

Conversation

diosmosis
Copy link
Member

Description:

… and only process an invalidation if it is for a site + we can load the segment

Fixes #16892
FYI @tsteur

Review

  • Functional review done
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

… process an invalidation if it is for a site + we can load the segment
@diosmosis diosmosis added the Needs Review PRs that need a code review label Dec 7, 2020
@diosmosis diosmosis added this to the 4.0.3 milestone Dec 7, 2020
@diosmosis diosmosis added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Dec 7, 2020
@tsteur tsteur requested a review from sgiehl December 7, 2020 03:14
core/CronArchive/SegmentArchiving.php Outdated Show resolved Hide resolved
core/CronArchive/SegmentArchiving.php Outdated Show resolved Hide resolved
try {
$segmentObj = new Segment($segment['definition'], [$idSite]);
} catch (\Exception $ex) {
$this->logger->debug("Could not process segment {$segment['definition']} for site {$idSite}. Segment should not exist for the site, but does.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug message confuses me. Isn't an exception thrown when the segment does not exist?
Also this case shouldn't occur at all if the isSegmentForSite works correctly, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't occur, but if it does it would break archiving, and I didn't think that needed to happen. This is a sanity check.

@diosmosis
Copy link
Member Author

@tsteur @sgiehl merging this, any other changes I can make in a new PR

@diosmosis diosmosis merged commit 85e665e into 4.x-dev Dec 8, 2020
@diosmosis diosmosis deleted the segment-for-site branch December 8, 2020 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check only invalidations created for correct sites
2 participants