Page MenuHomeIn-Portal Phabricator

INP-1760 Don't attempt to change "CachedUrls" table for units, that are not used in Mod-Rewrite URLs
ClosedPublic

Authored by erik on Jan 11 2019, 5:27 AM.

Details

Summary

Limited cached url deleting operations.

Test Plan

With Memcache enabled

  1. Delete all records from CachedUrls table
  2. Visit Privacy Policy page on front-end
  3. Confirm that record for Privacy Policy is created in the CachedUrls table
  4. Go to adm.console, ConfigurationWebsiteScheduled Tasks section
  5. Run populate_url_unit_cache scheduled task
  6. Go to ToolsSystem Tools section
  7. In the Memory Cache subsection confirm, that cached_urls_unit_prefixes cache variable contains array with c, lang, theme prefixes
  8. Go to adm.console, Website & ContentStructure & Data section, make some changes to the Privacy Policy category and save these changes
  9. Confirm that record for Privacy Policy is deleted from the CachedUrls table
  10. Go to Website & ContentLinks section and create some active link record
  11. Go to recently created link page on front-end
  12. Confirm that record for this link page is created in the CachedUrls table
  13. Go to Website & ContentLinks section, make some changes to the just created link and save these changes
  14. Confirm that record for recently created link is not deleted from the CachedUrls table

With Memcache disabled

  1. Delete all records from CachedUrls table
  2. Visit Privacy Policy page on front-end
  3. Confirm that record for Privacy Policy is created in the CachedUrls table
  4. Go to adm.console, ConfigurationWebsiteScheduled Tasks section
  5. Run populate_url_unit_cache scheduled task
  6. Confirm, that in the SystemCache table is created record with VarName = cached_urls_unit_prefixes and Data containing serialized array with c, lang, theme prefixes
  7. Go to adm.console, Website & ContentStructure & Data section, make some changes to the Privacy Policy category and save these changes
  8. Confirm that record for Privacy Policy is deleted from the CachedUrls table
  9. Go to Website & ContentLinks section and create some active link record
  10. Go to recently created link page on front-end
  11. Confirm that record for this link page is created in the CachedUrls table
  12. Go to Website & ContentLinks section, make some changes to the just created link and save these changes
  13. Confirm that record for recently created link is not deleted from the CachedUrls table

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Full files re-formatting is not part of this task.
SeverityLocationCodeMessage
Errorcore/kernel/managers/cache_manager.php:802PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpaceBeforeCloseBrace
Errorcore/kernel/managers/cache_manager.php:802PHPCS.E.CodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBraceCodingStandard.WhiteSpace.ControlStructureSpacing.SpacingAfterOpenBrace
Errorcore/kernel/managers/cache_manager.php:819PHPCS.E.CodingStandard.Commenting.InlineComment.InvalidEndCharCodingStandard.Commenting.InlineComment.InvalidEndChar
Errorcore/kernel/managers/cache_manager.php:819PHPCS.E.CodingStandard.Commenting.InlineComment.NotCapitalCodingStandard.Commenting.InlineComment.NotCapital
Errorcore/units/admin/admin_config.php:32PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/admin/admin_config.php:32PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/admin/admin_events_handler.php:1230PHPCS.E.CodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCapsCodingStandard.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
Errorcore/units/admin/admin_events_handler.php:1254PHPCS.E.CodingStandard.Classes.ClassDeclaration.NewlinesAfterCloseBraceCodingStandard.Classes.ClassDeclaration.NewlinesAfterCloseBrace
Unit
No Unit Test Coverage
Build Status
Buildable 915
Build 915: arc lint + arc unit

Event Timeline

erik created this revision.Jan 11 2019, 5:27 AM
alex requested changes to this revision.Jan 11 2019, 8:29 AM

I've found one use case, that wasn't covered by initial plan.

core/kernel/managers/cache_manager.php
803–807

Use construct similar to one from \kUnitConfigReader::includeConfigFiles method (getting part) to use database cache, when memory cache isn't available.


When memory cache is disabled, then cache of urls from non-default units (e.g. links and products) won't ever be removed.

core/units/admin/admin_events_handler.php
1246

Use construct similar to one from \kUnitConfigReader::includeConfigFiles method (setting part) to use database cache, when memory cache isn't available.


When memory cache is disabled, then cache of urls from non-default units (e.g. links and products) won't ever be removed.

This revision now requires changes to proceed.Jan 11 2019, 8:29 AM
erik edited the test plan for this revision. (Show Details)Jan 11 2019, 9:06 AM
erik updated this revision to Diff 892.Jan 11 2019, 9:11 AM
erik edited edge metadata.
erik edited the test plan for this revision. (Show Details)

Added fallback to DB cache when Memcache is not available.

alex accepted this revision.Jan 11 2019, 10:21 AM
This revision is now accepted and ready to land.Jan 11 2019, 10:21 AM
This revision was landed with ongoing or failed builds.Jan 11 2021, 2:51 AM
This revision was automatically updated to reflect the committed changes.
alex added a project: Restricted Project.Mar 16 2021, 3:56 AM