bangerkuwranger / Magento-2-GTID-Safe-URL-Rewrite-Tables

Magento 2 module that overrides the temporary table creation in catalog-url-rewrite/model/map with a permanent table to allow for GTID consistency in replicated SQL databases.
MIT License
12 stars 9 forks source link

Still get TEMPORARY TABLE error when rebuilding index (Magento 2.2) #1

Open quickshiftin opened 6 years ago

quickshiftin commented 6 years ago

Hi, thanks this module! I've got it installed, and when I run bin/magento indexer:redindex here is the output:

Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:01
SQLSTATE[HY000]: General error: 1787 Statement violates GTID consistency: CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can only be executed outside transactional context.  These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions., query was: CREATE TEMPORARY TABLE IF NOT EXISTS `catalog_product_index_eav_temp` LIKE `catalog_product_index_eav_tmp`
Stock index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:09
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Catalog Search index has been rebuilt successfully in 00:00:04

I'm on Magento 2.2 Do you know if your module supports 2.2?

HamiltonWang commented 6 years ago

Me too

pppwu commented 6 years ago

Same problem

bangerkuwranger commented 6 years ago

My employer (which is why I end up writing most of these workaround modules) is still on 2.1.x thanks to dependencies from some third party modules... so I don't have a 2.3.x or 2.2.x testbed set up to verify or pursue development on this issue. However, it appears that these 'performance' refactors have trickled out into other areas of Magento 2, including the indexers; I've checked out the changes at the point updates and it is confirmed that temporary table usage is GROWING as Magento 2 development continues. That said, the process for patching these issues is the same... find the method in the class, override the method with the older, less efficient but GTID consistent logic, and inject the custom class as an argument with di.xml. I'll be willing to merge any PRs into releases for 2.2.x and 2.3.x if someone has the time and ability to test them out... and I'll be happy to sort out the versioning into maintainable releases for each point update. I just don't have the bandwidth to support releases outside of my employer's needs at the current time, even though I'd like to help out the community by allowing folks to protect their magento data on all releases.

pyyick commented 5 years ago

I'm looking on this issue, may update you if I find sth.

rakeshdonga commented 4 years ago

@bangerkuwranger this extension not working in magento 2.3.2 you have checked? same issue i have facing