Description
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 ofgetIndexerIdsBySharedIndex
andvalidateSharedIndex
there. So we can reuse the newly created class for the indexer processor andIndexerReindexCommand
.
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”.