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

Remove temporary archive concept and just invalidate on tracking. #14639

Merged
merged 8 commits into from Aug 6, 2019

Conversation

diosmosis
Copy link
Member

CC @tsteur

Seems like it works fine, tested manually. Automated tests shouldn't pass just yet, will work on that soon.

Refs #14091

@diosmosis diosmosis added the Needs Review PRs that need a code review label Jul 6, 2019
@diosmosis diosmosis added this to the 3.11.0 milestone Jul 6, 2019
$selector = new SegmentSelectorControl();
$out .= $selector->render();
} catch (\Exception $ex) {
print $ex->getTraceAsString()."\n";
Copy link
Member

Choose a reason for hiding this comment

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

guess would be better to log the error instead of printing it...

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry, that's was for debugging something else, accidentally committed it

Copy link
Member

Choose a reason for hiding this comment

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

btw this still needs to be removed right?

Copy link
Member

Choose a reason for hiding this comment

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

@diosmosis this still needs to be removed, be good to not forget.

@diosmosis
Copy link
Member Author

diosmosis commented Jul 8, 2019

NOTE: this will require a change to CustomReports. Actually I'll edit to maintain BC.

@tsteur
Copy link
Member

tsteur commented Jul 11, 2019

@diosmosis sounds good to change custom reports as long as we can still support previous Matomo versions as well.

@diosmosis
Copy link
Member Author

@tsteur changes should be BC now. However, I noticed AbTesting does some stuff w/ ArchiveWriter that includes a temporary archive (in GetMetricsOverview.php). Will this be a problem? Not sure what the code does.

{
$bindSQL = array($idSite,
$dateStartIso,
$dateEndIso,
$period,
);

$timeStampWhere = '';
Copy link
Member

Choose a reason for hiding this comment

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

@diosmosis do we maybe need an update script to get rid of all temporary archives? Maybe some temporary archives would need to be converted to a completed archive? (not sure if that's an issue but wondering if it's possible that we were sometimes reading a temporary archive because for some reason no completed archive was created)

Copy link
Member Author

Choose a reason for hiding this comment

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

This code should still look for temporary archives in addition to done archives (whichever is latest), so it shouldn't be necessary to do it now. I could add the update though.

@tsteur
Copy link
Member

tsteur commented Jul 14, 2019

Looks promising so far @diosmosis . Should we maybe merge this with PR #14091 as we maybe still need the changes in CronArchive?

@diosmosis
Copy link
Member Author

diosmosis commented Jul 16, 2019

Should we maybe merge this with PR #14091 as we maybe still need the changes in CronArchive?

@tsteur I'm not sure that PR as it is done is even needed anymore... If we only run archiving for invalidated/missing archives, then we don't even have to check for visits in log_visit. So instead of every other check, just see if there is an idarchive w/ DONE_OK for the site/period/segment/etc., and if not send the request. Otherwise, skip it. What do you think? Since we invalidate on tracking, I think this should work, ie, if there are no visits, the archive won't be invalidated.

@tsteur
Copy link
Member

tsteur commented Jul 16, 2019

I meant eg in CronArchiving, before issuing an archive request in $cronArchiver->request($url) or so, we need to check if we actually need to archive any data. This will safe a lot of time / performance in the archiver. Eg if data has been invalidated recently, we will need to issue the request... if a completed archive is there, and no data has been invalidated, then we don't need to issue the archiving request.

@diosmosis
Copy link
Member Author

@tsteur Yes that's what I meant, but the previous PR checks if there are visits in log_visit. Here I'm suggesting just to check if there's an existing archive w/ value = DONE_OK. Which might be what you're suggesting as well? The plan was to do that in another PR.

@tsteur
Copy link
Member

tsteur commented Jul 16, 2019

Sounds good to do this in another plan, I'll review the PR again later this week then. 👍 Looks good so far though had a look already a few times.

@@ -45,7 +45,7 @@ private static function getModel()
return new Model();
}

public static function getArchiveIdAndVisits(ArchiveProcessor\Parameters $params, $minDatetimeArchiveProcessedUTC)
public static function getArchiveIdAndVisits(ArchiveProcessor\Parameters $params)
Copy link
Member

Choose a reason for hiding this comment

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

@diosmosis some usages still seem to pass two parameters here, eg Advertising, CustomReports, SearchEngineKeywordsPerformance, ... might be better to still keep the 2nd parameter but simply not use it. Otherwise it could break things and lead to notices etc. In Matomo 4 we got remove the 2nd parameter

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

$selector = new SegmentSelectorControl();
$out .= $selector->render();
} catch (\Exception $ex) {
print $ex->getTraceAsString()."\n";
Copy link
Member

Choose a reason for hiding this comment

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

@diosmosis this still needs to be removed, be good to not forget.

@tsteur
Copy link
Member

tsteur commented Jul 17, 2019

@diosmosis can you look at the 2 failing tests https://travis-ci.org/matomo-org/matomo/jobs/557621873#L829-L844 ? otherwise looks good to merge and work on the CronArchiver in another PR.

Also left a comment where we possibly break the API and need to put back a parameter. One print debug is also there, otherwise feel free to merge once these things are done .

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

4 participants