lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject lucene-solr:branch_7x: LUCENE-8233: Never reset initiazlized DV gen
Date Fri, 13 Apr 2018 07:45:18 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 21f396276 -> b8248d8fd


LUCENE-8233: Never reset initiazlized DV gen

We drop changes after we finish a merge, this has also reset
the DV generation the PendingSoftDeletes were initialized on causing
assertions to trip if releaseing the reader was writing DV to disk.
This change removes resetting the dv generation to make assertions
hold which requried to keep the pending change count on PendingSoftDeletes.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b8248d8f
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b8248d8f
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b8248d8f

Branch: refs/heads/branch_7x
Commit: b8248d8fd67ad1071a77595bb0bd69ea13cf9030
Parents: 21f3962
Author: Simon Willnauer <simonw@apache.org>
Authored: Fri Apr 13 09:30:32 2018 +0200
Committer: Simon Willnauer <simonw@apache.org>
Committed: Fri Apr 13 09:45:08 2018 +0200

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/index/PendingDeletes.java     | 4 ++--
 .../src/java/org/apache/lucene/index/PendingSoftDeletes.java | 8 ++++----
 .../src/java/org/apache/lucene/index/ReadersAndUpdates.java  | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b8248d8f/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java b/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
index fca42b4..52d06e8 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
@@ -166,7 +166,7 @@ class PendingDeletes {
   /**
    * Resets the pending docs
    */
-  void reset() {
+  void dropChanges() {
     pendingDeleteCount = 0;
   }
 
@@ -223,7 +223,7 @@ class PendingDeletes {
     // (successfully written) del docs:
     info.advanceDelGen();
     info.setDelCount(info.getDelCount() + pendingDeleteCount);
-    reset();
+    dropChanges();
     return true;
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b8248d8f/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java b/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
index 0d7852b..4c3db48 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
@@ -88,10 +88,10 @@ final class PendingSoftDeletes extends PendingDeletes {
   }
 
   @Override
-  void reset() {
-    dvGeneration = -2;
-    super.reset();
-    hardDeletes.reset();
+  void dropChanges() {
+    // don't reset anything here - this is called after a merge (successful or not) to prevent
+    // rewriting the deleted docs to disk. we only pass it on and reset the number of pending
deletes
+    hardDeletes.dropChanges();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b8248d8f/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java b/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
index 6dc8864..b236bea 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
@@ -287,7 +287,7 @@ final class ReadersAndUpdates {
     // is running, by now we have carried forward those
     // deletes onto the newly merged segment, so we can
     // discard them on the sub-readers:
-    pendingDeletes.reset();
+    pendingDeletes.dropChanges();
     dropMergingUpdates();
   }
 


Mime
View raw message