How is crash-safe replication implemented?

14 views
Skip to first unread message

Baron Schwartz

unread,
Feb 5, 2011, 6:47:58 AM2/5/11
to percona-d...@googlegroups.com
http://www.percona.com/docs/wiki/percona-server:features:innodb_overwrite_relay_log_info
has no information on how the position is stored in InnoDB. Is it
encoded in a location normally used for something else? (Is this why
the maximum relay log file name length is smaller?)

Are the limitations and other information mentioned on
http://code.google.com/p/google-mysql-tools/wiki/TransactionalReplication
also applicable to this feature?

Kristian Nielsen

unread,
Feb 18, 2011, 9:13:02 AM2/18/11
to percona-d...@googlegroups.com
Baron Schwartz <ba...@percona.com> writes:

> http://www.percona.com/docs/wiki/percona-server:features:innodb_overwrite_relay_log_info
> has no information on how the position is stored in InnoDB. Is it
> encoded in a location normally used for something else? (Is this why
> the maximum relay log file name length is smaller?)

It is stored in a fixed location in the "system header" - I believe this is
somewhere at the start of the system tablespace.

There are fixed offsets defined in include/trx0sys.h, eg. search for
TRX_SYS_MYSQL_MASTER_LOG_NAME_LEN and following constants. I don't know why
the size is exactly as it is, perhaps that was all there was room for in
whatever space was available in the system header.

All changes to these variables in the system header are also logged to the
InnoDB transaction log; this is what makes them transactionally consistent
with data changes. So one could also argue that the position is effectively
stored in the transaction log, and the log is where the latest value will most
likely be restored from following a crash.

> Are the limitations and other information mentioned on
> http://code.google.com/p/google-mysql-tools/wiki/TransactionalReplication
> also applicable to this feature?

Yes, I think they are, the features look very similar from the description on
that page).

Hope this helps,

- Kristian.

Reply all
Reply to author
Forward
0 new messages