Magento CE 2.1.5, PHP 7.0.15, MariaDB 10.0.29.
Have Index in scheduled mode.
setup:backup --db.setup:rollback -d.
Database is restored and includes triggers.
Database is missing triggers, so indexing doesn't work correctly.
I noticed this problem after several product changes failed to show in the front. I realized the index was not updated and after some debugging found that there were no triggers.
I tried switching index mode to realtime and saving the product so the changes would appear. When switching back to scheduled the triggers were recreated.
I could reliably reproduce the problem afterwards which leads me to assume the problem is in the backup CLI command.
mysql> CREATE TRIGGER test_trigger AFTER INSERT ON catalog_product_entity FOR EACH ROW BEGIN END;mysql> SHOW TRIGGERS;php bin/magento setup:backup --db.CREATE DATABASE magento_backup;mysql -u root -p magento_backup < "/var/backups/1506349239_db.sql"mysql> SHOW TRIGGERS from magento_backup;magento_backup have trigger "test_trigger"
magento_backup do not have trigger "test_trigger"
@domeglic Please add more details to your description of the steps you followed when identifying this issue. Screenshots or logs would be helpful, too.
I have added some description but I don't really understand why, the problem seems easy enough to understand and reproduce.
We updated description:
mysql> CREATE TRIGGER test_trigger AFTER INSERT ON catalog_product_entity FOR EACH ROW BEGIN END;mysql> SHOW TRIGGERS;php bin/magento setup:backup --db.CREATE DATABASE magento_backup;mysql -u root -p magento_backup < "/var/backups/1506349239_db.sql"mysql> SHOW TRIGGERS from magento_backup;magento_backup have trigger "test_trigger"
magento_backup do not have trigger "test_trigger"
@domeglic, thank you for your report.
We've created internal ticket(s) MAGETWO-78619 to track progress on the issue.
I'm working on it #SQUASHTOBERFEST
@ishakhsuvarov this ticket is resolved :)
Hi @domeglic. Thank you for your report.
The issue has been fixed in magento/magento2#11369 by @denisristic in 2.2-develop branch
Related commit(s):
The fix will be available with the upcoming patch release.
Hi @domeglic. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1361 by @magento-engcom-team in 2.3-develop branch
Related commit(s):
The fix will be available with the upcoming 2.3.0 release.