db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2020) Change file option for syncing log file to disk from rws to rwd
Date Mon, 12 Mar 2007 13:46:09 GMT

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

Knut Anders Hatlen commented on DERBY-2020:
-------------------------------------------

Thanks for investigating this issue, Olav. It is my understanding too that the javadoc in
RandomAccessFile gives the needed guarantee.

Some comments to the patch:
  - LogToFile mentions rws in some comments (for instance, "reopen the file in rws mode").
Should they be updated?
  - openLogFileInWriteMode() has a workaround for a JVM bug when opening in rws mode (DERBY-1).
The exception it catches is only thrown for rws, but the JVMs with this bug also have a buggy
rwd implementation. The bug in rwd only manifests itself by not syncing, so the workaround
won't work anymore (Derby will appear to work, and even be extremely fast on updates, but
the database might not be recoverable after a crash). If we change the file mode to rwd, I
think we have to update the workaround so that it still detects the JVM bug. Perhaps we could
detect it by opening a file in rws mode when booting the database, and if it throws FileNotFoundException
we enable the workaround?

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