But, if the JVM adheres to the Java specification (meaning it is
valid), this is not possible.
The Windows JVM calls Kernel32.FlushFileBuffers which also requires
'Write' permissions, but it seems to work ????
On Dec 6, 2007, at 4:21 PM, Michael McCandless (JIRA) wrote:
[ https://issues.apache.org/jira/browse/LUCENE-1044?
page=com.atlassian.jira.plugin.system.issuetabpanels:comment-
tabpanel#action_12549213 ]
Michael McCandless commented on LUCENE-1044:
--------------------------------------------
{quote}
I think this would work too?
{code}
FileInputStream fis = new FileInputStream(path);
fis.getFD().sync();
fis.close();
{code}
{quote}
This was suggested & debated on the java-dev list. But, the man page
for "fsync" on Linux lists this as one of the errors:
{code}
ERRORS
EBADF fd is not a valid file descriptor open for writing.
{code}
And Yonik found at least one JVM implementation (I think Harmony) that
simply skipped if the descriptor was not open for write.
I think we're walking on thin ice if we do that...
Behavior on hard power shutdown
-------------------------------
Key: LUCENE-1044
URL: https://issues.apache.org/jira/browse/
LUCENE-1044
Project: Lucene - Java
Issue Type: Bug
Components: Index
Environment: Windows Server 2003, Standard Edition, Sun
Hotspot Java 1.5
Reporter: venkat rangan
Assignee: Michael McCandless
Fix For: 2.4
Attachments: FSyncPerfTest.java, LUCENE-1044.patch,
LUCENE-1044.take2.patch, LUCENE-1044.take3.patch,
LUCENE-1044.take4.patch
When indexing a large number of documents, upon a hard power
failure (e.g. pull the power cord), the index seems to get
corrupted. We start a Java application as an Windows Service, and
feed it documents. In some cases (after an index size of 1.7GB,
with 30-40 index segment .cfs files) , the following is observed.
The 'segments' file contains only zeros. Its size is 265 bytes -
all bytes are zeros.
The 'deleted' file also contains only zeros. Its size is 85 bytes
- all bytes are zeros.
Before corruption, the segments file and deleted file appear to be
correct. After this corruption, the index is corrupted and lost.
This is a problem observed in Lucene 1.4.3. We are not able to
upgrade our customer deployments to 1.9 or later version, but
would be happy to back-port a patch, if the patch is small enough
and if this problem is already solved.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]