magento2
magento2 copied to clipboard
fix for #38315 issue (Missing indexing of required columns in catalog_product_entity_int table)
Description (*)
Added indexing of entity_id column to avoid cases of "hang" of select query in mysql ( full description of the problem is in linked issue )
For example, after edits, the SELECT query specified in the issue are successful and in a fraction of a second
Related Pull Requests
Fixed Issues (if relevant)
- Fixes magento/magento2#38315
Manual testing scenarios (*)
1.A relatively large catalog is needed.
In a test environment, it is reproduced on a test catalog generated with the
bin/magento setup:perf:generate-fixtures setup/performance-toolkit/profiles/ce/extra_large.xml
2. Start the reindex process
bin/magento indexer:reset
bin/magento indexer:reindex catalogsearch_fulltext
3. Successful reindex
Questions or comments
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)
- [ ] README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
- [ ] All automated tests passed successfully (all builds are green)
Hi @rostilos. Thank you for your contribution! Here are some useful tips on 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 give me test instance- deploy test instance based on PR changes@magento give me 2.4-develop instance- deploy vanilla Magento instance
:exclamation: Automated tests can be triggered manually with an appropriate comment:
@magento run all tests- run or re-run all required tests against the PR changes@magento run <test-build(s)>- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)> is a comma-separated list of build names.
Allowed build names are:
Database CompareFunctional Tests CEFunctional Tests EEFunctional Tests B2BIntegration TestsMagento Health IndexSample Data Tests CESample Data Tests EESample Data Tests B2BStatic TestsUnit TestsWebAPI TestsSemantic Version Checker
You can find more information about the builds here :information_source: Run only required test builds during development. Run all test builds before sending your pull request for review.
For more details, review the Code Contributions documentation. Join Magento Community Engineering Slack and ask your questions in #github channel.
@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 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.
According to failed tests, it works fine for Magento Open Source but won't work for Magento Commerce / B2B (conflicts with the Content Staging feature). Do you think you'll be able to make it compatible?
Yeah, I'll try to fix that But to be honest, don't have much experience with B2B and EE versions
@magento run Database Compare
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.
@ihor-sviziev
Proposal for a fix.
I can't make compatibility with B2B and EE modules through edits in this repository. But, if edits are made, maybe you could make edits for DB schema in magento-catalog-staging module ?
<index referenceId="CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID_ENTITY_ID" disabled="1"/>
<index referenceId="CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID_ROW_ID" indexType="btree">
<column name="attribute_id"/>
<column name="row_id"/>
</index>
@engcom-Hotel maybe you can help with fixing b2b/ee part?
I'm in favor of this PR, but don't we also need to keep the standalone ATTRIBUTE_ID index? Surely some functionality somewhere depends on that index to exist, so to me this seems like a regression.
@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 WebAPI Tests ,Integration Tests,Functional Tests EE,Functional Tests CE,Functional Tests B2B
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 EE,Functional Tests B2B,Database Compare
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.
Functional Tests B2B are not related to PR.
Semantic Version Checker and Database Compare we would need to raise Approval jira.
Hence moving it to Pending Review
@tdgroot Good question for discussion. Perhaps you could provide examples where indexing ATTRIBUTE_ID as a standalone index would be useful? This would help maintainers confirm the need for these edits
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Static Tests, WebAPI Tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Static Tests, WebAPI Tests
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Integration Tests, WebAPI Tests
:heavy_check_mark: QA Passed
Added the missing indexing of required columns in catalog_product_entity_int table
As mentioned in the related issue i.e. https://github.com/magento/magento2/issues/38315#issuecomment-1892005015, the reproduction of this issue is not possible.
but we can move ahead by looking into the changes of the PR, the PR is creating an index on the attribute_id and entity_id columns for the catalog_product_entity_int table.
Hence moving forward with this PR for approval on Database compare and Semantic Version Checker failures
Thanks
Created internal JIRA tickets https://jira.corp.adobe.com/browse/AC-11055 and https://jira.corp.adobe.com/browse/AC-11056 for database compare and SVC failure approvals.
Bot moved this PR from Pending Approval to Ready for testing. Moving back to Pending Approval.