Bug #59390 row_merge_build_indexes() fails to register tmpfd for PFS
Submitted: 10 Jan 2011 8:31 Modified: 10 Feb 2011 20:01
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.5+ OS:Any
Assigned to: Jimmy Yang CPU Architecture:Any
Tags: create index, DDL, innodb, performance_schema

[10 Jan 2011 8:31] Marko Mäkelä
Description:
The merge sort in index creation allocates n_indexes+1 temporary files. One of the files is not registered in performance_schema, although it should be.

How to repeat:
Read row_merge_build_indexes(), row_merge_file_create(), row_merge_file_destroy(). Note that the file descriptor attached to tmpfd will be opened and closed without registration. (The assigned file descriptor may change during the merge sort.)

Suggested fix:
Register the tmpfd just like everything else. Maybe allocate a pseudo entry for it in the merge_files[] array.

Also, note that row_merge_file_destroy() may invoke register_pfs_file_io_begin() with fd==-1. Please move all the PFS stuff inside the if (merge_file->fd != -1) check.
[30 Jan 2011 16:59] Bugs System
Pushed into mysql-trunk 5.6.2 (revid:vasil.dimov@oracle.com-20110130165639-1pr3opz839b98q5j) (version source revid:vasil.dimov@oracle.com-20110130165522-m0o6al0pn5ig9kv3) (merge vers: 5.6.2) (pib:24)
[30 Jan 2011 17:00] Bugs System
Pushed into mysql-5.5 5.5.10 (revid:vasil.dimov@oracle.com-20110130165343-he9art47agq1a3gr) (version source revid:vasil.dimov@oracle.com-20110130165137-5lvzsq9j29j0hp1s) (merge vers: 5.5.10) (pib:24)