Master's binlog position on slave

30 views
Skip to first unread message

Baron Schwartz

unread,
Nov 8, 2010, 9:55:15 PM11/8/10
to perco...@googlegroups.com
Why doesn't xtrabackup print out the master's binlog position after
--prepare, when it is run on a backup taken from a slave? This would
be very useful to have, and as far as I remember, InnoDB still prints
this information out.

Vadim Tkachenko

unread,
Nov 8, 2010, 10:41:19 PM11/8/10
to perco...@googlegroups.com
Baron,

We store it in file.

> --
> You received this message because you are subscribed to the Google Groups "Percona Dev" group.
> To post to this group, send email to perco...@googlegroups.com.
> To unsubscribe from this group, send email to percona-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/percona-dev?hl=en.
>
>

--
Vadim Tkachenko, CTO, Percona Inc.
Phone +1-888-401-3403,  Skype: vadimtk153
Schedule meeting: http://tungle.me/VadimTkachenko

Baron Schwartz

unread,
Nov 9, 2010, 10:14:33 AM11/9/10
to perco...@googlegroups.com
Hi Vadim,

I've just backed up a slave that I set up with mysql sandbox, and I see

ibdata1
ib_logfile0
ib_logfile1
xtrabackup_binlog_pos_innodb
xtrabackup_checkpoints
xtrabackup_logfile

And here's the binlog pos:

[baron@ginger backups]$ cat xtrabackup_binlog_pos_innodb
./mysql-bin.000001 3252665

That's the slave's position; I did FLUSH LOGS on the master so its
binlog was at #2. innobackupex stores the slave's position, but can't
xtrabackup get that from the recovery too? I'll crash my slave and
see if InnoDB itself can...

Baron

On Mon, Nov 8 at 19:41 Vadim Tkachenko wrote:
> Baron,
>
> We store it in file.
>
>
>
> On Mon, Nov 8, 2010 at 6:55 PM, Baron Schwartz <ba...@percona.com> wrote:
> > Why doesn't xtrabackup print out the master's binlog position after
> > --prepare, when it is run on a backup taken from a slave?  This would
> > be very useful to have, and as far as I remember, InnoDB still prints
> > this information out.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Percona Dev" group.
> > To post to this group, send email to perco...@googlegroups.com.
> > To unsubscribe from this group, send email to percona-dev...@googlegroups.com.
> > For more options, visit this group at http://groups.google.com/group/percona-dev?hl=en.
> >
> >
>
>
>


--
Chief Performance Architect at Percona <http://www.percona.com/>
+1 (888) 401-3401 x507
Calendar: <http://bit.ly/baron-percona-cal> (Eastern Time)
Flat-rate 24x7 support for MySQL <http://tinyurl.com/2fcmn34>

Baron Schwartz

unread,
Nov 9, 2010, 10:20:54 AM11/9/10
to perco...@googlegroups.com
It doesn't... not in this version of MySQL anyway (5.1.41 non-plugin):

InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 3252942, file name ./mysql-bin.000001
101109 10:16:03 InnoDB: Started; log sequence number 0 6976796

Hmmm. I thought I remembered that the "in a replication slave the last
master binlog position" text had been put back into the output of the
crash recovery. I don't remember the internal details of this -- is
the master's binlog pos still stored in the ib_logfiles? If so, can we
make xtrabackup extract it and print it out?

Vadim Tkachenko

unread,
Nov 9, 2010, 10:26:17 AM11/9/10
to perco...@googlegroups.com
Baron,

YOu should backup with --slave-info

--

Baron Schwartz

unread,
Nov 9, 2010, 10:33:21 AM11/9/10
to perco...@googlegroups.com
Hi Vadim,

You're thinking of innobackupex. I'm hoping that we can make this work
with just xtrabackup.

Vadim Tkachenko

unread,
Nov 9, 2010, 10:36:54 AM11/9/10
to perco...@googlegroups.com
Baron,

You can't do that without FLUSH TABLES WITH READ LOCK,
which should be executed from mysql connection.
As alternative you can use transactional replication, but it is
available only in Percona Server.

Baron Schwartz

unread,
Nov 9, 2010, 10:52:05 AM11/9/10
to perco...@googlegroups.com
Hi Vadim,

We used to be able to do it simply from the crash recovery (although
there were bugs in some mysqld versions):

InnoDB: Apply batch completed
InnoDB: In a MySQL replication slave the last master binlog file
InnoDB: position 0 115, file name portland-bin.001717
InnoDB: Last MySQL binlog file position 0 589600615, file name ./galax-bin.001376
080125 8:11:25 InnoDB: Started; log sequence number 3240 887995861

See <http://bugs.mysql.com/bug.php?id=34058>. Can we make xtrabackup
extract this info from the transaction log?

Peter Zaitsev

unread,
Nov 9, 2010, 10:54:30 AM11/9/10
to percona-dev
Baron,

Check what happens in the new version. I think in later 5.1 It was printed in recovery
corectly (to my surprise I remember that bug finally fixed)
Peter Zaitsev, CEO, Percona Inc.
Tel: +1 888 401 3401 ext 501   Skype:  peter_zaitsev
24/7 Emergency Line +1 888 401 3401 ext 911

Percona Training Workshops
http://www.percona.com/training/
Reply all
Reply to author
Forward
0 new messages