Bug #55782 | ut_ad assert page_zip_get_size(&block->page.zip) == zip_size buf_page_get_gen() | ||
---|---|---|---|
Submitted: | 5 Aug 2010 14:48 | Modified: | 10 Jan 2011 22:07 |
Reporter: | Mikhail Izioumtchenko | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.6 | OS: | Any |
Assigned to: | Inaam Rana | CPU Architecture: | Any |
[5 Aug 2010 14:48]
Mikhail Izioumtchenko
[12 Aug 2010 11:14]
Marko Mäkelä
The failing assertion ut_ad(page_zip_get_size(&block->page.zip) == zip_size); should be moved after mutex_enter(block_mutex) or even mutex_exit(hash_mutex). Otherwise it will be performing a dirty read.
[12 Aug 2010 11:57]
Marko Mäkelä
After discussing this with Inaam and reviewing the code, I have an explanation for the assertion failure. page_zip_get_size() can only be changed by page_zip_set_size(). I reviewed all page_zip_set_size() calls in the code. When the function buf_page_init_for_read() allocates a block and a compressed page frame, it does that in two steps. First, it allocates the uncompressed block and adds it to page_hash. Then, while still holding hash_mutex, it acquires block->mutex and releases hash_mutex. Some time after that, it calls page_zip_set_size(). My initial suggestion was correct: the offending assertion was invoking page_zip_get_size() too early, before acquiring block_mutex. The assertion holds in the core dump, because the thread in buf_page_init_for_read() finally got around to invoking page_zip_set_size(). Other occurrences of page_zip_set_size() look fine: the zip.ssize is not being modified while the page resides in the buf_pool->page_hash. The question arises whether there are further problems. After buf_page_init_for_read() calls page_zip_set_size(), it releases the block->mutex. But, it did also I/O-fix the block for reading (BUF_IO_READ), telling buf_page_get_gen() to steer clear of it. Then it allocates the compressed page frame and acquires block->mutex shortly to make zip.data point to it.
[13 Nov 2010 16:08]
Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:alexander.nozdrin@oracle.com-20101113152450-2zzcm50e7i4j35v7) (merge vers: 5.6.1-m4) (pib:21)
[13 Nov 2010 16:38]
Bugs System
Pushed into mysql-next-mr (revid:alexander.nozdrin@oracle.com-20101113160336-atmtmfb3mzm4pz4i) (version source revid:vasil.dimov@oracle.com-20100629074804-359l9m9gniauxr94) (pib:21)
[5 Dec 2010 12:42]
Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)