[MDEV-4016] On-disk Temporary Tables Are Leaking Created: 2013-01-09 Updated: 2019-02-20 Resolved: 2013-11-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.0 |
| Fix Version/s: | 10.0.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Gordan Bobic | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream | ||
| Environment: |
Linux (RHEL6) |
||
| Description |
|
It would appear that temporary tables that get created on disk are being leaked. A lot of #sql*.ibd files get left behind in /tmp and never get reaped, even though most of them do not have open file handles (checked with lsof). There are no user-processes running on the server, only replication (from multiple sources) so it is somewhat mysterious that the temp tables are getting create in the first place. This may be related to |
| Comments |
| Comment by Elena Stepanova [ 2013-01-09 ] |
|
I can see this too. Regardless the default engine, with innodb_file_per_table=1 and InnoDB as an engine for a temporary table, 2 files per table are created in the tmp folder:
When connection exits, .frm file gets removed, but .ibd doesn't:
It doesn't seem to be happening on MySQL 5.6.9, possibly it was fixed in last 5.6 versions. I will need to dig a bit deeper into that to see if it was an upstream bug or not. |
| Comment by Elena Stepanova [ 2013-01-09 ] |
|
This one from mysql/5.6 commit log looks like a viable suspect: revno: 3690.34.123 |
| Comment by Elena Stepanova [ 2013-01-09 ] |
|
Confirmed: the problem was fixed in MySQL 5.6.7-rc, upstream revno: 3690.34.123 revision-id: kevin.lewis@oracle.com-20120615140142-f67erf3yqtg006cn. |
| Comment by Michael Widenius [ 2013-03-21 ] |
|
The fix is in the InnoDB code in MySQL 5.6. This will be included in the merge of MySQL 5.6 GA that we are doing for next 10.0 release. A temporary work around is to use CREATE TEMPORARY .... .ENGINE=ARIA |
| Comment by Sergei Golubchik [ 2013-10-31 ] |
|
Is it still an issue? |
| Comment by Elena Stepanova [ 2013-11-01 ] |
|
No, it's reproducible on 10.0.3, but not on 10.0.4, apparently was fixed by the InnoDB merge. Closing. |
| Comment by Ed Greenberg [ 2019-02-20 ] |
|
I think this is still a problem. Or is a problem again. I'm using 10.1.35 on Centos 7 installed from the rackspace-centos7-x86_64-ius repository. My server was restarted on 2/16/19. It currently has an uptime of 313014 seconds (or 3.6 days). I have accumulated over 43000 files in the temp directory, in the format of #sqlxxxx_xxx_0.ibd. Example. The oldest file in my tmp directory is
Then:
Over time, this really can fill up, requiring a server stop/start, which requires notification of outage, and all the procedure that comes with this. What more information can I provide? Thanks, |