-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Enable indexer application locking by default #36956
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
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @fredden. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
1 similar comment
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
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.
Please fix failing static tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
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.
✔ Approved.
Failing tests look not related to changes from this PR.
We have discussed this PR with PO internally and as per him we never enabled this feature by default because there is a potential risk involved in using it. There might be a situation when we can have duplicate reindexing processes running at the same time because of this setting depending on the lock provider: So we should not proceed with this PR. Hence closing it for now. Thanks |
@engcom-Hotel thanks for the update. I'm disappointed with this response. It makes sense to avoid using a potentially dangerous feature. How can I/the community discuss this with the "PO" (product owner?) that you mentioned? It sounds like there's a separate bug where it's possible to use a lock provider which doesn't provide a reliable locking service. That sounds like something to get fixed, but should not block this in my opinion. I'm open to updating this pull request to set on-by-default for lock providers which are known to be good / work well, and off-by-default for 'bad' lock providers, while we wait for that separate bug to be fixed. Please can you re-open this pull request as I do not have sufficient permissions on GitHub to do this. The conversation is not yet complete. |
Re-opened for further discussions |
@magento run Unit Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
hello @fredden, @ihor-sviziev, Thank you working on this. |
These all sound like good things to offer by default. Is there a compelling reason to not provide such functionality by default? Why hide such a positive/useful feature behind a flag that many will not know about? |
Here's an example of how "hidden" the feature is: #30012 (comment) |
Just found this old comment from some time ago: magento/devdocs#8517 (comment) |
Thanks, that's a useful insight. I suspect the improvements being made in #30012 are likely to resolve the concern raised there. |
I agree with @engcom-Hotel 's assessment. We enabled this feature but quickly came into to the opposite situation actually: because the indexer process crashed at some point, the lock file is still present and thus Magento never ever executed that particular cronjob ( |
@fritzmg: what was your lock provider set to at that moment (it's defined in the |
'lock' => [
'provider' => 'db',
'config' => [
'prefix' => ''
]
], |
Okay, so it uses mysql (also note that the |
These are just the defaults that Magento provided. There are no other Magento instances on the same server.
I would like to, however apart from this page I cannot find any documentation as to what the recommended settings would be. |
You can choose and experiment yourself. Like I said before, in my experience over the past couple of years, the default one ( |
I think I lack the required knowledge to do that ;). Aren't there best practises that Magento can provide? |
@engcom-Hotel any updates on this? |
Description
Since Magento version 2.4.3, there has been a feature of the indexer process where Magento can automatically recover from crashed indexer processes. The feature was off by default. This pull request enables the feature by default. Individual applications can explicitly enable/disable this feature as described in the documentation.
https://developer.adobe.com/commerce/php/development/components/indexing/#using-application-lock-mode-for-reindex-processes
Manual testing scenarios
Contribution checklist