db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olav Sandstaa (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-2020) Change file option for syncing log file to disk from rws to rwd
Date Wed, 21 Mar 2007 17:47:32 GMT

     [ https://issues.apache.org/jira/browse/DERBY-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Olav Sandstaa updated DERBY-2020:
---------------------------------

    Attachment: jvmsyncbug.stat
                jvmsyncbug.diff

This patch (jvmsyncbug.diff) is a proposal for how we can handle the JVM bug that have been
reported for some JVMs on Mac OS and FreeBSD. The main change is to handle this bug as part
of the "error handling" after failing to open a log file in "rws" mode to explicitely checking
if this error is present. The purpose of this change is to be able to handle problems when
the log file is opened in "rws" and "rwd" mode (the current code in Derby only handles failures
for the "rws" mode).

The patch do the following during booting of Derby's logging module to detect if the JVM bug
is present

  1. Creates a file in the log directory using "rw" mode - this should succeed on all JVMs

  2. Re-opens the same file using "rws" mode. If this operation failes, the JVM bug is present.
An error message is written to the derby log file (not THE LOG but derby.log).

If the JVM bug is present, Derby changes from using synchronized writes for the log to use
normal writes followed by an explicite sync. The patch also removes the current code for handling
this problem.

The patch does NOT include the proposed change from using "rws" to "rwd" mode.

I do not have strong opinions about whether Derby should handle this JVM bug or not. I have
run derbyall and the JUnit test suite on JDK 5 on Solaris 10. I have not run it with any of
the JVMs with the reported JVM bug (I do no longer have a FreeBSD machine - and I have never
had a Mac). 

Feel free to review and commit the patch if you think this is a good thing to have in Derby.
If you think this code for handling a JVM specific error should not be in the code please
say so.

> Change file option for syncing log file to disk from rws to rwd
> ---------------------------------------------------------------
>
>                 Key: DERBY-2020
>                 URL: https://issues.apache.org/jira/browse/DERBY-2020
>             Project: Derby
>          Issue Type: Improvement
>          Components: Performance, Store
>    Affects Versions: 10.3.0.0
>            Reporter: Olav Sandstaa
>         Assigned To: Olav Sandstaa
>         Attachments: disk-cache.png, jvmsyncbug.diff, jvmsyncbug.stat, no-disk-cache.png,
rwd.diff, rwd.stat
>
>
> For writing the transaction log to disk Derby uses a
> RandomAccessFile. If it is supported by the JVM, the log files are
> opened in "rws" mode making the file system take care of syncing
> writes to disk. "rws" mode will ensure that both the data and the file
> meta-data is updated for every write to the file. On some operating
> systems (e.g. Solaris) this leads to two write operation to the disk
> for every write issued by Derby. This is limiting the throughput of
> update intensive applications.  If we could change the file mode to
> "rwd" this could reduce the number of updates to the disk.
> I have run some simple tests where I have changed mode from "rws" to
> "rwd" for the Derby log file. When running a small numbers of
> concurrent client threads the throughput is almost doubled and the
> response time is almost halved. I will attach some graphs that show
> this when running a given number of concurrent "tpc-b" like clients. These
> graphs show the throughput when running with "rws" and "rwd" mode when the
> disk's write cache has been enabled and disabled.
> I am creating this Jira to have a place where we can collect
> information about issues both for and against changing the default
> mode for writing to log files.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message