-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Mitigate performance issue in #36667 during price indexing #38050
Mitigate performance issue in #36667 during price indexing #38050
Conversation
Hi @ioweb-gr. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Thanks for the kind words. I had been struggling for months with this and you were one of the few people who tried to help. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
To save your time on the test result
|
Ah cool it just needs to be asserted that the correct method is called not the one I removed |
@ioweb-gr: would you like to fix the failing unit test? I think you'll need to change this line.
I know this isn't due to your change, but because this class hasn't been touched in 6 years and Magento coding standards did change over the years. They now require a short description in the phpdocs section to explain what this It would also be appreciated if somebody from the internal team with a lot of experience in this area could review this change and confirm this is a good fix and won't cause regressions, @kandy maybe? |
Yeah I'll submit a change for the failing test as soon as possible. Unfortunately I don't know as much about the code usage to describe it. Circumstances brought me to it unfortunately. As for the change itself, I still don't understand why we need two functions which do the exact same thing regarding filtering salable products based on the configuration. I think if someone from the internal team can review it, one of the functions, the least significant one should be refactored out of the system entirely to avoid confusion on which to use or mark the one that's worse as deprecated |
@hostep I'm not sure I understand this test warning
Any ideas? I think it's due to the earlier missing description |
Also the very first commit on the file mentions it fixes
Perhaps we can just follow up with this as a short description |
Sure, so to fix the static tests, the docblock should look a bit like so: /**
* short description goes here <==== adjust this
* <==== here's that empty line it wants
* @param Link $subject
* @param Collection $collection
* @return Collection
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ Also, you can run the static tests locally before commiting, by executing:
|
OK great, so only the description needed if someone knows exactly why this was added :) |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@ioweb-gr there's still :
|
Hi @Nuranto unfortunately I'm not sure why the original function was written here as it's old code. Someone who knows should let us know what description to put here this was discussed earlier |
Hi ! I see, the initial commit was : 1eaca43 So I guess you can use the commit message as method description : |
OK @Nuranto I've added the original commit message as description. Hopefully it will work out like this |
Correct me if I'm wrong as I can see there is only one warning I'm assuming it's targetting this
And wants it like this?
However this syntax for the constructor in php 8.2 looks very weird. Normally constructors with no body would have the curly braces in one line after the closing parenthesis. Is it really OK to modify like this? @engcom-Hotel |
@ioweb-gr: If Magento's coding standard would follow the latest PER-CS 2.0 coding style then you would be correct, as it says:
But at the moment Magento's coding standard is a bit outdated and still follows PSR-2 or PSR-12 (not sure which one), which both were created before PHP 8 existed and property promotion was a feature. So for now, unfortunately yes, please change it to put the brace on the next line. One day (hopefully) the Magento Coding standard will switch to PER-CS 2 (or newer) 🤞 |
OK done |
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
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.
Failed tests seem flaky to me, hence approving the PR.
@magento run Functional Tests B2B, Functional Tests EE |
1 similar comment
@magento run Functional Tests B2B, Functional Tests EE |
✔️ QA Passed ** Manual testing scenarios (*) ** With this PR the double join is removed essentially mitigating the issue. Moving this PR further by looking into code changes and comparing both the methods (Previous and Current). Actual Result: ✔️ Tested all the manual scenarios, no impact on regression testing.* Failed tests seem flaky to me, they are different in 2 consecutive runs. Please refer to the below screenshot: Function Test EE: Function Test B2B: Hence moving the PR in Thanks |
dcf455e
into
magento:2.4-develop
Description (*)
This is the first part of solving partially the issue #36667 tackling the performance issue of the queries coming from related / upsell and cross-sell blocks.
As described in #36667 the related / upsell and cross-sell blocks run a non optimized query breaking magento in MariaDB versions 10.4-10.6 because these long running queries prevent the indexer from renaming the tables creating a long running exclusive lock on the tables instead.
#36667 (comment)
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)