FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.24k stars 212 forks source link

Direct I/O does not work on ZFS filesystem [CORE5135] #5419

Open firebird-automations opened 8 years ago

firebird-automations commented 8 years ago

Submitted by: Sascha Michel (datiscum1)

In the FIle "Firebird-3.0.0_RC2-ReleaseNotes.pdf" i read this:

The maximum number of pages that can be configured for the database cache depends on whether the database is running under 64-bit or 32-bit Firebird: • 64-bit :: 2 31 -1 (2,147,483,647) pages • 32-bit :: 128,000 pages, i.e., unchanged from V.2.5

On a 64-bit system i can't set values greater then 65535 !

Command: root@FB30:/opt/firebird/bin#⁠ ./gfix -b 65536 -user sysdba -pa masterkey 127.0.0.1:KM I/O error during "re open() for SYNC/DIRECT" operation for file "/DB/KM.fdb" -Error while trying to open file -Invalid argument

The database becomes unavailable.

When i set: root@FB30:/opt/firebird/bin#⁠ ./gfix -b 65535 -user sysdba -pa masterkey 127.0.0.1:KM

All is OK.

firebird-automations commented 8 years ago
Modified by: Sean Leyne (seanleyne) description: In the FIle "Firebird\-3\.0\.0\_RC2\-ReleaseNotes\.pdf" i read this: The maximum number of pages that can be configured for the database cache depends on whether the database is running under 64\-bit or 32\-bit Firebird: • 64\-bit :: 2 31 \-1 \(2,147,483,647\) pages • 32\-bit :: 128,000 pages, i\.e\., unchanged from V\.2\.5 On a 64\-bit system i can't set values greater then 65535 \! Command: root@FB30:/opt/firebird/bin#⁠ \./gfix \-b 65536 \-user sysdba \-pa masterkey 127\.0\.0\.1:KM I/O error during "re open\(\) for SYNC/DIRECT" operation for file "/DB/KM\.fdb" \-Error while trying to open file \-Invalid argument The database becomes unavailable\. When i set: root@FB30:/opt/firebird/bin#⁠ \./gfix \-b 65535 \-user sysdba \-pa masterkey 127\.0\.0\.1:KM All is OK\. =\> In the FIle "Firebird\-3\.0\.0\_RC2\-ReleaseNotes\.pdf" i read this: The maximum number of pages that can be configured for the database cache depends on whether the database is running under 64\-bit or 32\-bit Firebird: • 64\-bit :: 2 31 \-1 \(2,147,483,647\) pages • 32\-bit :: 128,000 pages, i\.e\., unchanged from V\.2\.5 On a 64\-bit system i can't set values greater then 65535 \! Command: root@FB30:/opt/firebird/bin#⁠ \./gfix \-b 65536 \-user sysdba \-pa masterkey 127\.0\.0\.1:KM I/O error during "re open\(\) for SYNC/DIRECT" operation for file "/DB/KM\.fdb" \-Error while trying to open file \-Invalid argument The database becomes unavailable\. When i set: root@FB30:/opt/firebird/bin#⁠ \./gfix \-b 65535 \-user sysdba \-pa masterkey 127\.0\.0\.1:KM All is OK\.
firebird-automations commented 8 years ago
Modified by: Sean Leyne (seanleyne) summary: Maximum Number of Page Buffers in Cache =\> Error setting/defining Page Cache size
firebird-automations commented 8 years ago

Commented by: Sascha Michel (datiscum1)

OK, I have used strace to understand what happens in the two cases.

When i set Value 65535 i see that: open("/DB/KM.fdb", O_RDWR|O_DSYNC|O_CLOEXEC) = 6

When using 65536 i see that: open("/DB/KM.fdb", O_RDWR|O_DSYNC|O_DIRECT|O_CLOEXEC) = -1 EINVAL (Invalid argument)

"O_DIRECT" is the problem, because I use the ZFS file system.

I hope this information is helpful.

I do not understand why the Page Buffer changed the open options. It would be nice not to use the "O_DIRECT" or make it configurable !!

firebird-automations commented 8 years ago

Commented by: @hvlad

Sascha,

it is already configurable - read in firebird.conf description of FileSystemCacheThreshold setting and set its value to a number greater than planned page cache size

firebird-automations commented 8 years ago

Commented by: Sean Leyne (seanleyne)

Vlad,

Setting the value at the firebird.conf level is not always appropriate/convenient if you want to customize how some databases are configured.

So a more nuanced approach is necessary.

firebird-automations commented 8 years ago

Commented by: @hvlad

Sean,

one may change setting at per-database level in fb3.

firebird-automations commented 8 years ago

Commented by: Sascha Michel (datiscum1)

Vlad,

Thanks, now it works !

firebird-automations commented 8 years ago
Modified by: @dyemanov summary: Error setting/defining Page Cache size =\> Direct I/O does not work on ZFS filesystem
firebird-automations commented 8 years ago
Modified by: @dyemanov Version: 4\.0 Initial \[ 10621 \] Version: 2\.5\.5 \[ 10670 \] Version: 3\.0 RC1 \[ 10584 \] Version: 3\.0 Beta 2 \[ 10586 \] Version: 2\.5\.4 \[ 10585 \] Version: 2\.5\.3 Update 1 \[ 10650 \] Version: 3\.0 Beta 1 \[ 10332 \] Version: 2\.5\.3 \[ 10461 \] Version: 3\.0 Alpha 2 \[ 10560 \] Version: 3\.0 Alpha 1 \[ 10331 \] Version: 2\.5\.2 Update 1 \[ 10521 \] Version: 2\.5\.2 \[ 10450 \] Version: 2\.5\.1 \[ 10333 \] Version: 2\.5\.0 \[ 10221 \]