apache / apache/lucene

Modify FSIndexOutput in FSDirectory to open output steam for Write and Read [LUCENE-6176]

Open
#7,238 1 comment 0 reactions 1 assignee Claimed by @uschindler View on GitHub
affects-version:4.10.2 legacy-jira-label:Windows legacy-jira-priority:Major module:core/store type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The FSIndexOutput, in FSDirecotry, opens the output file stream for Write/Append (W/A), but no Read. This is an issue when Windos wites to remote files. For local storage files the Windows cache manager is part of the kernel and can read from the file even if it is opened for W/A only (and it needs to read the current content of the page). When accessing remote files, like SMB shares, the cache manager is restricted to the access mode requested from the remote system. In this case since it is W/A every write, even a single byte, is a roundtrip to the remote storage server.

Openning the output file stream for Write and Read, which does not impact other functionality, allows Windows to cache the individual Lucene writes regadless of their size

---
Migrated from [LUCENE-6176](https://issues.apache.org/jira/browse/LUCENE-6176) by Wojtek Kozaczynski
Environment:
```
Windows
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.