Bug #68869 | InnoDB's thread concurrency tickets might be released after a row is read | ||
---|---|---|---|
Submitted: | 4 Apr 2013 23:50 | Modified: | 15 May 2013 20:51 |
Reporter: | Davi Arnaut (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.5.30, 5.6 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | concurrency tickets, innodb, thread concurrency |
[4 Apr 2013 23:50]
Davi Arnaut
[5 Apr 2013 0:17]
Mark Callaghan
Can the code be updated to be clever enough to only call ha_release_temporary_latches when the server really is writing to a socket and not "maybe" writing to one? /* We may be passing the control from mysqld to the client: release the InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved by thd */ ha_release_temporary_latches(thd);
[5 Apr 2013 18:06]
MySQL Verification Team
Verified upon the inspection of the code.
[7 Apr 2013 5:50]
zhai weixiang
this bug seems only affect 5.5. quoted code In 5.6 innobase_release_temporary_latches( /*===============================*/ handlerton* hton, /*!< in: handlerton */ THD* thd) /*!< in: MySQL thread */ { DBUG_ASSERT(hton == innodb_hton_ptr); if (!innodb_inited) { return(0); } trx_t* trx = thd_to_trx(thd); if (trx != NULL) { trx_search_latch_release_if_reserved(trx); } return(0); } quoted code in 5.5 static int innobase_release_temporary_latches( /*===============================*/ handlerton* hton, /*!< in: handlerton */ THD* thd) /*!< in: MySQL thread */ { trx_t* trx; DBUG_ASSERT(hton == innodb_hton_ptr); if (!innodb_inited) { return(0); } trx = thd_to_trx(thd); if (trx) { innobase_release_stat_resources(trx); } return(0); }
[15 May 2013 20:51]
Bugs System
Added a changelog entry for 5.5.33, 5.6.13, 5.7.2: "When InnoDB thread concurrency is enabled, there was a possibility that thread concurrency tickets would be released after each row is read resulting in a concurrency check after each read. A concurrency check after each read could impact performance of queries that return a large number of rows."
[29 May 2014 22:03]
James Day
There are two ways you might notice this on upgrade from 5.5 to 5.6: 1. An increase in system CPU usage in 5.6 compared to 5.5 due to the extra mutex checking. 2. The performance effect. James Day, MySQL Senior Principal Support Engineer, Oracle.