From b9a05a79384e748412c39bae4719f3237bf246e4 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 14 Jul 2014 10:47:02 +0000 Subject: [PATCH] LUCENE-5810: fix MDW logic around fsync, now that NRTCachingDirectory extends FilterDirectory git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1610382 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/java/org/apache/lucene/store/MockDirectoryWrapper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java index bee82cc4fd0..941767b2ac3 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java @@ -192,6 +192,9 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper { private boolean mustSync() { Directory delegate = in; while (delegate instanceof FilterDirectory) { + if (delegate instanceof NRTCachingDirectory) { + return true; + } delegate = ((FilterDirectory) delegate).getDelegate(); } return delegate instanceof NRTCachingDirectory;