magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

fix for #38315 issue (Missing indexing of required columns in catalog_product_entity_int table)

Open rostilos opened this issue 1 year ago • 11 comments

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 2023-12-25_21-44 2023-12-25_21-44_1

Related Pull Requests

Fixed Issues (if relevant)

  1. 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)

rostilos avatar Dec 25 '23 19:12 rostilos

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:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic 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.

m2-assistant[bot] avatar Dec 25 '23 19:12 m2-assistant[bot]

@magento run all tests

rostilos avatar Dec 25 '23 19:12 rostilos

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

rostilos avatar Dec 27 '23 08:12 rostilos

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?

ihor-sviziev avatar Dec 27 '23 11:12 ihor-sviziev

Yeah, I'll try to fix that But to be honest, don't have much experience with B2B and EE versions

rostilos avatar Dec 27 '23 12:12 rostilos

@magento run Database Compare

rostilos avatar Dec 29 '23 00:12 rostilos

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 ? 2023-12-29_10-35

<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>

rostilos avatar Dec 29 '23 08:12 rostilos

@engcom-Hotel maybe you can help with fixing b2b/ee part?

ihor-sviziev avatar Jan 03 '24 07:01 ihor-sviziev

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.

tdgroot avatar Jan 30 '24 08:01 tdgroot

@magento run all tests

engcom-Echo avatar Jan 31 '24 05:01 engcom-Echo

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

engcom-Echo avatar Feb 01 '24 08:02 engcom-Echo

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

engcom-Echo avatar Feb 01 '24 11:02 engcom-Echo

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

engcom-Echo avatar Feb 01 '24 13:02 engcom-Echo

@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

rostilos avatar Feb 01 '24 23:02 rostilos

@magento run all tests

engcom-Hotel avatar Feb 08 '24 09:02 engcom-Hotel

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Static Tests, WebAPI Tests

engcom-Hotel avatar Feb 08 '24 11:02 engcom-Hotel

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Static Tests, WebAPI Tests

engcom-Hotel avatar Feb 08 '24 16:02 engcom-Hotel

@magento run all tests

engcom-Hotel avatar Feb 15 '24 06:02 engcom-Hotel

@magento run Functional Tests B2B, Functional Tests CE, Integration Tests, WebAPI Tests

engcom-Hotel avatar Feb 15 '24 10:02 engcom-Hotel

: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

engcom-Hotel avatar Feb 15 '24 10:02 engcom-Hotel

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.

engcom-Hotel avatar Feb 15 '24 11:02 engcom-Hotel

Bot moved this PR from Pending Approval to Ready for testing. Moving back to Pending Approval.

engcom-Hotel avatar Mar 07 '24 11:03 engcom-Hotel