WL#4162: Add start/end of trx/stm to binlog

Affects: Server-6.0 — Status: Un-Assigned — Priority: Medium

IDEA
====
Use single bits of the Common-Header of Log_Event to encode start and end of
transactions and statements.

RATIONALE
=========
1. To save space in binary log (don't need an entire event for
   begin/commit)
2. Easier to solve bugs such as BUG#26395 and BUG#29288.
3. We need a uniform way to determine statement/transaction start/end
   without having to parse the entire event. This paves the way for
   things like WL#3735 and WL#2540, makes debugging easier, and forces
   us to use a consistent model for the transactional behavior.
We want each of these event categories to be clearly expressed in
the binary log:

1. Transaction start
2. Statement start (this includes any event that is used
as "seed" for coming events)
3. Inside statement
4. Statement end
5. Transaction commit/autocommitted statement
6. Transaction rollback

Probably need 2 start bits:
01. No_start
10. Statement_start
11. Transaction_start

Probably need 2 end bits:
00. No_end
01. Transaction_commit (or autocommit)
10. Rollback
11. Statement_end

Note that a replication slave can detect that the events come from
an old master by reading the start bits: if they are 00, it must be
an old master.

Transaction_start means that the current event is the first event in
a transaction (hence, also the first in a statement).
Transaction_commit and Rollback mean that the current statement is
the last in a transaction (hence also the last in a statement).

For transactions involving XA tables, the last event describing a
statement (usually Query_log_event or row event) has only the
Statement_end flag set, and the Transaction_commit flag
is written for the following XID event.

You must be logged in to tag this worklog

No Comments yet

Votes

Not yet rated.
You must be logged in to vote.

Watches

0 members are watching this worklog
You must be logged in to track this worklog.

Provide Feedback

Please note:
HTML will be purified, but we allow for a number of HTML tags so that you have the flexibility to decorate your comment text to some extent. The comments allow the following HTML tags:

strong, b, em, blockquote, a, code, pre

To put code into your comment, simply encapsulate your code with
[code language="XXX"][/code], where XXX is any common language, for instance "PHP", "SQL", "C", etc.



You must be logged in to comment