cube-js/cube

Pre-aggregation queries are not GTID safe - MySQL

Open

#1,810 创建于 2021年1月19日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)Rust (1,965 fork)batch import
driver:mysqlhelp wanted

仓库指标

Star
 (19,563 star)
PR 合并指标
 (平均合并 5天 16小时) (30 天内合并 138 个 PR)

描述

Describe the bug

Queries to create pre-agg tables use CREATE TABLE ... SELECT syntax. This syntax is not valid when running MySQL with GTID based replication. see here

GTID based replication also happens to be used by Google CloudSQL and is not configurable. This means that pre-aggregations cannot by used.

Note: This issue theoretically will also appear when using statement based replication.

To Reproduce Run a MySQL database using GTIDs for replication

Add a cube with a pre-aggregation. Will fail with an error like "Error: ER_GTID_UNSAFE_CREATE_SELECT: Statement violates GTID consistency: CREATE TABLE ... SELECT."

Expected behavior Pre-aggregation queries should be safe for statement based replication as well as replication with GTIDs.

贡献者指南