A Lightweight SQL Database for Cloud Infrastructure and Web Applications

slave plugin queryForReplicationEvents() query needs to be ordered

Reported by Joe Daly on 2011-04-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Medium
Joe Daly
7.1
Medium
Joe Daly

Bug Description

I believe the following query in the slave plugin should be ordered by commit_id the query below will be ordered by id, and this order will be used as the order that events are inserted into the queue. The id matches with trx_id which is not always ordered.

This could result in events that are read in the incorrect order by the consumer, if the timing is just right. I suspect this to be the problem with the multi-master test failures, as when I add the order clause the failures go away, but the errors don't show up outside the multi-master code so that is a little puzzling.

  /*
   * The SQL to pull everything we need from the master.
   */
  string sql= "SELECT `id`, `segid`, `commit_id`, `message`, `message_len` "
              " FROM `data_dictionary`.`sys_replication_log` WHERE `id` IN (";

  for (size_t x= 0; x < trx_id_list.size(); x++)
  {
    if (x > 0)
      sql.append(", ", 2);
    sql.append(boost::lexical_cast<string>(trx_id_list[x]));
  }

  sql.append(")", 1);

Joe Daly (skinny.moey) on 2011-04-09
Changed in drizzle:
status: New → In Progress
assignee: nobody → Joe Daly (skinny.moey)
importance: Undecided → Medium
Joe Daly (skinny.moey) on 2011-04-09
Changed in drizzle:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers