Bug #53119 request to make dynamic tmpdir option
Submitted: 23 Apr 2010 16:04 Modified: 27 May 2010 19:34
Reporter: Pavel Zheltouhov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S4 (Feature request)
Version:any OS:Any
Assigned to: CPU Architecture:Any
Tags: disk full, RAM, ramdrive, Repair, tmpdir, tmpfs

[23 Apr 2010 16:04] Pavel Zheltouhov
Description:
We use tmpdir option pointed to tmpfs linux filesystem in RAM for fast sorting in some queries. Size of 256mb necessary in most cases.
Sometimes we need repair big tables and that huge temporary file does get in tmpfs due limitation. So we need stop server, change tmpdir option, than start server again.
If we can change tmpdir option at runtme, this annoying behavior can be overcome.

How to repeat:
mysql> set global tmpdir='c:/';
ERROR 1238 (HY000): Variable 'tmpdir' is a read only variable
[23 Apr 2010 16:13] Valeriy Kravchuk
Thank you for the feature request. 

I wonder if tmpdir pointing to symbolic link and redefinition of symbolic link can be used as a workaround, at least in some cases.
[27 May 2010 19:34] Pavel Zheltouhov
I wrote some scripts for make tmp in memory at mysql startup (and check big tables).
I run mysql with disk tmpdir, after 600 seconds run script to remove symlink and create symlink to tmpfs.
How to make sure for tmpdir in memory ?

#lsof | grep /var/lib/tmpmysql 
display nothing 
but  lsof | grep myhardtmp display this :
mysqld    15108       mysql    4u      REG                8,5          0      46814 /myhardtmp/ibuAlcnG (deleted)
mysqld    15108       mysql    5u      REG                8,5          0      46825 /myhardtmp/ibPEPXHp (deleted)
mysqld    15108       mysql    6u      REG                8,5          0      46826 /myhardtmp/ib9qXJ28 (deleted)
mysqld    15108       mysql    7u      REG                8,5          0      46827 /myhardtmp/ibHxtjsS (deleted)
mysqld    15108       mysql   11u      REG                8,5          0      46828 /myhardtmp/ibzOtdZB (deleted)

Is it works or not ?
[8 Jul 2014 16:51] Eric Bergen
When this variable is dynamic it should also replicate.
[3 Dec 2014 7:11] Daniƫl van Eeden
This looks like a duplicate of Bug #50291