← Back to team overview

maria-developers team mailing list archive

Group commit id in mysqlbinlog output

 

There was a question on the output of mysqlbinlog related to group commit.

In 10.0, if two transactions group commit together on the master, their GTID
event contains a "commit id" - a 64-bit number. This is used by parallel
replication; if two transactions have the same commit id, they can be executed
in parallel.

In mysqlbinlog output, this looks like this:

#140314 13:42:56 server id 1  end_log_pos 772   GTID 0-1-12 cid=180
...
#140314 13:42:56 server id 1  end_log_pos 1027  GTID 0-1-13 cid=180

But if a transaction commits alone on the master (no other transactions
participate in the group commit), the mysqlbinlog outpus has no commit id:

#140314 13:42:56 server id 1  end_log_pos 437   GTID 0-1-10

The question was why there is no cid=X in the second case, as it makes
scripting/grepping the output harder. The reason is that there is no commit id
in the event in the binlog in this case (to reduce the size of the binlog).
So there is no valid number to put in there.

One option could be to make the output something like this:

#140314 13:42:56 server id 1  end_log_pos 437   GTID 0-1-10 cid=<none>

This would allow to grep for "cid=" and catch everything. I do not have a
strong opinion one way or the other, if there are people who find this useful,
then let me know and I can change it.

 - Kristian.


Follow ups