-
Notifications
You must be signed in to change notification settings - Fork 34
MCLOUD-6139 - MCLOUD-6211: Redis improvement - Create patches for 2.3.0 - 2.3.5 #52
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
Conversation
BarnyShergold
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description needs full information - a ticket link is not sufficient as many reviewers do not have access to the the JIRA tickets
| ">=2.3.4 <2.3.6": "MCLOUD-5837__fix_filesystem_load_balancer_issue__2.3.4.patch" | ||
| }, | ||
| "Cache Locking performance issue": { | ||
| "2.3.3": "MDVA-27538__fix_performance_issue_in_cache_locking_mechanism__2.3.3.patch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a "Create Patch" PR - why are these being removed? Are the Redis patches replacing these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patches in this PR contain the same improvements and more.
| + try { | ||
| + if ($this->fileDriver->isExists($lockFile)) { | ||
| + $fileResource = $this->fileDriver->fileOpen($lockFile, 'w+'); | ||
| + if ($this->tryToLock($fileResource)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional will do -
$result = !$this->tryToLock($fileResource);
| + * | ||
| + * @var string | ||
| + */ | ||
| + private $lockName = 'lock-'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a constant as it never changes
| + * | ||
| + * @var int | ||
| + */ | ||
| + private $connectionTimeout = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a constant as it never changes
| + * | ||
| + * @var int | ||
| + */ | ||
| + private $sleepCycle = 100000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a constant as it never changes
| + $cacheKey = self::ATTRIBUTES_CACHE_ID . '-' . $entityTypeCode . '-preload'; | ||
| + if ($this->isCacheEnabled() && ($attributes = $this->_cache->load($cacheKey))) { | ||
| + $attributes = $this->serializer->unserialize($attributes); | ||
| + if ($attributes) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for array
| + * Load value with given id from cache | ||
| + * | ||
| + * @param string $id Cache id | ||
| + * @param string $id Cache id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove whitespace
| + /** | ||
| + * @inheritDoc | ||
| + */ | ||
| + public function doOperation(): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHy has this been removed?
| + /** | ||
| + * @inheritDoc | ||
| + */ | ||
| + public function getName(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WHy has this been removed?
| + public function getName(): string | ||
| + public function getName() | ||
| + { | ||
| + return 'App action list generation'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pure text should be a constant
|
Hi @BarnyShergold Patches contain the same code as Magento Core. |
|
@BaDos - I've only commented on NEW code added by the patches - this should surely be subject to the same code rules as standard code? It's why i've not commented on code that should be refactored - it's core. I spent 3hrs going through all 10 files. |
|
@BarnyShergold, these are diffs from core Magento, where this code was fixed already. To be able to change the content of patches we would need to change the same in core first. If there are so many changes required though, I assume this is something that may need to be looked at by core team, since the patches used here are taken from latest core code. |
|
@BaDos - AH I see how these patches are being created now.... Seems I wasted some of my own time - however the comments should still stand, so is there a mechanism to have these reported against the CORE code? You've corrected the pull request description so can you tell me then - when these PRs for patches are submitted, what exactly are we reviewers reviewing? If you can answer that - then I'll be happy to approve the PR and put it down to "lesson learned" 😄 |
@BarnyShergold When I review these, I am usually checking for:
|
BarnyShergold
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the CORRECT way to review patches, the only query I have that remains is the one for patches.json
| "2.3.0 - 2.3.1": "MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.3.0.patch" | ||
| "2.3.0": "MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.3.0.patch", | ||
| "2.3.1": "MAGECLOUD-3054__add_zookeeper_and_flock_locks__2.3.1.patch", | ||
| ">=2.3.2 <2.3.5": "MCLOUD_6139__improvement_flock_locks__2.3.2.patch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is now 2.3.0 - 2.3.5 - This should be ">=2.3.2 <2.3.6" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch MCLOUD_6139__improvement_flock_locks__2.3.2.patch contains changes for Magento 2.3.2 - 2.3.4-px where x is some number. So, we cannot use a constraint like this 2.3.2 - 2.3.4 and we use this one >=2.3.2 <2.3.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay that's fine - just wanted to check that was the reason!
|
QA Approved |
MCLOUD-8486: Release Cloud Tools
MCLOUD-8486: Release Cloud Tools
Description
Added patches that contain performance improvements for Redis from Magento 2.3.5 and 2.3-develop branch.
Fixed Issues (if relevant)
Manual testing scenarios
For Magento 2.3.0 and 2.3.1 need to smoke testing product functionality.
There are steps for testing for Magento 2.3.0 - 2.3.5
composer.jsoncomposer updatecomposer.jsonandcomposer.lockapp/etc/env.php.magento.env.yaml.magento.env.yamlapp/etc/env.phpContribution checklist