Skip to content

MCLOUD-6958: Command cache:evict does not support L2 cache configuration #44

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

Merged
merged 3 commits into from
Sep 23, 2020

Conversation

yvoronoy
Copy link
Contributor

@yvoronoy yvoronoy commented Sep 18, 2020

Description

Command for cache key eviction does not support Redis L2 Cache Configuration.
https://jira.corp.magento.com/browse/MCLOUD-6958

Manual testing scenarios

  1. Configure L2 Cache Configuration by updating .magento.env.yaml file
stage:
  deploy:
    REDIS_BACKEND: '\Magento\Framework\Cache\Backend\RemoteSynchronizedCache'
  1. Commit changes and push a new deployment
  2. SSH on environment and run the following command
php bin/magento cache:evict

Expected Result
L2 Cache Configuration can be parsed and evict expired keys in Redis

Release notes

Updated the php bin/magento cache:evict command to support the default L2 Cache Configuration for the Redis service.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • Pull request introduces user-facing changes and includes meaningful updates for any required release notes and documentation changes
  • All commits are accompanied by meaningful commit messages

NadiyaS
NadiyaS previously approved these changes Sep 21, 2020
* @param string $configKey
* @return string
*/
private function getCacheConfigValue($cacheConfig, $configKey)
Copy link

Choose a reason for hiding this comment

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

Add return type declaration to new functions
private function getCacheConfigValue($cacheConfig, $configKey): string
and for isCacheConfigValid()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@NadiyaS
CR Notes - fixed

BaDos
BaDos previously approved these changes Sep 21, 2020
arhiopterecs
arhiopterecs previously approved these changes Sep 21, 2020
BaDos
BaDos previously approved these changes Sep 21, 2020
NadiyaS
NadiyaS previously approved these changes Sep 21, 2020
@andriyShevtsov
Copy link
Contributor

@yvoronoy may you please take a look. I got next error during testing:

Begin scanning of cache keys
PHP Fatal error:  Uncaught TypeError: Return value of Magento\CloudComponents\Model\Cache\Evictor::getCacheConfigValue() must be of the type string, int returned in /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php:98
Stack trace:
#0 /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php(112): Magento\CloudComponents\Model\Cache\Evictor->getCacheConfigValue(Array, 'port')
#1 /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php(63): Magento\CloudComponents\Model\Cache\Evictor->isCacheConfigValid(Array)
#2 /app/vendor/magento/magento-cloud-components/Console/Command/CacheEvict.php(50): Magento\CloudComponents\Model\Cache\Evictor->evict()
#3 /app/vendor/symfony/console/Command/Command.php(255): Magento\CloudComponents\Console\Command\CacheEvict->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symf in /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php on line 98

Fatal error: Uncaught TypeError: Return value of Magento\CloudComponents\Model\Cache\Evictor::getCacheConfigValue() must be of the type string, int returned in /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php:98
Stack trace:
#0 /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php(112): Magento\CloudComponents\Model\Cache\Evictor->getCacheConfigValue(Array, 'port')
#1 /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php(63): Magento\CloudComponents\Model\Cache\Evictor->isCacheConfigValid(Array)
#2 /app/vendor/magento/magento-cloud-components/Console/Command/CacheEvict.php(50): Magento\CloudComponents\Model\Cache\Evictor->evict()
#3 /app/vendor/symfony/console/Command/Command.php(255): Magento\CloudComponents\Console\Command\CacheEvict->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symf in /app/vendor/magento/magento-cloud-components/Model/Cache/Evictor.php on line 98

@yvoronoy yvoronoy dismissed stale reviews from NadiyaS and BaDos via 6d04c1f September 22, 2020 01:38
@andriyShevtsov
Copy link
Contributor

@yvoronoy Build failed. Red tests

@BaDos
Copy link
Contributor

BaDos commented Sep 22, 2020

@andriyShevtsov tests are red because we need to create a PR from this repo, we don't run tests if the PR is from an external repo.

@andriyShevtsov
Copy link
Contributor

Ok. Manual QA already done here. Approved

@arhiopterecs
Copy link
Contributor

arhiopterecs commented Sep 23, 2020

I will create the PR, just in case, to run tests

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.

8 participants