cube-js/cube

Pre-aggregation queries are not GTID safe - MySQL

Open

#1.810 geöffnet am 19. Jan. 2021

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (1.965 Forks)batch import
driver:mysqlhelp wanted

Repository-Metriken

Stars
 (19.563 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 5T 16h) (138 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide