Amrit Verma created OAK-9408:
--------------------------------

             Summary: OakStreamingIndexFile negative file length
                 Key: OAK-9408
                 URL: https://issues.apache.org/jira/browse/OAK-9408
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: indexing
    Affects Versions: 1.38.0
            Reporter: Amrit Verma
            Assignee: Amrit Verma


The calculation done 
[here|https://github.com/apache/jackrabbit-oak/blob/83969ee96c9b2db256c36c99f3d3b19029c5c5c1/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/OakStreamingIndexFile.java#L113-L118]
 results in negative file length if blob length comes as 0. Blob length could 
be 0 in case it wasn't downloaded properly.

Negative file length causes confusion when it gets reported in errors like -
{code:java}
org.apache.jackrabbit.oak.plugins.index.search.BadIndexTracker Could not open 
the Fulltext index at [/oak:index/ntBaseLucene-2]
java.io.IOException: Invalid byte range request for 
[/oak:index/ntBaseLucene-2][_6l.cfs], position: 0, file length: -16, len: 
1{code}
and 
{code:java}
[async-index-update-async] 
org.apache.jackrabbit.oak.plugins.index.lucene.directory.CopyOnReadDirectory 
[/oak:index/ntBaseLucene-2] Found local copy for _6l.cfs in 
NIOFSDirectory@/<path>/repository/index/ntBaseLucene2-1612972365881/data 
lockFactory=NativeFSLockFactory@/<path>/repository/index/ntBaseLucene2-1612972365881/data
 but size of local 17266 differs from remote -16. Content would be read from 
remote file only  {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to