Index: lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java
===================================================================
--- lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java	(revision 1195967)
+++ lucene/src/java/org/apache/lucene/index/DocumentsWriterDeleteQueue.java	(working copy)
@@ -169,7 +169,13 @@
   boolean anyChanges() {
     globalBufferLock.lock();
     try {
-      return !globalSlice.isEmpty() || globalBufferedDeletes.any();
+      /*
+       * check if all items in the global slice were applied 
+       * and if the global slice is up-to-date
+       * and if globalBufferedDeletes has changes
+       */
+      return globalBufferedDeletes.any() || !globalSlice.isEmpty() || globalSlice.sliceTail != tail
+          || tail.next != null;
     } finally {
       globalBufferLock.unlock();
     }
Index: lucene/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java
===================================================================
--- lucene/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java	(revision 1195967)
+++ lucene/src/test/org/apache/lucene/index/TestDocumentsWriterDeleteQueue.java	(working copy)
@@ -16,10 +16,12 @@
  * License for the specific language governing permissions and limitations under
  * the License.
  */
+import java.lang.reflect.Field;
 import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.lucene.index.DocumentsWriterDeleteQueue.DeleteSlice;
 import org.apache.lucene.search.TermQuery;
@@ -142,6 +144,32 @@
       }
     }
   }
+  
+  public void testPartiallyAppliedGlobalSlice() throws SecurityException,
+      NoSuchFieldException, IllegalArgumentException, IllegalAccessException,
+      InterruptedException {
+    final DocumentsWriterDeleteQueue queue = new DocumentsWriterDeleteQueue();
+    Field field = DocumentsWriterDeleteQueue.class
+        .getDeclaredField("globalBufferLock");
+    field.setAccessible(true);
+    ReentrantLock lock = (ReentrantLock) field.get(queue);
+    lock.lock();
+    Thread t = new Thread() {
+      public void run() {
+        queue.addDelete(new Term("foo", "bar"));
+      }
+    };
+    t.start();
+    t.join();
+    lock.unlock();
+    assertTrue("changes in del queue but not in slice yet", queue.anyChanges());
+    queue.tryApplyGlobalSlice();
+    assertTrue("changes in global buffer", queue.anyChanges());
+    FrozenBufferedDeletes freezeGlobalBuffer = queue.freezeGlobalBuffer(null);
+    assertTrue(freezeGlobalBuffer.any());
+    assertEquals(1, freezeGlobalBuffer.termCount);
+    assertFalse("all changes applied", queue.anyChanges());
+  }
 
   public void testStressDeleteQueue() throws InterruptedException {
     DocumentsWriterDeleteQueue queue = new DocumentsWriterDeleteQueue();
