Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TempDirectories parameter in firebird.conf ignored by global temporary tables [CORE1241] #1665

Closed
firebird-automations opened this issue May 3, 2007 · 18 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: John Franck (bozzy)

Is duplicated by CORE1809

Votes: 3

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

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

What's your TempDirectories value?

@firebird-automations
Copy link
Collaborator Author

Commented by: John Franck (bozzy)

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

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?

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Commented by: John Franck (bozzy)

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

You could just set up the FIREBIRD_TMP envvar to point to /data/temp. It will work for both sorting and temp-table files.

@firebird-automations
Copy link
Collaborator Author

Commented by: John Franck (bozzy)

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.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12002 ] => Firebird [ 15464 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE1809 [ CORE1809 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @romansimakov

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

Do not suppose that team can have objections with this :) I suppose PR is more then welcome :)

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

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..

@firebird-automations
Copy link
Collaborator Author

Commented by: @romansimakov

I agree. Especially if new config option is overriding FIREBIRD_TMP that is a single dir.

@firebird-automations
Copy link
Collaborator Author

Commented by: John Franck (bozzy)

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).

@pavel-zotov
Copy link

::: test details :::
Test checks ability to use TempTableIDrectory parameter and also verifies that firebird.log contains error message when this parameter points to inaccessible directory or has invalid value (see fd0fa8a ; "Let include file name into error message when creation of temp file failed.")
See details in .fbt

@dyemanov
Copy link
Member

TempTableDirectory configuration setting is available since FB 4.0, so I'm closing this ticket as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants