Dear hsqldb developers, I am wondering about this one method, the close() method in org/hsqldb/scriptio/ScriptWriterBase.java. It does a flush without doing a sync, then it closes the file. I could imagine a scenario: - HSQLDB started after a dirty shutdown. - new and old files deleted - backup restored - .script file read - .data file read - .log file read - .log file closed - .script.new file written - .script.new file closed - .log file deleted - .data file compressed into .backup.new - .backup.new renamed into .backup - .script.new renamed into .script --- ** server powered down abruptly ** ---
If close doesn't imply sync, at this point the data
for the .script file maybe still in the OS write cache
. And depending on host OS's write cache logic, the
.log file deletion maybe still queued in the OS write
cache, or the .log file deletion already written to
the storage medium. In Windows the disk cache for data
area is flushed independently from the disk cache for
system area (filename etc). So we (may) get : a
corrupt .script file and a missing .log file. I think
that what happened in my server, I got an empty
.script file (filled with 49KB of zeros) and no .log
file. I'm running HSQLDB on a Win2003 Server with JRE
1.4.2.
So, I think we should put a outDescriptor.sync()
call in the close() method. I'm attaching the proposed
patch with this email.
What do you think?
NB: sorry about the first post, the touch pad is a
little touchy
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
hsqldb-syncbeforeclose.patch
Description: 2971416845-hsqldb-syncbeforeclose.patch
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ hsqldb-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hsqldb-developers
