Percona Server with XtraDB

InnoDB reports that it's going to wait for I/O but the I/O is async

Reported by Sergei Glushchenko on 2013-01-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
Percona Server
Status tracked in 5.6
5.1
Undecided
Unassigned
5.5
Low
Sergei Glushchenko
5.6
Low
Sergei Glushchenko

Bug Description

Description:
Credit for discovery goes to MariaDB developers.

buf_read_page_low() reads:

thd_wait_begin(NULL, THD_WAIT_DISKIO);
if (zip_size) {
     fil_io(...);
} else {
     fil_io(...);
}
thd_wait_end(NULL, THD_WAIT_DISKIO);

The problem is that fil_io might be async here, returning much sooner than the sync call would (buf_read_page_low() has the ibool sync arg for that). Thus the thread might get needlessly reassigned to another query while it should have proceeded with the current one.

Don't know if it's a real issue with a thread pool or just a minor code quality as I cannot test with the Oracle thread pool.

How to repeat:
Might be possible to concoct some benchmark with MySQL Enterprise Edition, which I don't have an access to.

Suggested fix:
Guard thd_wait_begin()/thd_wait_end() calls with an if (sync) check.

Related branches

lp:~sergei.glushchenko/percona-server/55-tp
Merged into lp:percona-server/5.5 at revision 445
Stewart Smith (community): Approve on 2013-02-14
Laurynas Biveinis: Approve on 2013-01-31
Daniel Nichter: Pending (toolkit compatibility) requested 2012-12-11
Hrvoje Matijakovic: Pending (doc) requested 2012-12-11
Changed in percona-server:
assignee: nobody → Sergei Glushchenko (sergei.glushchenko)
status: Confirmed → Fix Committed
tags: added: innodb
Stewart Smith (stewart) wrote :

Is this fixed by the 55-tp branch?

Yes.

Fixed in upstream 5.5.31 and 5.6.11.

5.5$ bzr log -r 4189
------------------------------------------------------------
revno: 4189
committer: Inaam Rana <email address hidden>
branch nick: mysql-5.5
timestamp: Fri 2013-02-01 09:47:16 -0500
message:
  Bug#16249505 INNODB REPORTS THAT IT'S GOING TO WAIT FOR I/O BUT THE
  I/O IS ASYNC

  rb://1934
  approved by: Mikael Ronstrom (over email)

  When submitting AIO read request don't signal that the thread is
  about to wait on DISKIO

4701 in 5.6.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.