-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Invalidate indexers in RecurringData #26163
Invalidate indexers in RecurringData #26163
Conversation
Calling `$indexer->reindexAll();` can take a long time with a large database. This code is run during `php bin/magento setup:upgrade`, which is part of a typical deployment. This change makes the step significantly quicker, while still achieving the same result. Minimising downtime during deployments seems sensible.
Hi @fredden. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @fredden. Thank you for your collaboration. Please, cover your changes with auto-tests. This step is required for further PR processing. I would recommend an integration test that runs the setup:upgrade
command and checks the indexer status.
Thank you!
Also, according to the failing auto-tests, we may assume that this change brings a couple of other issues as a side-effect. |
@o-iegorov unfortunately, only members of the maintainers team are allowed to assign developers to the pull request |
Hi @fredden |
@o-iegorov unfortunately, only members of the maintainers team are allowed to assign developers to the pull request |
@o-iegorov unfortunately, only members of the maintainers team are allowed to unassign developers from the pull request |
@o-iegorov unfortunately, only members of the maintainers team are allowed to assign developers to the pull request |
@o-iegorov I've assigned you, but probably you wanted to assign to issue #19469 |
@o-iegorov are you saying that the work here will be discarded and a different approach is being investigated in private? Should this pull request be closed therefore? |
@fredden no, all your commits will be preserved, i plan just to fix failed tests and improve provided integration test |
@fredden no need to close this PR |
@o-iegorov so the solution to #19469 is to invalidate the index every time we run |
@slackerzz: I really hope that's not the case, because that would be very bad solution. |
@slackerzz in two words yes, your solution absolutely correct: reindex moved to the patch (first time install, need to create indexer tables), invalidation for recurring (upgrade) |
@o-iegorov, |
@ihor-sviziev for me seems as hack to reindex in upgrade data script (and then moved to recurring script with declarative schema) |
@o-iegorov Yep, so why we need to have reindex or index invalidation during module upgrades? What is use case why it was added? |
@ihor-sviziev because no warranty that customer attributes still not changed (by other modules for example) during upgrade |
@o-iegorov, if some module changed customer attributes - this module should invalidate customer grid index. Am I wrong? |
@ihor-sviziev yes it's better for sure, but since such behavior was already introduced- in case when this action will be removed (for example from recurring script) some extensions (not magento core) that based on such behavior mail fail after upgrade. To prevent such situation that may treat as backward incompatible changes better to leave already introduced flow as is |
I disagree @o-iegorov The reindexing in the recurring script got added in Magento 2.3 by accident, I will say it was a bug. If people were relying on this incorrect behavior, we just need to make it clear in the release notes of a new Magento version, that they won't be able to rely on this anymore. It would be nice to get this finally fixed in Magento 2.4.0, as that major version does allow backwards incompatible changes. |
@o-iegorov i was just writing similar thing while @hostep wrote his comment. |
@hostep even Magento functional test based on such behavior :) Just try to run all function tests on branch with removed app/code/Magento/Customer/Setup/RecurringData.php |
@o-iegorov tests also depends on update on save index mode, it doesn’t mean that all production websites should work like this. tests cloud be updated if needed, it doesn’t mean it should be in this way. |
@ihor-sviziev i'am totally agree that test need to be updated, that was in may comment #26163 (comment) |
@o-iegorov, but still you want to keep index invalidation? I don't think it's really needed as part of 2.4-develop. |
Related internal PR merged, merge commit: cac512f |
Hi @fredden, thank you for your contribution! |
Description
Calling
$indexer->reindexAll();
can take a long time with a large database.This code is run during
php bin/magento setup:upgrade
, which is part of atypical deployment.
This change makes the step significantly quicker, while still achieving the
same result. Minimising downtime during deployments seems sensible.
Fixed Issues
Manual testing scenarios
php bin/magento setup:upgrade
Magento_Customer
recurring data setup task.Questions or comments
I could not see any existing tests covering this code.
Contribution checklist (*)