-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fixed duplicated ids to index by mview changelog #36155
Fixed duplicated ids to index by mview changelog #36155
Conversation
Hi @MateuszMesek. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all 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. |
This following issue sounds related to this fix: #30012, can you confirm @MateuszMesek? If they are related, we should link this PR to that issue. |
@magento run all 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. |
@magento run all 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. |
@magento run 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. |
@magento run 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. |
1d88eec
to
6eb1890
Compare
@magento run all 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.
Hi @MateuszMesek
Thank you wu much for a great improvement! Could you please fix failing static tests?
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Static Tests,Unit Tests,WebAPI Tests,Functional Tests EE,Functional Tests CE,Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@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 message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
Failing test does not seems to be related to PR changes. Hence moving it to |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
@magento run Unit Tests,Integration Tests,Functional Tests EE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues. |
We have 2 customers affected by this. One on m2cloud, the other on premise (community edition). Both version 2.4.6 The dev teams are working to apply this PR next week. To be able to unlock the other indexes and pass the weekend without loosing products on the frontoffice. We are using this very quick and dirty workaround, issuing the following SQL query every 1min or 30s or so. Schedule by a cron or a while true loop in a screen :
I also really cannot understand why there are so many duplicates in the changelog table :
|
@MateuszMesek have you tested this solution with different MAGE_INDEXER_THREADS_COUNT values? Locally I've tested it on 4 threads and it always ends with a series of |
@Bar3nho could you provide how you call mview via multi-thread or provide steps to replicate your issue?
|
@MateuszMesek I checked it once more and the problem is due to the fact that our custom mview indexer uses |
As @Bar3nho mentioned in #38246 When using Our DB log shows that tmp table dropped multiple times. Then Select is running against that table, and then DROP again. I think the bug should be easily reproduceable with any implementation for Looks like second iteration foreach inside of of
would cause this problem due to finally being called every time, and there are still selects pending to read data from tmp table. |
Description (*)
When we have a large number of records in changelog tables (over 1000) then indexer called by mview action can process this same ids few times.
ChangeLogBatchWalker
is changed to use temporary table to collect unique ids to reindex it. List of ids is returns in batches byGenerator
.Fixed Issues (if relevant)
Manual testing scenarios (*)
indexer_update_all_views
cron job.In case when your changelog table will be filled by this same id (ex: 1) 10000x then you should see used this id (1) 10x by mview action.
Related Pull Requests
https://github.com/magento-gl/magento2-infrastructure/pull/22
Contribution checklist (*)