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

Don't browser archive when segment is set to be pre-processed #18123

Merged
merged 3 commits into from Oct 18, 2021
Merged

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Oct 10, 2021

Description:

While commenting on #17941 I noticed that a segment that is selected to be pre-processed would still be archived when it's viewed from browser even though it's set to be preprocessed. When a segment is selected to be pre-processed then it should be only processed during cron archiving no matter the if browser archiving for segments is available or not.

I'm meaning this setting:
image

When it's currently set to be pre-processed, it would be still archived during day time. Users confirm this makes Matomo slow!

The logic for whether archiving is enabled / disabled or not is currently where complicated IMO:

image

I'm thinking this new logic is more clear and less prone to side effects from when the shouldProcessReportsAllPlugins is shown.

image

Behaviour to be specified

There's also one other issue I noticed in the implementation. When setting archiving_range_force_on_browser_request=0 in config, then we were still archiving ranges in some cases. Like if browser archiving is enabled (as described in the config setting for it) or if the range is requested during CLI archiving. Not sure if that's on purpuse but I kept this logic.
image

Review

@tsteur tsteur marked this pull request as draft October 10, 2021 23:55
@tsteur
Copy link
Member Author

tsteur commented Oct 11, 2021

The tests don't seem to fail because of this change. @mattab can you maybe also have a look at the logic and if that makes sense to you?

@tsteur tsteur marked this pull request as ready for review October 11, 2021 00:47
@tsteur tsteur added the Needs Review PRs that need a code review label Oct 11, 2021
@tsteur tsteur added this to the 4.6.0 milestone Oct 11, 2021
@tsteur tsteur marked this pull request as draft October 11, 2021 00:48
@tsteur tsteur marked this pull request as ready for review October 11, 2021 00:50

// Always allow processing one report
if (!$isArchivingEnabled
&& (!self::isBrowserArchivingAvailableForSegments() || self::isSegmentPreProcessed($idSites, $segment))
Copy link
Member Author

Choose a reason for hiding this comment

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

fyi looking at other usages of isBrowserArchivingAvailableForSegments this change should be fine as in relevant places we already check for browser archiving available || segment pre processed

Copy link
Member

@sgiehl sgiehl left a comment

Choose a reason for hiding this comment

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

@tsteur had a look through the changes and logically it imho makes sense.
As all relevant tests still seem to pass I guess it would be fine to merge.

@tsteur tsteur merged commit a9baf0b into 4.x-dev Oct 18, 2021
@tsteur tsteur deleted the m17941_23 branch October 18, 2021 21:07
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants