Skip to content

Refactor Magento_Indexer module so that the "indexer_reindex_all_invalid" cronjob and "bin/magento indexer:reindex" command use the same code #29297

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

Closed
1 of 5 tasks
hostep opened this issue Jul 27, 2020 · 2 comments · Fixed by #29196
Labels
Event: MageCONF CD 2020 Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@hostep
Copy link
Contributor

hostep commented Jul 27, 2020

Summary (*)

This was discovered while working on #29196

The cronjob indexer_reindex_all_invalid (Magento\Indexer\Model\Processor::reindexAllInvalid) and manually executing bin/magento indexer:reindex {all-invalid-indexers} (Magento\Indexer\Console\Command\IndexerReindexCommand::execute) should execute the exact same thing.
Currently both those entry points have separate codebases for executing their logic which can lead to subtle inconsistencies if only one of both codebases are touched.

We should try to refactor the code into one shared codebase for both entry points.

Examples

It looks like this (probably) accidentally happened at least once in MAGETWO-51540

Proposed solution

@rogyar proposed the following solution:

Additionally, I would create a separate service i.e. validateSharedIndex and put the logic of getIndexerIdsBySharedIndex and validateSharedIndex there. So we can reuse the newly created class for the indexer processor and IndexerReindexCommand.


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 with no 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”.
@hostep hostep added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jul 27, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jul 27, 2020

Hi @hostep. 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

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jul 27, 2020
@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 21, 2020
@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Oct 24, 2020
@magento-engcom-team
Copy link
Contributor

Hi @hostep. Thank you for your report.
The issue has been fixed in #29196 by @hostep in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Event: MageCONF CD 2020 Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants