Dmitry Yemanov b2968942a8 Updated WhatsNew 3 年之前
..
license 6fd54c9871 Fix licenses urls , sourcecode tree is moved to SVN from CVS 13 年之前
sql.extensions 7b4cc0b154 SIMILAR TO also requires escape of } 4 年之前
Firebird_conf.txt f78ddaa064 Backported CORE-6004: Add a switch to disable the "TCP Loopback Fast Path" option 7 年之前
README.DiskSpaceAllocation 1b83fbc2c8 A bit better wording. 18 年之前
README.IPv6 58a12d7c97 Allow to enforce IPv4 or IPv6 in URL-like connection string. 9 年之前
README.NTSecurity df59a7a41a misc 18 年之前
README.Optimizer.txt 854da4e241 Misc. 21 年之前
README.SecureRemotePassword.html c224e1ed4d Doc cleanup 7 年之前
README.Win32LibraryInstallation.txt 6a47a28ba0 More Win32 1.5 -> HEAD synchronisation. Updated documentation regarding gds32.dll and instclient.exe 22 年之前
README.Win9X_NT_embedding aca5a83a46 Fixed CORE-2609: Update support for Windows 98/ME and NT4.0 16 年之前
README.build.mingw.html f2b24d02ca Misc. 12 年之前
README.build.msvc.html 17b43f9ed3 Update Visual Studio Expresss 20xx Download link 11 年之前
README.build.posix.html ad327ed8b9 Update FreeBSD section for trunk in doc/README.build.posix.html 11 年之前
README.coding.style 4ca32b84ec An additional related to previous commit 22 年之前
README.connection_string_charset.txt 7a110f4be0 CORE-2929 - 'Invalid ESCAPE sequence' when connecting to the database 15 年之前
README.connection_strings 58a12d7c97 Allow to enforce IPv4 or IPv6 in URL-like connection string. 9 年之前
README.external_routines.txt 9e6a713f0f Misc. 16 年之前
README.fb_cancel_operation 0b2a994c27 Misc 16 年之前
README.fb_shutdown d724522871 Enhanced docs on fb_shutdown_callback() 8 年之前
README.fbsvcmgr a14a2159b2 Implemented CORE-2197: added support for -nodbtriggers switch in gbak into services API 17 年之前
README.garbage_collector 902671a044 Misc. 20 年之前
README.incompatibilities.txt 89ec718d3b Updated docs. 12 年之前
README.instsvc 08503e2be8 Update documentation for instsvc 18 年之前
README.intl b68d1dfc0c Misc. 14 年之前
README.isql_enhancements.txt e857b19539 Explain other isql options. 20 年之前
README.makefiles 4a80dfe3a8 Note for POSIX builders 19 年之前
README.monitoring_tables 9c050abadd Updated the README. 12 年之前
README.online_validation cc33027282 Misc. 10 年之前
README.performance_monitoring 59b235cea3 Small corrections 22 年之前
README.plugins.html 61e48dffe2 Documentation for new API 9 年之前
README.providers.html 4778665a44 Reflected API changes in beta1 11 年之前
README.raw_devices b3c33aeeb6 Renamed aliases.conf to databases.conf as suggested by Dmitry 13 年之前
README.read_password_from_file a5ff7ca091 Misc 17 年之前
README.services_extension 8a9a2cb6a6 Doc for CORE-4662: Make services API pass SQL role to server. 11 年之前
README.sha1 a749151080 Correct some files to refer to FB2 and security2.fdb 21 年之前
README.superclassic cec668d7fd Misc. 17 年之前
README.time_zone_forward_compatibility.md 15e25b3c35 Improvement CORE-5853 - Forward-compatible expressions LOCALTIME and LOCALTIMESTAMP. 7 年之前
README.trace_services 6247ba07eb Misc. 16 年之前
README.trusted_authentication abde3b2cad Misc. 10 年之前
README.user f676883248 Misc 19 年之前
README.user.embedded c3c18f0978 Misc. 15 年之前
README.user.troubleshooting cd010ff939 Misc 17 年之前
README.wire.compression.html 11c452251d Make zlib allocate memory from our pool 11 年之前
README.xnet c5c49d5e5e Added description of XNET. 20 年之前
Using_OO_API.html efe42da059 Fix MacOS UDR and Legacy_UserManager plugins not working due to not exported entry point. (#7088) 4 年之前
WhatsNew b2968942a8 Updated WhatsNew 3 年之前
ambiguity.txt 89af0c2a66 Little corrections. 21 年之前
cleaning-todo.txt 2a608f7814 Update cleaning todo for 3.x , remove already cleaned work done in 1.5.x,2.x 13 年之前
emacros-cross_ref.html deb63804dc cleanup 11 年之前
fb2-todo.txt 0f7cd8ec8b A couple TODO items I forgot 22 年之前
install_win32.txt 6a47a28ba0 More Win32 1.5 -> HEAD synchronisation. Updated documentation regarding gds32.dll and instclient.exe 22 年之前
install_windows_manually.txt b3c33aeeb6 Renamed aliases.conf to databases.conf as suggested by Dmitry 13 年之前
ods11-index-structure.html 4569af61eb ODS11 index structure description 21 年之前

README.DiskSpaceAllocation


Since the beginning, Firebird had no rules of how to allocate disk space
for database file(s). It just writes new allocated pages in not determined
order (because of dependencies between pages to serve "careful write" strategy).

This approach is very simple but has some drawbacks :

- because of not determined order of writes, there may be such situation when
page cache contains many dirty pages at time when new allocated page must be
written but can't because out of disk space. In such cases often all other
dirty pages are lost because administrators prefer to shutdown database
before making some space on disk available. This leads to serious corruptions.

- allocating disk space by relatively small chunks may lead to significant file
fragmentation at file system level and reduce performance of large scans (for
example during backup).


Using new ODS 11.1, Firebird changes its disk space allocation algorithm to
avoid corruptions in out of disk space conditions and to give the file system a
chance to avoid fragmentation. These changes are described below.

a) Every newly allocated page is written on disk immediately before returning to
the engine. If page can't be written then allocation doesn't happen, PIP bit
is not cleared and appropriate IO error is raised. This error can't lead to
corruptions as we have a guarantee that all dirty pages in cache have disk
space allocated and can be written safely.

This change makes one additional write of every newly allocated page compared
with old behavior. So performance penalty is expected during the database file
growth. To reduce this penalty Firebird groups writes of newly allocated pages
up to 128KB at a time and tracks number of "initialized" pages at PIP header.

Note : newly allocated page will be written to disk twice only if this page
is allocated first time. I.e. if page was allocated, freed and allocated again
it will not be written twice on second allocation.

b) To avoid file fragmentation, Firebird used appropriate file system's API to
preallocate disk space by relatively large chunks. Currently such API exists
only in Windows but it was recently added into Linux API and may be implemented
in such popular file system's as ext2, etc in the future. So this feature is
currently implemented only in Windows builds of Firebird and may be implemented
in Linux builds in the future.

For better control of disk space preallocation, new setting in Firebird.conf
was introduced : DatabaseGrowthIncrement. This is upper bound of preallocation
chunk size in bytes. Default value is 128MB. When engine needs more disk space
it allocates 1/16th of already allocated space but no less than 128KB and no more
than DatabaseGrowthIncrement value. If DatabaseGrowthIncrement is set to zero then
preallocation is disabled. Space for database shadow files is not preallocated.
Also preallocation is disabled if "No reserve" option is set for database.

Note : preallocation also allows to avoid corruptions in out of disk space
condition - in such case there is a big chance that database has enough space
preallocated to operate until administrator makes some disk space available.


Author: Vlad Khorsun,