Skip to content
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

Random empty categories when using the multi process reindexing #30846

Closed
1 of 4 tasks
alepane21 opened this issue Nov 9, 2020 · 7 comments
Closed
1 of 4 tasks

Random empty categories when using the multi process reindexing #30846

alepane21 opened this issue Nov 9, 2020 · 7 comments

Comments

@alepane21
Copy link
Contributor

Preconditions (*)

  1. Magento 2.3.3
  2. MAGE_INDEXER_THREADS_COUNT set to 3
  3. pcntl installed

Steps to reproduce (*)

  1. prepare an installation with lot of stores and website
  2. prepare some categories with lot of products
  3. wait for the reindex to complete all the work and have a clean situation
  4. write down the size of all the tables generated by the catalog_category_product index (you can use the query SELECT table_schema, table_name, round(((data_length + index_length) / 1024 / 1024), 2) FROM information_schema.TABLES WHERE table_name LIKE 'catalog_category_product_index_store%' ORDER BY table_name DESC;)
  5. than make invalid the catalog_category_product index
  6. now we have to simulate a LOCK on the catalog_category_product, I could reproduce the issues with the following commands:
    • SET GLOBAL lock_wait_timeout = 1;
    • SET GLOBAL innodb_lock_wait_timeout = 1;
    • launch a "LOCK TABLES catalog_category_product WRITE" in the db to force the situation where a user (or a process) is doing lot of DELETE from that table
  7. wait for the reindexing process to complete (Don't be fooled! The main process will die, but the children process will go on for some time)
  8. recheck the table size with the query made before: you will see

NOTE: The step 6 is obviously not what is happening in production, but is a way to always reproduce the issue. In production the bug will be way more hideous, emptying only some tables some times when someone is saving categories in magento backend while the re-index is running, for example.

Expected result (*)

  1. the cron should be in error and in the cron_schedule table you should se the error message
  2. the commerce should still use the index made before this failed reindex

Actual result (*)

  1. in the cron_schedule you see the error message
  2. in the indexer_state is set as invalid
  3. the reindex is STILL RUNNING and at completion the main process will switch all the replica tables to the main one, putting in use tables that have not been correctly generated

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Nov 9, 2020

Hi @alepane21. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@alepane21
Copy link
Contributor Author

@magento I am working on this

@alepane21
Copy link
Contributor Author

I forgot to mention that this problem affects also catalogsearch_fulltext and catalog_product_price.

alepane21 added a commit to alepane21/magento2 that referenced this issue Nov 9, 2020
…indexing

- uncaught exception in a child process now are caught from the ProcessManager and the process will exit with an error code
@ihor-sviziev ihor-sviziev self-assigned this Nov 9, 2020
@m2-assistant
Copy link

m2-assistant bot commented Nov 9, 2020

Hi @ihor-sviziev. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@ihor-sviziev
Copy link
Contributor

Hi @alepane21,
Seems like this is duplicate of #30622 and will be fixed in #30626.

Could you confirm that?

@alepane21
Copy link
Contributor Author

Hi @ihor-sviziev,
you are right, this is a duplicate!

@IvanVizcaino
Copy link

Any solution? I have the same problem in Magento 2.4.4 Community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants