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

archiving: look for all usable done flag types when checking for existing child periods #17304

Merged
merged 4 commits into from Mar 14, 2021

Conversation

diosmosis
Copy link
Member

Description:

When checking for child periods we can use when archiving there might be invalidated archives that could be used which we should also detect. This mostly affects sites that use the tracker and can have no visits, but day archives with data, and no other higher archives. To my knowledge this just includes sites imported from google.

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

@diosmosis diosmosis added Bug For errors / faults / flaws / inconsistencies etc. Needs Review PRs that need a code review labels Mar 4, 2021
@diosmosis diosmosis added this to the 4.3.0 milestone Mar 4, 2021
@@ -847,9 +847,10 @@ public function hasChildArchivesInPeriod($idSite, Period $period)
while ($date->isEarlier($period->getDateEnd()->addPeriod(1, 'month'))) {
$archiveTable = ArchiveTableCreator::getNumericTable($date);

$usableDoneFlags = [ArchiveWriter::DONE_OK, ArchiveWriter::DONE_INVALIDATED, ArchiveWriter::DONE_PARTIAL, ArchiveWriter::DONE_OK_TEMPORARY];
Copy link
Member

Choose a reason for hiding this comment

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

Using partial or temporary archives kind of makes sense for me, but why are we also using invalidated archives here?
Shouldn't the archiving be triggered for invalidated archives, that can be used then?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sgiehl they should normally be rearchived before this archive gets launched (ie, weeks before months), but in the specific case of the GoogleAnalyticsImporter they don't have to be, since the plugin does not allow rearchiving of days w/ imported data (to make sure the imported data doesn't disappear through user or programming error). So in this case the days that are invalidated get ignored. It might be a better solution in the future to disallow invalidating them entirely...

Copy link
Member

Choose a reason for hiding this comment

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

Might be good to add a small comment above the line then, so it's clear why we also use invalidated archives here. Just to prevent we remove it later by accident.

@sgiehl
Copy link
Member

sgiehl commented Mar 9, 2021

@diosmosis besides adding a comment to explain the behavior a bit, this one looks good to merge

@sgiehl sgiehl added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. and removed Needs Review PRs that need a code review labels Mar 9, 2021
@diosmosis diosmosis removed the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Mar 14, 2021
@diosmosis diosmosis merged commit c742236 into 4.x-dev Mar 14, 2021
@diosmosis diosmosis deleted the can-skip-optimization branch March 14, 2021 20:47
@mattab mattab changed the title look for all usable done flag types when checking for existing child periods archiving: look for all usable done flag types when checking for existing child periods May 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants