Groups > dBase > dBase SQL Servers > Re: Databases & Forced Writes on Linux




Databases & Forced Writes on Linux

Databases & Forced Writes on Linux
Wed, 12 Mar 2008 12:20:16 -050
Hi friends,
I've read (I don't remember where) that forced writes are not working in Linux.
That is a problem for our databases. I've read also that there is a fix for that
(something about a change in the /etc/fstab table). Does anyone have that
information at hand?.   
Thanks a lot
Jaime Escobal
Post Reply
Re: Databases & Forced Writes on Linux
Wed, 12 Mar 2008 12:58:30 -050
I found it!. It was on the last "Firebird 2.1 release notes", this is
the text:

"According to the Linux manual, “On Linux this command (i.e. fcntl(fd,
F_SETFL, flags)) can only change the O_APPEND, O_ASYNC, O_DIRECT, O_NOATIME, and
O_NONBLOCK flags”. Though it is not documented in any place known to me, it
turns out that an attempt to set any flag other than those listed in the manual
(such as O_SYNC, for example) won't work but it does not cause fcntl() to return
an error, either. "

"For Firebird and for InterBase versions since Day One, it means that
Forced Writes has never worked on Linux. It certainly works on Windows. It seems
likely that this is not a problem that affects other operating systems, although
we cannot guarantee that. To make sure, you can check whether the implementation
of fcntl() on your OS is capable of setting the O_SYNC flag. "

......

"Here's a tip if you want to do an instant fix for the problem in an older
version of Firebird: use the “sync” option when mounting any partition with a
Firebird database on board. An example of a line in /etc/fstab: "

  /dev/sda9    /usr/database    ext3    noatime,sync     1   2
       

Post Reply
Re: Databases & Forced Writes on Linux
Thu, 13 Mar 2008 07:25:31 +010
Jaime Escobal schrieb:
> that forced writes are not working in Linux. 

I don't know if they are not working at all or if they are just not 
working reliably.

But I do know that usually on LINUX systems you really don't need this 
option. Linux does not keep a change in memory and meanwhile notifies 
the client that the save has already taken place; Windows does this.

So, if from Linux, your client API will get the information that a 
record has been written to disk, it should mean exactly this.

On Windows, if your client API gets the info that a record has been 
written to disk, it could well be a lie by the system and the record 
could still be in RAM.

I never tested this, but that's what I have from the Firebird 
Post Reply
Re: Databases & Forced Writes on Linux
Thu, 13 Mar 2008 10:40:27 -050
*Lysander* Wrote:

> On Windows, if your client API gets the info that a record has been 
> written to disk, it could well be a lie by the system and the record 
> could still be in RAM.

yes, I know that :(. Thanks for the info, André
Jaime Escobal




Post Reply
about | contact