maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #08384
MDEV-6877 - binlog_row_image implementation advice
Hi Sergei!
This past week I've done quite a bit of reading regarding the replication
code and how the binlog is used by both mysqlbinlog and the slaves in order
to do replication.
I think I now have a good enough understanding of the flow of the code for
both MySQL and MariaDB to actually start coding the feature into MariaDB. I
do have a couple of unknowns still. I don't quite understand what's the use
for the TABLE_MAP event. My intuition tells me its some sort of id we
assign to a table name (test.t1 for example) that gets used afterwards in
the binlog row events.
We seem to be using a bitmap of columns that we want to log into the
binlog. MySQL does extend the TABLE class to flip the bits according to the
binlog_row_image variable. That seems like the first place to start with
the addition. I could not find any other "hidden" logic that we use to
choose how we log row operations in the binlog. What I would like to know
is if there are any other pitfalls that I am supposed to watch out for, or
if there is anything else I may be missing regarding the logging part.
When it comes to actually doing the replication, I concluded that
Log_event::do_apply_event
is the place where we begin translating the event from the binlog to an SQL
statement.
Another concern that I have is how to test the implementation. Right now, I
run the test, get the binlog file and print it with mysqlbinlog and see if
the output is what I expect. Do we have something within mysql-test-run
that automates this?
Regards,
Vicentiu
Follow ups