Mysql replication breaks with RAND() data

Bug #1563541 reported by Doug Shelley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
High
Doug Shelley
Mitaka
New
Undecided
Unassigned

Bug Description

There appears to be an issue insert data using the RAND() function into a table on the master node.

To reproduce:
1. Create a 2 node replication network for Mysql 5.6 (i.e. trove create the master and then trove create --replica_of the slave)
2. create a table on the master:
       > create table test1(col1 float)
3. add data
       > insert into test1 select rand()

The table will have replicated to the slave but not the one row of data. Do this on slave:
SHOW SLAVE STATUS

You will see this:
Error executing row event: 'Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT.'

The issue is that we aren't explicitly setting the binlog_format on the slave to "MIXED". It is defaulting to "STATEMENT".

It is likely the same issue is happening for Percona and MariaDB.

Doug Shelley (0-doug)
Changed in trove:
assignee: nobody → Doug Shelley (0-doug)
milestone: none → ongoing
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/300253

Changed in trove:
status: New → In Progress
Doug Shelley (0-doug)
Changed in trove:
importance: Undecided → High
Amrith Kumar (amrith)
Changed in trove:
milestone: ongoing → newton-1
tags: added: liberty-rc-potential
tags: added: mitaka-rc-potential
removed: liberty-rc-potential
Changed in trove:
assignee: Doug Shelley (0-doug) → Amrith (amrith)
Amrith Kumar (amrith)
tags: removed: mitaka-rc-potential
Amrith Kumar (amrith)
no longer affects: trove/newton
Changed in trove:
assignee: Amrith (amrith) → Doug Shelley (0-doug)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/300253
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=9b03fec1e174d95b7a6047ba4a15eec3f801cf98
Submitter: Jenkins
Branch: master

commit 9b03fec1e174d95b7a6047ba4a15eec3f801cf98
Author: Doug Shelley <email address hidden>
Date: Thu Mar 31 23:18:38 2016 +0000

    Mysql replicas need to set binlog_format

    For GTID replication we set the replica source (i.e. master)
    to have a binlog_format of MIXED. We aren't setting this on
    the replicas so they default to STATEMENT. This causes a problem
    with certain "non-deterministic" functions (e.g. RAND()). This
    changes replica config templates for Mysql and Percona to use
    MIXED mode.

    A new scenario test was introduced to validate that the
    replicas have this set.

    MariaDB doesn't appear to have this issue so it wasn't changed.

    Scenario tests for Mysql, Percona and MariaDB were run to
    validate this change.

    Change-Id: I936cd9bc53a812af19653e9b5b472103fab2b6c1
    Closes-bug: 1563541

Changed in trove:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/trove 6.0.0.0b2

This issue was fixed in the openstack/trove 6.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.