Issue Details (XML | Word | Printable)

Key: CORE-1241
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Vlad Khorsun
Reporter: John Franck
Votes: 3
Watchers: 6

If you were logged in you would be able to see more operations.
Firebird Core

TempDirectories parameter in firebird.conf ignored by global temporary tables

Created: 03/May/07 10:01 AM   Updated: 15/Dec/20 09:00 AM
Component/s: Engine
Affects Version/s: 2.1 Alpha 1
Fix Version/s: None

Environment: Ubuntu Linux 6.06, Kernel 2.6.15-28-686, FB 2.1 Alpha 1 build 15199
Issue Links:

 Description  « Hide
Files created for Global Temporary Tables are located on linux default temporary directory (/tmp), ignoring the setting imposed by TempDirectories parameter in firebird.conf.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 07/May/07 09:49 AM
What's your TempDirectories value?

John Franck added a comment - 07/May/07 10:01 AM
I have a partition mounted in /data and a 'temp' directory inside this partition. In firebird.conf I have: TempDirectories = /data/temp

This is because my / (root) partition is quite small and all the data is located in /data, which is much bigger.

Note that in /data I have a 'db' directory inside which there are my databases and in firebird.conf I have also: DatabaseAccess = Restrict /data/db

I don't know if this could be useful for debugging.

Dmitry Yemanov added a comment - 13/Nov/07 05:36 AM
The problem is that temporary tables cannot support the configured directory size limit. Imagine a setup:

  TempDirectories = /data/temp1 5000000000; /data/temp2

Would you agree with FB storing 20GB of temp tables in /data/temp1 regardless of your configuration?

John Franck added a comment - 13/Nov/07 09:14 AM
Well, no, it will be probably unacceptable.

But in my opinion it's equally unacceptable that FB is storing 20GB of temp tables in /tmp, that's located on a 3GB partition dedicated to the OS.

My considerations are obviously based on my own conditions, but I would prefer FB to store temp tables where I've told him to store temp data, maybe regardless of my imposed size limit if it's an issue.
Or maybe it would be also better to have another parameter in firebird.conf where I can set temp directory for temp tables, without support for size limit if it isn't possible.

Dmitry Yemanov added a comment - 13/Nov/07 09:19 AM
You could just set up the FIREBIRD_TMP envvar to point to /data/temp. It will work for both sorting and temp-table files.

John Franck added a comment - 13/Nov/07 09:34 AM
I guessed TempDirectories and FIREBIRD_TMP was the same, the first overwriting the last. So if it's not like that your solution is ok for me. Thank you.

Karol Bieniaszewski added a comment - 28/Oct/18 09:16 PM
Somehow i miss this report but it is vital.
User specify temp directory by hand. This mean that user do not need to use default system TEMP.
This should be fixed to use TempDirectories or new config variable should be provided.

Consider multiple firebird instances for different purposes. User must have choice where to write from particular instance.
System variable is not the option.
Also look at shared hostings where user can be limited to only one directory tree without acces also for Windows\temp.

I suppose it is simple to fix.

Roman Simakov added a comment - 14/Dec/20 10:15 AM
It seems we stepped onto it.
The usage of FIREBIRD_TMP variable is really looks not so obvious as a config option. It would be more clear to add a new option and describe the difference next to the TempDirectories. I guess the name "TempTableDirecties" is a good candidate.
We can prepare PR if you don't mind.

Karol Bieniaszewski added a comment - 14/Dec/20 10:38 AM
Do not suppose that team can have objections with this :) I suppose PR is more then welcome :)

Dmitry Yemanov added a comment - 14/Dec/20 10:57 AM
If it's going to be a separate setting, then supposedly it should specify a single directory, not a list (and thus be named TempTableDirector*y*).
Another option could be to make temporary page spaces multi-file and split the files between multiple directories inside the TempDirectories list. But I'm afraid it gonna be complicated.

Karol Bieniaszewski added a comment - 14/Dec/20 11:38 AM
In this days one directory is more than enough i suppose. I stop using multiple dirs for TempDirectories a couple of years ago. As now storage is so big even this fast one..

Roman Simakov added a comment - 14/Dec/20 12:11 PM
I agree. Especially if new config option is overriding FIREBIRD_TMP that is a single dir.

John Franck added a comment - 15/Dec/20 09:00 AM
I agree with the solution of adding a separate configuration option (I asked for it 13 years ago :D ), "TempTableDirectory" or "TempTablesDirectory" (note the plural on Tables) could be fine.
It should overwrite FIREBIRD_TMP env var, if present.

BTW, I'm not using FIREBIRD_TMP variable anymore, with the storage available nowadays I've got plenty of space on /tmp directory, so this default is OK for temp tables (for my usage scenarios).