Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-3937

Some file operations in mf_iocache2.c are not instrumented

    XMLWordPrintable

    Details

      Description

      my_b_append_tell(), my_b_fill() and my_b_filelength() functions from 'mf_iocache2.c' use non-instrumented file tell/seek/read functions (my_tell(), my_seek() and my_read()) instead of their instrumented version (mysql_file_tell(), mysql_file_seek() and mysql_file_read()).

      This causes inaccurate statistics in PERFORMANCE_SCHEMA.

      Run

      ./mysql-test/mtr --debug-server perfschema.relaylog
      
      "============ Performance schema on master ============"
       select
       substring(file_name, locate("master-", file_name)) as FILE_NAME,
       EVENT_NAME,
       if (count_read > 0, "MANY", "NONE") as COUNT_READ,
       if (count_write > 0,"MANY", "NONE") as COUNT_WRITE,
       if (sum_number_of_bytes_read > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_READ,
       if (sum_number_of_bytes_write > 0, "MANY", "NONE") as SUM_NUMBER_OF_BYTES_WRITE
       from performance_schema.file_summary_by_instance
       where file_name like "%master-%" order by file_name;
      

      This query (and similar) should return 'MANY' for 'COUNT_READ' and 'SUM_NUMBER_OF_BYTES_READ' instead of 'NONE'
       
      Suggested fix:
      Change my_tell() / my_seek() / my_read() to mysql_file_tell() / mysql_file_seek() / mysql_file_read() in 'mf_iocache2.c'.

        Smart Checklist

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  yura.sorokin Yura Sorokin
                  Reporter:
                  yura.sorokin Yura Sorokin
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 day
                    1d