Skip to content

[Backport] Fix layout xml and page layout caching issue on redis cluster under high load #22625

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

Closed
wants to merge 1 commit into from

Conversation

andrey-legayev
Copy link
Contributor

@andrey-legayev andrey-legayev commented May 3, 2019

Original Pull Request

#22766

Description (*)

Bugs which were fixed:

  • $this->pageLayout was not checked after reading from cache, but was used as is
  • two cache items were used in once place instead of one (performance impact)

Changes:

  • replace 2 cache items by 1 - it should improve performance
  • add "_MERGED" to cache key suffix to have compatibility with old cache keys during deployment of new version

Fixed Issues (if relevant)

  1. Layout corruption with php-fpm (a Magento 1 problem returns) #6942 Layout corruption (Title is wrong, but issue is real)
  2. Corrupt layout cache causes white page on customer account login #22976 Corrupt layout cache causes white page on customer account login

Manual testing scenarios (*)

N/A

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@m2-assistant
Copy link

m2-assistant bot commented May 3, 2019

Hi @andrey-legayev. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.2-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented May 3, 2019

CLA assistant check
All committers have signed the CLA.

@orlangur orlangur self-assigned this May 3, 2019
Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

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

LGTM, previous attempt to fix this issue was performed in #16428 (comment), this one looks better from perfomance perspective.

@andrey-legayev
Copy link
Contributor Author

andrey-legayev commented May 3, 2019

I've found two issues in previous fix for the issue:

  • It tries to load two cache items even if 1st is not available. It does small impact on performance.
  • Comparison if ($result && $pageLayoutResult) { ... } doesn't catch the case when $pageLayoutResult === "" (which is ok for Magento layouts) and it generates layouts again and again without using cached data. It had to be if ($result && $pageLayoutResult !== false) { ... }

@p-bystritsky p-bystritsky self-assigned this May 7, 2019
@andrey-legayev
Copy link
Contributor Author

Hi there!
I've submitted changes 2 days ago, but unit tests are still be pending in Travis.
Is it ok?

@magento-engcom-team
Copy link
Contributor

@andrey-legayev thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@orlangur
Copy link
Contributor

orlangur commented May 7, 2019

@andrey-legayev nope, it is not good but EngCom guys are aware of it and it should be fixed soon.

Sorry, just noticed, we need to apply changes against 2.3-develop first. Could you please prepare such a PR? This one will be on hold for now.

@orlangur orlangur changed the base branch from 2.2-develop to 2.2 May 7, 2019 11:30
@orlangur orlangur changed the base branch from 2.2 to 2.2-develop May 7, 2019 11:31
@andrey-legayev
Copy link
Contributor Author

@orlangur I've created pull request for 2.3-develop: #22766

@ihor-sviziev ihor-sviziev changed the title Fix layout xml and page layout caching issue on redis cluster under high load [Backport] Fix layout xml and page layout caching issue on redis cluster under high load May 7, 2019
…igh load

Bugs which were fixed:
 - $this->pageLayout was not checked after reading from cache, but was used as is
 - two cache items were used in once place instead of one (performance impact)

Changes:
 - replace 2 cache items by 1 - it should improve performance
 - add "_MERGED" to cache key suffix to have compatibility with old cache keys during deployment of new version
@andrey-legayev
Copy link
Contributor Author

This fix has been already included into v2.2.9 by cherry-picking commit.
I'm closing pull request.

@m2-assistant
Copy link

m2-assistant bot commented Jun 27, 2019

Hi @andrey-legayev, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@andrey-legayev andrey-legayev deleted the layout-cache-fix-2.2.7 branch September 22, 2019 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants