From 563ebdbdf015cd4f91f07401964eecbf3775ab45 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Tue, 25 Mar 2014 01:27:38 +0000 Subject: [PATCH] SOLR-5907: The hdfs write cache can cause a reader to see a corrupted state. It now defaults to off, and if you were using solr.hdfs.blockcache.write.enabled explicitly, you should set it to false. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1581174 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 8 ++++++++ .../java/org/apache/solr/core/HdfsDirectoryFactory.java | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index f90a75b50b0..5b3bfc9c962 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -322,6 +322,13 @@ Bug Fixes * SOLR-5734: We should use System.nanoTime rather than System.currentTimeMillis when calculating elapsed time. (Mark Miller, Ramkumar Aiyengar) +<<<<<<< .mine +* SOLR-5907: The hdfs write cache can cause a reader to see a corrupted state. + It now defaults to off, and if you were using solr.hdfs.blockcache.write.enabled + explicitly, you should set it to false. + (Mark Miller) + +======= * SOLR-5760: ConcurrentUpdateSolrServer has a blockUntilFinished call when streamDeletes is true that should be tucked into the if statement below it. (Mark Miller, Gregory Chanan) @@ -329,6 +336,7 @@ Bug Fixes * SOLR-5761: HttpSolrServer has a few fields that can be set via setters but are not volatile. (Mark Miller, Gregory Chanan) +>>>>>>> .r1581173 ================== 4.7.0 ================== Versions of Major Components diff --git a/solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java index af104c02475..09e785bcf76 100644 --- a/solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java +++ b/solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java @@ -106,9 +106,12 @@ public class HdfsDirectoryFactory extends CachingDirectoryFactory { boolean blockCacheEnabled = params.getBool(BLOCKCACHE_ENABLED, true); boolean blockCacheGlobal = params.getBool(BLOCKCACHE_GLOBAL, false); // default to false for back compat - boolean blockCacheReadEnabled = params.getBool(BLOCKCACHE_READ_ENABLED, - true); + boolean blockCacheReadEnabled = params.getBool(BLOCKCACHE_READ_ENABLED, true); boolean blockCacheWriteEnabled = params.getBool(BLOCKCACHE_WRITE_ENABLED, true); + + if (blockCacheWriteEnabled) { + LOG.warn("Using " + BLOCKCACHE_WRITE_ENABLED + " is currently buggy and can result in readers seeing a corrupted view of the index."); + } Directory dir = null; if (blockCacheEnabled && dirContext != DirContext.META_DATA) {