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

Product EAV index throws error with GTID consistency #12124

Open
scrivvles opened this Issue Nov 9, 2017 · 7 comments

Comments

Projects
None yet
7 participants
@scrivvles

scrivvles commented Nov 9, 2017

Attempting to reindex the Product EAV when binary logging or replication is enabled on MySQL 5.7throws a SQL error. This same type of error is thrown when attempting to create a new category.

Preconditions

  1. Environment is NGINX 1.10.3 on Ubuntu 16.04.3 LTS running PHP7.0-fpm on a Google Cloud instance.
  2. MySQL version is 5.7 running on Google Cloud Platform SQL

Steps to reproduce

  1. Make sure that your Google SQL db has binary logging enabled AND/OR you have replication enabled.
  2. go to your magento installation and run php bin/magento indexer:reindex

Expected result

All indexes run correctly and display that they have rebuilt successfully

Actual result

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

This error indicates that there is a transaction that violates GTID consistency somewhere in the Product EAV indexing SQL. One suggestion that was made to avoid this problem would be a CREATE VIEW instead of CREATE TEMPORARY TABLE in the indexer module.

@devondahon

This comment has been minimized.

Show comment
Hide comment
@devondahon

devondahon commented Nov 13, 2017

The problem was fixed for me after installing this module:
https://github.com/bangerkuwranger/Magento-2-GTID-Safe-URL-Rewrite-Tables

@scrivvles

This comment has been minimized.

Show comment
Hide comment
@scrivvles

scrivvles Nov 13, 2017

@gvigner Thanks for the tip! It seems like this is one of those things that belongs in core.

scrivvles commented Nov 13, 2017

@gvigner Thanks for the tip! It seems like this is one of those things that belongs in core.

@magento-engcom-team

This comment has been minimized.

Show comment
Hide comment
@magento-engcom-team

magento-engcom-team Nov 21, 2017

Contributor

@scrivvles, thank you for your report.
We've created internal ticket(s) MAGETWO-82828 to track progress on the issue.

Contributor

magento-engcom-team commented Nov 21, 2017

@scrivvles, thank you for your report.
We've created internal ticket(s) MAGETWO-82828 to track progress on the issue.

@devondahon

This comment has been minimized.

Show comment
Hide comment
@devondahon

devondahon Nov 21, 2017

Great news!

devondahon commented Nov 21, 2017

Great news!

@avra911

This comment has been minimized.

Show comment
Hide comment
@avra911

avra911 Dec 4, 2017

@gvigner for us didnt worked in all projects, it depends if root category is assigned to a store or not, which makes create sub-category failing under some circumstances

avra911 commented Dec 4, 2017

@gvigner for us didnt worked in all projects, it depends if root category is assigned to a store or not, which makes create sub-category failing under some circumstances

@stormbyte

This comment has been minimized.

Show comment
Hide comment
@stormbyte

stormbyte Dec 6, 2017

Linking to #11055

The Module
https://github.com/bangerkuwranger/Magento-2-GTID-Safe-URL-Rewrite-Tables
only solves part of the problem with the queries

stormbyte commented Dec 6, 2017

Linking to #11055

The Module
https://github.com/bangerkuwranger/Magento-2-GTID-Safe-URL-Rewrite-Tables
only solves part of the problem with the queries

@loganstellway

This comment has been minimized.

Show comment
Hide comment
@loganstellway

loganstellway Jun 27, 2018

Issue 15209 reports the same MySQL error while creating a category with MySQL binary logging enabled.

loganstellway commented Jun 27, 2018

Issue 15209 reports the same MySQL error while creating a category with MySQL binary logging enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment