HDFS-2751. Datanode may incorrectly drop OS cache behind reads even for short reads. Contributed by Todd Lipcon.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1233795 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Todd Lipcon 2012-01-20 07:31:44 +00:00
parent 3801eee036
commit 5809510395
2 changed files with 4 additions and 1 deletions

View File

@ -161,6 +161,9 @@ Release 0.23.1 - UNRELEASED
HDFS-2810. Leases not getting renewed properly by clients (todd)
HDFS-2751. Datanode may incorrectly drop OS cache behind reads
even for short reads. (todd)
Release 0.23.0 - 2011-11-01
INCOMPATIBLE CHANGES

View File

@ -315,7 +315,7 @@ class BlockSender implements java.io.Closeable {
* close opened files.
*/
public void close() throws IOException {
if (blockInFd != null && shouldDropCacheBehindRead) {
if (blockInFd != null && shouldDropCacheBehindRead && isLongRead()) {
// drop the last few MB of the file from cache
try {
NativeIO.posixFadviseIfPossible(