noj.n...@gmail.com
unread,Nov 27, 2014, 7:39:40 AM11/27/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to innod...@googlegroups.com
Hi
This might be valid for other page types as well, but I ran into it when inspecting a page with UNDO_LOG page type.
The page is marked as free and the extent is on the free list, as shown by page-account:
$ sudo innodb_space -s /mysql_data/data/ibdata1 -p 391880 page-account
Accounting for page 391880:
Page type is UNDO_LOG (Undo log, stores previous values of modified records).
Extent descriptor for pages 391872-391935 is at page 376832, offset 9558.
Extent is fully allocated to fseg 109269244.
Page is marked as free in extent descriptor.
Extent is in free list of space.
But dumping the page fails since it tries to output the UNDO Segment Header and the UNDO log.
$ sudo innodb_space -s /mysql_data/data/ibdata1 -p 391880 page-dump
#<Innodb::Page::UndoLog:0x0000000273e590>:
fil header:
{:checksum=>1063756241,
:offset=>391880,
:prev=>0,
:next=>0,
:lsn=>4867726853994,
:type=>:UNDO_LOG,
:flush_lsn=>0,
:space_id=>0}
undo page header:
{:type=>:update,
:latest_log_record_offset=>56,
:free_offset=>16324,
:page_list_node=>
{:prev=>{:page=>53, :offset=>44}, :next=>{:page=>391881, :offset=>44}}}
undo segment header:
/var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/page.rb:44:in `initialize': Page can't be initialized from nil space or buffer (space: #<Innodb::Space:0x0000000277d830>, buffer: ) (RuntimeError)
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/page.rb:24:in `new'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/page.rb:24:in `parse'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/space.rb:231:in `page'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/fseg_entry.rb:29:in `get_inode'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/page/undo_log.rb:63:in `block (2 levels) in undo_segment_header'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/util/buffer_cursor.rb:136:in `name'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/page/undo_log.rb:63:in `block in undo_segment_header'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/util/buffer_cursor.rb:136:in `name'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/page/undo_log.rb:59:in `undo_segment_header'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/lib/innodb/page/undo_log.rb:85:in `dump'
from /var/lib/gems/1.9.1/gems/innodb_ruby-0.9.12/bin/innodb_space:1498:in `<top (required)>'
from /usr/local/bin/innodb_space:23:in `load'
from /usr/local/bin/innodb_space:23:in `<main>'
Hacking around a bit, it works fine to suppress the output in undo_log.rb:
if self.space.xdes_for_page(self.offset).page_status(self.offset)[:free] != true
puts "undo segment header:"
pp undo_segment_header
puts
puts "last undo log:"
if undo_segment_header[:last_log_offset] != 0
undo_log(undo_segment_header[:last_log_offset]).dump
end
else
puts "page is marked as free"
end
But this is likely a rather bad solution, I just wanted to understand what failed.
Or perhaps this page is indeed in bad shape, I am not sure what the page layout _should_ be for freed UNDO pages. But if the page is valid, it would make sense to handle this when dumping it.
Anyway, the toolkit is awesome and extremely helpful!
Thanks
/Olle