-
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
Fix for update products via csv file (fix for 22028) #22575
Fix for update products via csv file (fix for 22028) #22575
Conversation
Hi @mtwegrzycki. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
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.
LGTM!
@mtwegrzycki please make sure commit is linked to your GitHub user and CLA is signed.
Okay, I fixed issue with CLA. |
@mtwegrzycki thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
I can see, that there any integration errors in Travis. But it does not look like related to my code changes. |
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.
@mtwegrzycki true, build failure seems to be random.
Hi @orlangur, thank you for the review. |
Hi @mtwegrzycki thank you for Pull request, can you please explain? why you add your changes to else condition, ? because if you can see there is a validation
|
Hi @Nazar65,
Please, let me know, if you need more detailed information. |
Okay, now I see the bug in my code. |
@mtwegrzycki yeap. if we have one ID they not be indexed. |
Fix for update products via csv file (fix for 22028) Fix for update products via csv file (fix for 22028)
Okay, I fixed it. :D |
@orlangur can you please review ? and should we use BETWEN ? as IN works perfectly with one entity id. |
@Nazar65 regarding between check in comment I referenced. |
Hi @orlangur, thank you for the review. |
@mtwegrzycki unfortunately, only members of the maintainers team are allowed to assign developers to the pull request |
✔️ QA Passed |
Hi @mtwegrzycki, thank you for your contribution! |
If you are adding "IN" why the need to keep "BETWEEN"? I assumed the between statement was introduced in case a large number of items need reindexing. As the query itself is pretty long (from what I can see about 11k characters) it could cause fail due to batch size limit. But instead of between statement the better solution in my opinion is to chunk entity ids array and execute 2 or 3 queries. |
@hatimeria-artur-jewula this suggestion came from #19878 (comment) |
Description (*)
It is fix for issue #22028
In query for selecting ids to indexing after import products, I changed "between" into "in",
Before change, when products were updated via csv file import in Admin panel, to indexing process were selected all products from range between the smallest and the biggest products id from csv file. When the ids were from wide range, it caused selecting a huge amount of data and attempt to inserting them to catalog_product_index_price_temp. If data amount was to big, it caused error
After change, for indexing process are selected only products from csv file.
Example:
Before change, when we try to update two products with id 30 and 31, only two products were selected to indexing.
When products have ids 30 and 50, it caused, that 21 products were selected to indexing (All products with ids between 30 and 50.
After change, in both cases described above, only two products will be selected to indexing.
Fixed Issues (if relevant)
No related issues found.
Manual testing scenarios (*)
The same scenario can be applied to reproduce bug and check fix:
Contribution checklist (*)