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

Task to purge archives for deleted websites and segments #14317

Merged
merged 14 commits into from May 3, 2019
Merged

Conversation

katebutler
Copy link

Fixes #13966

@diosmosis
Copy link
Member

Left a couple minor comments, otherwise looks good to merge.

@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 Apr 7, 2019
@diosmosis diosmosis added this to the 3.10.0 milestone Apr 7, 2019
Copy link
Member

@tsteur tsteur left a comment

Choose a reason for hiding this comment

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

@katebutler left a few comments. Nothing major. Looks really good in general and be so good to have this feature 👍

core/DataAccess/Model.php Outdated Show resolved Hide resolved
core/DataAccess/Model.php Show resolved Hide resolved
plugins/CoreAdminHome/Tasks.php Outdated Show resolved Hide resolved
plugins/CoreAdminHome/Tasks.php Outdated Show resolved Hide resolved
plugins/CoreAdminHome/Tasks.php Outdated Show resolved Hide resolved
. ' AND ts_archived < ?'
. ' AND NOT (' . $isValidSegmentSql . ')';

$rows = Db::fetchAll($sql, array($oldestToKeep));
Copy link
Member

Choose a reason for hiding this comment

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

Just fyi in case someone wants to have a look at the query it generates... in my case it created a query like this (seems to look good):

SELECT idarchive FROM piwik_archive_numeric_2019_01 WHERE name LIKE "done%" AND name != "done" AND ts_archived < ? AND NOT 

((idsite = 1 AND (name LIKE "done11f27b46b44cf35a9ecc9bd3661022c3%" OR name LIKE "done3c6cd97084beb5acf44c03c8c2d90240%" OR name LIKE "done348b89787ca833d7b9c71a2583dabe2c%" OR name LIKE "done7c4db1e772ea091d315d3f86355f4644%" OR name LIKE "done1f151d88667d0493ef083fda0c75e399%" OR name LIKE "donebc7b3e3d298d188ed02841af5ede7e0e%" OR name LIKE "donec561c80c35c1196d4cec668c0730ce66%" OR name LIKE "done48b4361e2888dac452de11a8db8da931%" OR name LIKE "doned1c4f52a073c440a5111b50a1cf8f7fb%" OR name LIKE "done13328b096b251986da98c131fb703fba%" OR name LIKE "done5df82b31b7a978e326be3562b098e992%" OR name LIKE "done563819b40691e8fd5db123e2be3e7c07%" OR name LIKE "done598457137b9cbd5d5bb9f990d81e427f%" OR name LIKE "done4578744398d6a1ac38bb7532c75cc989%" OR name LIKE "donee9e48ac3f41fd5615137e0761fdc5c90%" OR name LIKE "done4d6ceb7591330b316782ef6bd1d2a080%" OR name LIKE "donecfb79a09244730090623e6c7227e8387%" OR name LIKE "doneddccaa229c48150e2920c7fe376c9f11%" OR name LIKE "done05c9661bc29fd4667b97e5e6e5a51a86%" OR name LIKE "done38ac1901cc3e433ad551f6544a1cc7a2%" OR name LIKE "done34207c7198689e9bdba534de32094f40%" OR name LIKE "done9e6275849e64cfa8a5376a7112b47a45%" OR name LIKE "done4e816a3d7169f9c3d20d2c5c7df1248d%" OR name LIKE "done12685caa4f74f8ecb62bcbeabde3b936%" OR name LIKE "done6fb490cfce17323e01f4d11d61ea9679%" OR name LIKE "donee42f13629073b12be80cc376a0040c14%" OR name LIKE "done642a27678c886639439fc1b922ac1af0%" OR name LIKE "done567bde329b39232dbf63690ed85394b8%" OR name LIKE "done86bcf168b0e43cfc46c5d1e68a6aaf62%" OR name LIKE "done43b771d91cfa18d12ccdf766ab1e3235%" OR name LIKE "donea8836c71226531af4e4298bae1dd5997%" OR name LIKE "done870df59630c7ed4e74b8584a0d72609b%" OR name LIKE "done5de5753680cae0cc8c26e6db6f2a8fc4%" OR name LIKE "donef3301aa5b40ba36bf5c7659294900f42%" OR name LIKE "done35ec2319cc96284b002c3b661add6e1f%")) OR (idsite = 14 AND (name LIKE "donefa4159eaae7296c3a8beea04da0642f7%")) 

OR (name LIKE "done1432586f23a19c5db5a3c03e06cbb55f%") OR (idsite = 99 AND (name LIKE "done56e6bad0310dad6bbbf1dad1db2cf096%")))

plugins/CoreAdminHome/Tasks.php Show resolved Hide resolved
@tsteur tsteur merged commit b000144 into 3.x-dev May 3, 2019
@tsteur tsteur deleted the 13966 branch May 3, 2019 00:34
@tsteur
Copy link
Member

tsteur commented May 3, 2019

Well done @katebutler 👍

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check that when a website (or a segment) is deleted, we also delete all archive data (numeric, blob)
3 participants