-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Closed
Copy link
Labels
Fixed in 2.1.xThe issue has been fixed in 2.1 release lineThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed
Description
Preconditions
- MySQL 5.7.21
- Magento CE/EE (Any version. Checked on 2.1.12 and 2.2.3) with Sample Data.
- Enabled Flat Tables (BO -> Stores -> Configuration -> Catalog -> Catalog -> Storefront -> Use Flat Catalog Product).
- Indexer set to 'UPDATE BY SCHEDULE' mode (BO -> System -> Index Management).
- Initial reindex was done and flats already created.
- Table catalog_product_attribute_cl is empty.
Steps to reproduce
- Go to BO.
- Open product edit form (Catalog -> Products -> Product with id №8).
- Edit product attribute (e.g. name to 'Test Before Restart MySQL').
- Press 'Save'.
- Edit 1-2 more product with changing of any attributes.
- Check that new records have created in catalog_product_attribute_cl. Remember 'version_id'.
- Wait (or execute) crons in next order:
- indexer_update_all_views;
- indexer_clean_all_changelogs;
- Check that catalog_product_attribute_cl empty.
- Check product on frontend - changes have applied.
- Restart MySQL.
- Edit the product. Change name to 'Test After Restart MySQL'
- Run Cron. E.G.
php bin/magento cron:run
. - Go To Frontend -> Gears -> Bags.
- Find product with id №8.
Expected result
- Product has name 'Test After Restart MySQL'.
Actual result
- Product has name 'Test Before Restart MySQL'.
Additional information
Explanation.
From the MySQL documentation.
InnoDB uses the in-memory auto-increment counter as long as the server runs. When the server is stopped and restarted, InnoDB reinitializes the counter for each table for the first INSERT to the table, as described earlier.
As result, in case of MySQL restart while catalog_product_attribute_cl
table is empty, auto_increment value will be dropped to the initial value (0), but last value of 'version_id' in mview_state
will be the same as before MySQL restart.
In that case any 'changelog' event will not be processed until 'version_id' in catalog_product_attribute_cl
will not be greater or equal that version_id in mview_state
.
Metadata
Metadata
Assignees
Labels
Fixed in 2.1.xThe issue has been fixed in 2.1 release lineThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed