Bug #52134 performance schema file io, symlink in path
Submitted: 17 Mar 2010 11:08 Modified: 4 Aug 2010 20:08
Reporter: Marc Alff Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:mysql-next-mr, 5.6.99-m3 OS:Any
Assigned to: Marc Alff CPU Architecture:Any
Triage: Triaged: D3 (Medium)

[17 Mar 2010 11:08] Marc Alff
Description:
This is a follow up on bug#51447 performance schema evil twin files

While the original bug is resolved for bug#51447, the code is still not working in more general cases.

In particular, if a symbolic link is used in the path of a file, the performance schema does not
resolve all file io to the same name.

In particular, when running the test suite with MTR_MEM=1:

/Users/malff/BZR_TREE/mysql-next-mr/mysql-test/var
is a symbolic link to
/tmp/var_auto_OJvY

so that files in the var directory (every SQL table) are seen with two names,
causing the performance_schema.misc test to fail.

This is not a test issue but a verified bug: a production system using symbolic links for the mysql data home directory will have the same problems: file instrumentation leaks in the performance schema.

How to repeat:
export MTR_MEM=1
./mtr misc
[22 Mar 2010 9:08] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/103937

3138 Marc Alff	2010-03-22
      Bug#52134 performance schema file io, symlink in path
      
      Before this fix, a file named "/path/with/link/to/filename"
      would be normalized to:
      - "/path/with/link/to/filename" when the file did not exist (creation),
      - "/real/path/to/filename" when the file did exist (file io, deletion),
      causing instrumentation leak for file io in the performance schema.
      
      With this fix, file name normalization has been revisited to be more robust,
      and always resolve this case to "/real/path/to/filename".
      
      File instrumentation now works properly, even when a symbolic link
      is present in the directory name, which is the case when running tests
      with MTR_MEM=1, where the var directory is a link to shared memory.
[22 Mar 2010 12:40] Marc Alff
Approved by Guilhem, with a minor comment:
use FN_CURLIB instead of FN_HOMELIB, for "./filename".
[22 Mar 2010 13:17] Marc Alff
Patch queued in:
- mysql-next-mr-bugfixing
- mysql-6.0-codebase-bugfixing
[24 Mar 2010 8:15] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100324081249-yfwol7qtcek6dh7w) (version source revid:alik@sun.com-20100324081113-kc7x1iytnplww91u) (merge vers: 6.0.14-alpha) (pib:16)
[24 Mar 2010 8:17] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100324081159-5b8juv8ldiqwce8v) (version source revid:alik@sun.com-20100324081105-y72rautcea375zxm) (pib:16)
[24 Mar 2010 17:20] Paul Dubois
No 6.0.x changelog entry needed (does not appear in any 6.0 release).

Setting report to Need Merge pending push of Celosia to release tree.
[16 Jul 2010 0:25] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/113719

3119 Marc Alff	2010-07-15
      Bug#52134 performance schema file io, symlink in path
      
      Backport from mysql-next-mr (5.6) to mysql-trunk (5.5)
[16 Jul 2010 0:30] Marc Alff
Pushed into mysql-trunk-bugfixing (5.5.6)
[23 Jul 2010 12:25] Bugs System
Pushed into mysql-trunk 5.5.6-m3 (revid:alik@sun.com-20100723121820-jryu2fuw3pc53q9w) (version source revid:vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1) (merge vers: 5.5.5-m3) (pib:18)
[23 Jul 2010 12:32] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100723121929-90e9zemk3jkr2ocy) (version source revid:vasil.dimov@oracle.com-20100531152341-x2d4hma644icamh1) (pib:18)
[29 Jul 2010 18:48] Paul Dubois
Noted in 5.5.6 changelog.

If a symbolic link was used in a file path name, the Performance 
Schema did not resolve all file io events to the same name.
[4 Aug 2010 8:06] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804080001-bny5271e65xo34ig) (version source revid:alik@sun.com-20100324081105-y72rautcea375zxm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 8:22] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@ibmvm-20100804081533-c1d3rbipo9e8rt1s) (version source revid:alik@sun.com-20100324081105-y72rautcea375zxm) (merge vers: 5.6.99-m4) (pib:18)
[4 Aug 2010 20:08] Paul Dubois
Bug is not present in any released 5.6.x version.